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';
5
5
import BlogPostCard from '../../blog-post-card' ;
6
6
import { BlogPostTCardThemes } from '../../blog-post-card/blog-post-card' ;
7
7
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 } => {
22
9
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 ' ,
25
12
} ;
26
13
} ;
27
14
@@ -33,7 +20,7 @@ const PostsGrid = ({ posts }: PostsGridProps) => {
33
20
return (
34
21
< 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" >
35
22
{ posts . map ( ( post , index ) => {
36
- const { size, theme } = getPostSize ( index ) ;
23
+ const { size, theme } = getPostSize ( ) ;
37
24
return (
38
25
< li key = { index } className = { clsx ( 'xs:col-span-full' , size ) } >
39
26
< BlogPostCard post = { post } theme = { theme } />
You can’t perform that action at this time.
0 commit comments