diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2025-10-16 10:59:56 +0000 |
|---|---|---|
| committer | IT Fixcomart <it@fixcomart.co.id> | 2025-10-16 10:59:56 +0000 |
| commit | 5590a8cf2423c14baa991abf18ca31179a62c2bd (patch) | |
| tree | d263d376c68279f6b7eecb6bebe5fb5fb81365f3 /src/lib/brand/components | |
| parent | f6b1aea824192572b241f94157ab3731dec6a4ea (diff) | |
| parent | 9fa82a1c56e6e1628ef5a255ba3f66fb6aec83ec (diff) | |
Merged in media_banner (pull request #469)
Media banner
Diffstat (limited to 'src/lib/brand/components')
| -rw-r--r-- | src/lib/brand/components/BrandCard.jsx | 1 | ||||
| -rw-r--r-- | src/lib/brand/components/MediaCard.jsx | 42 |
2 files changed, 43 insertions, 0 deletions
diff --git a/src/lib/brand/components/BrandCard.jsx b/src/lib/brand/components/BrandCard.jsx index dff61b24..411e2669 100644 --- a/src/lib/brand/components/BrandCard.jsx +++ b/src/lib/brand/components/BrandCard.jsx @@ -5,6 +5,7 @@ import { createSlug } from '@/core/utils/slug'; const BrandCard = ({ brand }) => { const { isMobile } = useDevice(); + // console.log("Brand logo:", brand.logo); return ( <Link href={createSlug('/shop/brands/', brand.name, brand.id)} diff --git a/src/lib/brand/components/MediaCard.jsx b/src/lib/brand/components/MediaCard.jsx new file mode 100644 index 00000000..a6591abd --- /dev/null +++ b/src/lib/brand/components/MediaCard.jsx @@ -0,0 +1,42 @@ +import NextImage from 'next/image'; +import Link from '@/core/components/elements/Link/Link'; +import useDevice from '@/core/hooks/useDevice'; +import { createSlug } from '@/core/utils/slug'; + +const MediaCard = ({ media }) => { + const { isMobile } = useDevice(); + +// console.log("Media logo:", media); + + return ( + <Link + href={createSlug('/shop/media/', media.name, media.id)} + className={` + py-1 px-2 border-gray_r-6 flex justify-center items-center + hover:scale-110 transition duration-500 ease-in-out + ${isMobile ? 'h-16' : 'h-24'} + `} + aria-label={media.name} + > + {media.image ? ( + <NextImage + src={media.image} + alt={media.name} + width={500} + height={500} + quality={85} + className="h-full w-[122px] object-contain object-center" + /> + ) : ( + <span + className="text-center" + style={{ fontSize: `${16 - media.name.length * 0.5}px` }} + > + {media.name} + </span> + )} + </Link> + ); +}; + +export default MediaCard; |
