mirror of
https://github.com/vercel/commerce.git
synced 2025-07-21 11:51:20 +00:00
🎨 styles: tab common
:%s
This commit is contained in:
parent
dd4fff8478
commit
4f905b1558
@ -1,5 +1,5 @@
|
|||||||
import {
|
import {
|
||||||
CollapseCommon, Layout, RelevantBlogPosts
|
CollapseCommon, EmptyCommon, Layout, RelevantBlogPosts
|
||||||
} from 'src/components/common'
|
} from 'src/components/common'
|
||||||
|
|
||||||
const COLLAPSE_DATA = [
|
const COLLAPSE_DATA = [
|
||||||
@ -39,8 +39,12 @@ const COLLAPSE_DATA = [
|
|||||||
export default function Test() {
|
export default function Test() {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
<EmptyCommon />
|
||||||
<CollapseCommon data={COLLAPSE_DATA} />
|
<CollapseCommon data={COLLAPSE_DATA} />
|
||||||
<RelevantBlogPosts />
|
<RelevantBlogPosts />
|
||||||
|
<EmptyCommon description="" />
|
||||||
|
<EmptyCommon description="No product" />
|
||||||
|
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
15
src/components/common/EmptyCommon/EmptyCommon.module.scss
Normal file
15
src/components/common/EmptyCommon/EmptyCommon.module.scss
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
@import "../../../styles/utilities";
|
||||||
|
|
||||||
|
.empty {
|
||||||
|
padding: 4rem 1.6rem;
|
||||||
|
margin: auto;
|
||||||
|
.imgWrap {
|
||||||
|
min-width: 10rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.description {
|
||||||
|
color: var(--disabled);
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 2.4rem;
|
||||||
|
}
|
||||||
|
}
|
25
src/components/common/EmptyCommon/EmptyCommon.tsx
Normal file
25
src/components/common/EmptyCommon/EmptyCommon.tsx
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
import { StaticImage } from '..';
|
||||||
|
import EmptyImg from './empty.svg';
|
||||||
|
import s from './EmptyCommon.module.scss';
|
||||||
|
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
description?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
const EmptyCommon = ({ description = "No data to display" }: Props) => {
|
||||||
|
return (
|
||||||
|
<div className={s.empty}>
|
||||||
|
<div className="imgWrap">
|
||||||
|
<StaticImage src={EmptyImg} alt="empty" />
|
||||||
|
</div>
|
||||||
|
{
|
||||||
|
description && <div className={s.description}>
|
||||||
|
{description}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default EmptyCommon
|
33
src/components/common/EmptyCommon/empty.svg
Normal file
33
src/components/common/EmptyCommon/empty.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 18 KiB |
@ -0,0 +1,5 @@
|
|||||||
|
.staticImage {
|
||||||
|
img {
|
||||||
|
@apply w-full h-full;
|
||||||
|
}
|
||||||
|
}
|
16
src/components/common/StaticImage/StaticImage.tsx
Normal file
16
src/components/common/StaticImage/StaticImage.tsx
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import s from './ImgWithLink.module.scss'
|
||||||
|
import Image from 'next/image'
|
||||||
|
|
||||||
|
export interface Props {
|
||||||
|
src: StaticImageData,
|
||||||
|
alt?: string,
|
||||||
|
}
|
||||||
|
|
||||||
|
const StaticImage = ({ src, alt }: Props) => {
|
||||||
|
return (
|
||||||
|
<Image src={src} alt={alt} placeholder='blur' className={s.staticImage}/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default StaticImage
|
@ -39,3 +39,5 @@ export { default as ImgWithLink} from './ImgWithLink/ImgWithLink'
|
|||||||
export { default as RecipeDetail} from './RecipeDetail/RecipeDetail'
|
export { default as RecipeDetail} from './RecipeDetail/RecipeDetail'
|
||||||
export { default as DrawerCommon} from './DrawerCommon/DrawerCommon'
|
export { default as DrawerCommon} from './DrawerCommon/DrawerCommon'
|
||||||
export { default as CartDrawer} from './CartDrawer/CartDrawer'
|
export { default as CartDrawer} from './CartDrawer/CartDrawer'
|
||||||
|
export { default as StaticImage} from './StaticImage/StaticImage'
|
||||||
|
export { default as EmptyCommon} from './EmptyCommon/EmptyCommon'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user