mirror of
https://github.com/vercel/commerce.git
synced 2025-07-06 13:01:22 +00:00
🎨 styles: product detail imgs
:%s
This commit is contained in:
parent
f6504be74f
commit
a7d0eb051c
@ -0,0 +1,4 @@
|
|||||||
|
.imgWithLink {
|
||||||
|
@apply w-full h-full;
|
||||||
|
object-fit: cover;
|
||||||
|
}
|
16
src/components/common/ImgWithLink/ImgWithLink.tsx
Normal file
16
src/components/common/ImgWithLink/ImgWithLink.tsx
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import s from './ImgWithLink.module.scss'
|
||||||
|
|
||||||
|
export interface ImgWithLinkProps {
|
||||||
|
src: string,
|
||||||
|
alt?: string,
|
||||||
|
}
|
||||||
|
|
||||||
|
const ImgWithLink = ({ src, alt }: ImgWithLinkProps) => {
|
||||||
|
return (
|
||||||
|
<img className={s.imgWithLink} src={src} alt={alt} />
|
||||||
|
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default ImgWithLink
|
@ -30,3 +30,4 @@ export { default as VideoPlayer} from './VideoPlayer/VideoPlayer'
|
|||||||
export { default as SelectCommon} from './SelectCommon/SelectCommon'
|
export { default as SelectCommon} from './SelectCommon/SelectCommon'
|
||||||
export { default as ModalCommon} from './ModalCommon/ModalCommon'
|
export { default as ModalCommon} from './ModalCommon/ModalCommon'
|
||||||
export { default as ModalCreateUserInfo} from './ModalCreateUserInfo/ModalCreateUserInfo'
|
export { default as ModalCreateUserInfo} from './ModalCreateUserInfo/ModalCreateUserInfo'
|
||||||
|
export { default as ImgWithLink} from './ImgWithLink/ImgWithLink'
|
||||||
|
@ -1,13 +1,9 @@
|
|||||||
.productImgs {
|
.productImgs {
|
||||||
@apply w-full;
|
@apply w-full flex justify-between items-center;
|
||||||
@screen sm-only {
|
@screen sm-only {
|
||||||
margin-bottom: 2rem;
|
margin-bottom: 2rem;
|
||||||
}
|
}
|
||||||
@screen lg {
|
@screen lg {
|
||||||
max-width: 60rem;
|
max-width: 60rem;
|
||||||
}
|
}
|
||||||
.img {
|
|
||||||
@apply w-full h-full;
|
|
||||||
object-fit: cover;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,22 +1,38 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { CarouselCommon } from 'src/components/common'
|
import { CarouselCommon, ImgWithLink } from 'src/components/common'
|
||||||
|
import { ImgWithLinkProps } from 'src/components/common/ImgWithLink/ImgWithLink'
|
||||||
import s from './ProductImgs.module.scss'
|
import s from './ProductImgs.module.scss'
|
||||||
|
|
||||||
interface ImgProps {
|
|
||||||
src: string, alt?: string
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
className?: string
|
className?: string
|
||||||
children?: any,
|
children?: any,
|
||||||
// data: ImgProps[]
|
}
|
||||||
|
|
||||||
|
const DATA = [
|
||||||
|
{
|
||||||
|
src: 'https://user-images.githubusercontent.com/76729908/130574371-3b75fa72-9552-4605-aba9-a4b31cd9dce7.png',
|
||||||
|
alt: 'Broccoli',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
src: 'https://user-images.githubusercontent.com/76729908/130574371-3b75fa72-9552-4605-aba9-a4b31cd9dce7.png',
|
||||||
|
alt: 'Broccoli',
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
const option = {
|
||||||
|
slidesPerView: 1,
|
||||||
}
|
}
|
||||||
|
|
||||||
const ProductImgs = ({ }: Props) => {
|
const ProductImgs = ({ }: Props) => {
|
||||||
return (
|
return (
|
||||||
<section className={s.productImgs}>
|
<section className={s.productImgs}>
|
||||||
{/* <CarouselCommon<ImgProps> /> */}
|
<CarouselCommon<ImgWithLinkProps>
|
||||||
<img className={s.img} src="https://user-images.githubusercontent.com/76729908/130574371-3b75fa72-9552-4605-aba9-a4b31cd9dce7.png" alt="" />
|
data={DATA}
|
||||||
|
itemKey="product-detail-img"
|
||||||
|
Component={ImgWithLink}
|
||||||
|
option={option}
|
||||||
|
isDot={true}
|
||||||
|
/>
|
||||||
</section >
|
</section >
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.current {
|
.current {
|
||||||
@apply text-active;
|
@apply text-active font-bold sm-headline;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.description {
|
.description {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user