File tree Expand file tree Collapse file tree 1 file changed +4
-17
lines changed
src/components/pages/blog/posts/posts-grid Expand file tree Collapse file tree 1 file changed +4
-17
lines changed Original file line number Diff line number Diff line change @@ -5,23 +5,10 @@ import { BlogPost } from '@/types/blog-post';
55import BlogPostCard from '../../blog-post-card' ;
66import { BlogPostTCardThemes } from '../../blog-post-card/blog-post-card' ;
77
8- const getPostSize = ( index : number ) : { size : string ; theme : BlogPostTCardThemes } => {
9- if ( [ 3 , 4 , 15 , 16 ] . indexOf ( index ) > - 1 ) {
10- return {
11- size : 'col-span-6' ,
12- theme : 'large' ,
13- } ;
14- }
15-
16- if ( index <= 3 || ( index >= 9 && index <= 14 ) ) {
17- return {
18- size : 'col-span-4 md:col-span-6' ,
19- theme : 'default' ,
20- } ;
21- }
8+ const getPostSize = ( ) : { size : string ; theme : BlogPostTCardThemes } => {
229 return {
23- size : 'col-span-3 md:col-span-6' ,
24- theme : 'small ' ,
10+ size : 'col-span-4 md:col-span-6' ,
11+ theme : 'default ' ,
2512 } ;
2613} ;
2714
@@ -33,7 +20,7 @@ const PostsGrid = ({ posts }: PostsGridProps) => {
3320 return (
3421 < ul className = "gap-x-grid mt-16 grid grid-cols-12 gap-y-14 lg:mt-12 lg:gap-y-12 md:mt-8 md:gap-y-8 xs:mt-6" >
3522 { posts . map ( ( post , index ) => {
36- const { size, theme } = getPostSize ( index ) ;
23+ const { size, theme } = getPostSize ( ) ;
3724 return (
3825 < li key = { index } className = { clsx ( 'xs:col-span-full' , size ) } >
3926 < BlogPostCard post = { post } theme = { theme } />
You can’t perform that action at this time.
0 commit comments