1+ import Link from 'next/link' ;
12import { BlogCardsColumns } from '@/components/containers/CardColumns/BlogCardsColumns' ;
23import { BlogCard } from '@/components/containers/Card/BlogCard' ;
34import Title from '@/components/snippets/Title' ;
45import RevealContentContainer from '@/components/containers/RevealContentContainer' ;
5- import S from './styles' ;
66import { tagToHeading } from '@/utils/blogCategories' ;
77import Container from '@/components/containers/Container' ;
8+ import styles from './BlogPostsContainer.module.scss' ;
89
910const BlogPostsContainer = ( {
1011 posts,
@@ -24,7 +25,7 @@ const BlogPostsContainer = ({
2425
2526 return (
2627 < RevealContentContainer >
27- < S . BlogContainer >
28+ < section className = { styles . blogContainer } >
2829 { heading ? (
2930 < Container >
3031 < Title title = { heading } />
@@ -34,40 +35,41 @@ const BlogPostsContainer = ({
3435 < Title title = { tagToHeading [ tag ] } />
3536 </ Container >
3637 ) : null }
37- {
38- swipe ? (
39- < >
40- { [ posts . slice ( 0 , 6 ) ] . map ( ( p , index ) => (
41- < BlogCardsColumns key = { index } cards = { p } />
38+ { swipe ? (
39+ < >
40+ { [ posts . slice ( 0 , 6 ) ] . map ( ( p , index ) => (
41+ < BlogCardsColumns key = { index } cards = { p } />
42+ ) ) }
43+ </ >
44+ ) : (
45+ < Container >
46+ < div className = { styles . postContainer } >
47+ { posts ?. map ( ( p , index ) => (
48+ < BlogCard $cardType = 'blog' key = { index } card = { p } />
4249 ) ) }
43- </ >
44- ) : (
45- < Container >
46- < S . PostContainer >
47- { posts ?. map ( ( p , index ) => (
48- < BlogCard $cardType = 'blog' key = { index } card = { p } />
49- ) ) }
50- </ S . PostContainer >
51- </ Container >
52- )
53- }
50+ </ div >
51+ </ Container >
52+ ) }
5453
5554 { viewall && posts . length >= 3 ? (
5655 < Container >
57- < S . ViewAllBottomLink
56+ < Link
5857 href = { tag ? `/blog/category/${ tag } ` : '/blog/category/all' }
58+ className = { styles . viewAllBottomLink }
5959 >
6060 view all
61- </ S . ViewAllBottomLink >
61+ </ Link >
6262 </ Container >
6363 ) : null }
6464
6565 { back ? (
6666 < Container >
67- < S . BackBottomLink href = { `/blog` } > < back</ S . BackBottomLink >
67+ < Link href = { `/blog` } className = { styles . backBottomLink } >
68+ < back
69+ </ Link >
6870 </ Container >
6971 ) : null }
70- </ S . BlogContainer >
72+ </ section >
7173 </ RevealContentContainer >
7274 ) ;
7375} ;
0 commit comments