mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 04:14:18 +00:00
styles: BlogsList change flex -> grid
This commit is contained in:
parent
24a706e972
commit
a58d30d528
@ -1,6 +1,7 @@
|
|||||||
|
import { Layout } from 'src/components/common';
|
||||||
import { BlogsList, FeaturedCardBlog, BlogHeading, BlogBreadCrumb } from 'src/components/modules/blogs';
|
import { BlogsList, FeaturedCardBlog, BlogHeading, BlogBreadCrumb } from 'src/components/modules/blogs';
|
||||||
|
|
||||||
const BlogsPage = () => {
|
export default function BlogsPage() {
|
||||||
return(
|
return(
|
||||||
<>
|
<>
|
||||||
<BlogBreadCrumb />
|
<BlogBreadCrumb />
|
||||||
@ -10,4 +11,4 @@ const BlogsPage = () => {
|
|||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
export default BlogsPage
|
BlogsPage.Layout = Layout
|
@ -3,7 +3,6 @@
|
|||||||
.cardBlogWarpper {
|
.cardBlogWarpper {
|
||||||
@apply inline-flex flex-col justify-start;
|
@apply inline-flex flex-col justify-start;
|
||||||
max-width: 39.2rem;
|
max-width: 39.2rem;
|
||||||
min-height: 34.4rem;
|
|
||||||
.image {
|
.image {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-height: 22rem;
|
max-height: 22rem;
|
||||||
|
@ -4,14 +4,14 @@
|
|||||||
@apply flex flex-col spacing-horizontal items-center;
|
@apply flex flex-col spacing-horizontal items-center;
|
||||||
padding-bottom: 16.8rem;
|
padding-bottom: 16.8rem;
|
||||||
.list {
|
.list {
|
||||||
@apply flex flex-wrap justify-between;
|
@apply grid grid-cols-3;
|
||||||
max-width: 121.6rem;
|
max-width: 121.6rem;
|
||||||
}
|
}
|
||||||
.card {
|
.card {
|
||||||
padding-bottom: 4rem;
|
@apply pr-8 pb-16;
|
||||||
}
|
}
|
||||||
.pagination {
|
.pagination {
|
||||||
padding-top: 0.8rem;
|
|
||||||
@apply flex justify-center items-center ;
|
@apply flex justify-center items-center ;
|
||||||
|
padding-top: 0.8rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,7 +1,6 @@
|
|||||||
import React, { useState } from 'react'
|
import React, { useState } from 'react'
|
||||||
import CardBlog, { BlogCardProps } from 'src/components/common/CardBlog/CardBlog'
|
import CardBlog, { BlogCardProps } from 'src/components/common/CardBlog/CardBlog'
|
||||||
import PaginationCommon from 'src/components/common/PaginationCommon/PaginationCommon'
|
import PaginationCommon from 'src/components/common/PaginationCommon/PaginationCommon'
|
||||||
import { ROUTE } from 'src/utils/constanst.utils'
|
|
||||||
import s from "./BlogsList.module.scss"
|
import s from "./BlogsList.module.scss"
|
||||||
import image15 from '../../../../../public/assets/images/image15.png'
|
import image15 from '../../../../../public/assets/images/image15.png'
|
||||||
import image16 from '../../../../../public/assets/images/image16.png'
|
import image16 from '../../../../../public/assets/images/image16.png'
|
||||||
@ -19,114 +18,115 @@ const BLOGSLIST_DATA = [
|
|||||||
imageSrc: image15.src,
|
imageSrc: image15.src,
|
||||||
title: "1",
|
title: "1",
|
||||||
description: "The DEBM diet stands for "+"Delicious Happy Fun Diet"+". This diet was popularized by Robert...",
|
description: "The DEBM diet stands for "+"Delicious Happy Fun Diet"+". This diet was popularized by Robert...",
|
||||||
link: `${ROUTE.BLOG_DETAIL}`,
|
slug: "happy-diet"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
imageSrc: image16.src,
|
imageSrc: image16.src,
|
||||||
title: "2",
|
title: "2",
|
||||||
description: "Aloe vera or aloe vera is a green plant, has thorns on the side of the skin with yellowish patches and...",
|
description: "Aloe vera or aloe vera is a green plant, has thorns on the side of the skin with yellowish patches and...",
|
||||||
link: `${ROUTE.BLOG_DETAIL}`,
|
slug: "happy-diet"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
imageSrc: image17.src,
|
imageSrc: image17.src,
|
||||||
title: "3",
|
title: "3",
|
||||||
description: "Dragon fruit is a type of fruit that is a favorite for many people because of its delicious and fresh...",
|
description: "Dragon fruit is a type of fruit that is a favorite for many people because of its delicious and fresh...",
|
||||||
link: `${ROUTE.BLOG_DETAIL}`,
|
slug: "happy-diet"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
imageSrc: image21.src,
|
imageSrc: image21.src,
|
||||||
title: "4",
|
title: "4",
|
||||||
description: "The DEBM diet stands for "+"Delicious Happy Fun Diet"+". This diet was popularized by Robert...",
|
description: "The DEBM diet stands for "+"Delicious Happy Fun Diet"+". This diet was popularized by Robert...",
|
||||||
link: `${ROUTE.BLOG_DETAIL}`,
|
slug: "happy-diet"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
imageSrc: image22.src,
|
imageSrc: image22.src,
|
||||||
title: "5",
|
title: "5",
|
||||||
description: "Aloe vera or aloe vera is a green plant, has thorns on the side of the skin with yellowish patches and...",
|
description: "Aloe vera or aloe vera is a green plant, has thorns on the side of the skin with yellowish patches and...",
|
||||||
link: `${ROUTE.BLOG_DETAIL}`,
|
slug: "happy-diet"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
imageSrc: image23.src,
|
imageSrc: image23.src,
|
||||||
title: "6",
|
title: "6",
|
||||||
description: "Dragon fruit is a type of fruit that is a favorite for many people because of its delicious and fresh...",
|
description: "Dragon fruit is a type of fruit that is a favorite for many people because of its delicious and fresh...",
|
||||||
link: `${ROUTE.BLOG_DETAIL}`,
|
slug: "happy-diet"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
imageSrc: image15.src,
|
imageSrc: image15.src,
|
||||||
title: "7",
|
title: "7",
|
||||||
description: "The DEBM diet stands for "+"Delicious Happy Fun Diet"+". This diet was popularized by Robert...",
|
description: "The DEBM diet stands for "+"Delicious Happy Fun Diet"+". This diet was popularized by Robert...",
|
||||||
link: `${ROUTE.BLOG_DETAIL}`,
|
slug: "happy-diet"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
imageSrc: image16.src,
|
imageSrc: image16.src,
|
||||||
title: "8",
|
title: "8",
|
||||||
description: "Aloe vera or aloe vera is a green plant, has thorns on the side of the skin with yellowish patches and...",
|
description: "Aloe vera or aloe vera is a green plant, has thorns on the side of the skin with yellowish patches and...",
|
||||||
link: `${ROUTE.BLOG_DETAIL}`,
|
slug: "happy-diet"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
imageSrc: image17.src,
|
imageSrc: image17.src,
|
||||||
title: "9",
|
title: "9",
|
||||||
description: "Dragon fruit is a type of fruit that is a favorite for many people because of its delicious and fresh...",
|
description: "Dragon fruit is a type of fruit that is a favorite for many people because of its delicious and fresh...",
|
||||||
link: `${ROUTE.BLOG_DETAIL}`,
|
slug: "happy-diet"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
imageSrc: image23.src,
|
imageSrc: image23.src,
|
||||||
title: "10",
|
title: "10",
|
||||||
description: "Dragon fruit is a type of fruit that is a favorite for many people because of its delicious and fresh...",
|
description: "Dragon fruit is a type of fruit that is a favorite for many people because of its delicious and fresh...",
|
||||||
link: `${ROUTE.BLOG_DETAIL}`,
|
slug: "happy-diet"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
imageSrc: image21.src,
|
imageSrc: image21.src,
|
||||||
title: "11",
|
title: "11",
|
||||||
description: "The DEBM diet stands for "+"Delicious Happy Fun Diet"+". This diet was popularized by Robert...",
|
description: "The DEBM diet stands for "+"Delicious Happy Fun Diet"+". This diet was popularized by Robert...",
|
||||||
link: `${ROUTE.BLOG_DETAIL}`,
|
slug: "happy-diet"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
imageSrc: image22.src,
|
imageSrc: image22.src,
|
||||||
title: "12",
|
title: "12",
|
||||||
description: "Aloe vera or aloe vera is a green plant, has thorns on the side of the skin with yellowish patches and...",
|
description: "Aloe vera or aloe vera is a green plant, has thorns on the side of the skin with yellowish patches and...",
|
||||||
link: `${ROUTE.BLOG_DETAIL}`,
|
slug: "happy-diet"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
imageSrc: image15.src,
|
imageSrc: image15.src,
|
||||||
title: "13",
|
title: "13",
|
||||||
description: "The DEBM diet stands for "+"Delicious Happy Fun Diet"+". This diet was popularized by Robert...",
|
description: "The DEBM diet stands for "+"Delicious Happy Fun Diet"+". This diet was popularized by Robert...",
|
||||||
link: `${ROUTE.BLOG_DETAIL}`,
|
slug: "happy-diet"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
imageSrc: image16.src,
|
imageSrc: image16.src,
|
||||||
title: "14",
|
title: "14",
|
||||||
description: "Aloe vera or aloe vera is a green plant, has thorns on the side of the skin with yellowish patches and...",
|
description: "Aloe vera or aloe vera is a green plant, has thorns on the side of the skin with yellowish patches and...",
|
||||||
link: `${ROUTE.BLOG_DETAIL}`,
|
slug: "happy-diet"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
imageSrc: image17.src,
|
imageSrc: image17.src,
|
||||||
title: "15",
|
title: "15",
|
||||||
description: "Dragon fruit is a type of fruit that is a favorite for many people because of its delicious and fresh...",
|
description: "Dragon fruit is a type of fruit that is a favorite for many people because of its delicious and fresh...",
|
||||||
link: `${ROUTE.BLOG_DETAIL}`,
|
slug: "happy-diet"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
imageSrc: image21.src,
|
imageSrc: image21.src,
|
||||||
title: "16",
|
title: "16",
|
||||||
description: "The DEBM diet stands for "+"Delicious Happy Fun Diet"+". This diet was popularized by Robert...",
|
description: "The DEBM diet stands for "+"Delicious Happy Fun Diet"+". This diet was popularized by Robert...",
|
||||||
link: `${ROUTE.BLOG_DETAIL}`,
|
slug: "happy-diet"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
imageSrc: image23.src,
|
imageSrc: image23.src,
|
||||||
title: "17",
|
title: "17",
|
||||||
description: "Dragon fruit is a type of fruit that is a favorite for many people because of its delicious and fresh...",
|
description: "Dragon fruit is a type of fruit that is a favorite for many people because of its delicious and fresh...",
|
||||||
link: `${ROUTE.BLOG_DETAIL}`,
|
slug: "happy-diet"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
imageSrc: image22.src,
|
imageSrc: image22.src,
|
||||||
title: "18",
|
title: "18",
|
||||||
description: "Aloe vera or aloe vera is a green plant, has thorns on the side of the skin with yellowish patches and...",
|
description: "Aloe vera or aloe vera is a green plant, has thorns on the side of the skin with yellowish patches and...",
|
||||||
link: `${ROUTE.BLOG_DETAIL}`,
|
slug: "happy-diet"
|
||||||
},
|
},
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
const BlogsList = ({ data = BLOGSLIST_DATA }:BlogsListProps) => {
|
const BlogsList = ({ data = BLOGSLIST_DATA }:BlogsListProps) => {
|
||||||
|
const defaultBlogPageSize: number = 6;
|
||||||
const [currentPage, setCurrentPage] = useState(0)
|
const [currentPage, setCurrentPage] = useState(0)
|
||||||
const onPageChange = (page:number) => {
|
const onPageChange = (page:number) => {
|
||||||
setCurrentPage(page)
|
setCurrentPage(page)
|
||||||
@ -136,7 +136,7 @@ const BlogsList = ({ data = BLOGSLIST_DATA }:BlogsListProps) => {
|
|||||||
<div className={s.wrapper}>
|
<div className={s.wrapper}>
|
||||||
<div className={s.list}>
|
<div className={s.list}>
|
||||||
{
|
{
|
||||||
data.slice(currentPage*6,(currentPage+1)*6).map((product,index)=>{
|
data.slice(currentPage*defaultBlogPageSize,(currentPage+1)*defaultBlogPageSize).map((product,index)=>{
|
||||||
return(
|
return(
|
||||||
<div className={s.card}>
|
<div className={s.card}>
|
||||||
<CardBlog {...product} key={index}/>
|
<CardBlog {...product} key={index}/>
|
||||||
@ -146,7 +146,7 @@ const BlogsList = ({ data = BLOGSLIST_DATA }:BlogsListProps) => {
|
|||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
<div className={s.pagination}>
|
<div className={s.pagination}>
|
||||||
<PaginationCommon total={data.length} pageSize={6} onChange={onPageChange}/>
|
<PaginationCommon total={data.length} pageSize={defaultBlogPageSize} onChange={onPageChange}/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user