From eef0dd0fafa5dbbbd29f2162967bc668eebf6074 Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Wed, 20 Dec 2023 17:09:39 +0100
Subject: fix(styles): increase CSS specifity for some selectors

Since `sideEffects` has been added to activate tree shakings, the
styles are imported in the wrong order in production build. There is an
open issue (again) on Next.js repo. I'm not sure it will be fixed soon
so in the meantime I had to increase the specifity of some selectors
to avoid broken styles.
I also fixed two minor layout errors:
* CV page widgets should use headings of level 2
* Homepage should wrap the cards in list items
---
 src/pages/index.tsx | 66 ++++++++++++++++++++++++++++++-----------------------
 1 file changed, 38 insertions(+), 28 deletions(-)

(limited to 'src/pages/index.tsx')

diff --git a/src/pages/index.tsx b/src/pages/index.tsx
index 0e6bb23..7a45477 100644
--- a/src/pages/index.tsx
+++ b/src/pages/index.tsx
@@ -16,6 +16,7 @@ import {
   Time,
   MetaItem,
   Page,
+  GridItem,
 } from '../components';
 import { mdxComponents } from '../components/mdx';
 import HomePageContent, { meta } from '../content/pages/homepage.mdx';
@@ -23,6 +24,7 @@ import {
   convertRecentPostToRecentArticle,
   fetchRecentPosts,
 } from '../services/graphql';
+import styles from '../styles/pages/home.module.scss';
 import type { NextPageWithLayout, RecentArticle } from '../types';
 import { CONFIG } from '../utils/config';
 import { ROUTES } from '../utils/constants';
@@ -82,34 +84,42 @@ const RecentPosts: FC<RecentPostsProps> = ({ posts }): JSX.Element => {
         );
 
         return (
-          <Card
-            aria-label={cardLabel}
-            cover={
-              post.cover ? (
-                <CardCover aria-label={coverLabel} hasBorders>
-                  <NextImage {...post.cover} />
-                </CardCover>
-              ) : undefined
-            }
-            key={post.id}
-            meta={
-              <CardMeta isCentered>
-                <MetaItem
-                  hasBorderedValues
-                  isCentered
-                  label={publicationDate}
-                  value={<Time date={post.publicationDate} />}
-                />
-              </CardMeta>
-            }
-            isCentered
-            linkTo={postUrl}
-          >
-            <CardHeader>
-              <CardTitle level={3}>{post.title}</CardTitle>
-            </CardHeader>
-            <CardFooter />
-          </Card>
+          <GridItem key={post.id}>
+            <Card
+              aria-label={cardLabel}
+              className={styles.card}
+              cover={
+                post.cover ? (
+                  <CardCover aria-label={coverLabel} hasBorders>
+                    <NextImage
+                      {...post.cover}
+                      // eslint-disable-next-line react/jsx-no-literals
+                      alt=""
+                      // eslint-disable-next-line react/jsx-no-literals
+                      title=""
+                    />
+                  </CardCover>
+                ) : undefined
+              }
+              meta={
+                <CardMeta isCentered>
+                  <MetaItem
+                    hasBorderedValues
+                    isCentered
+                    label={publicationDate}
+                    value={<Time date={post.publicationDate} />}
+                  />
+                </CardMeta>
+              }
+              isCentered
+              linkTo={postUrl}
+            >
+              <CardHeader>
+                <CardTitle level={3}>{post.title}</CardTitle>
+              </CardHeader>
+              <CardFooter />
+            </Card>
+          </GridItem>
         );
       })}
     </Grid>
-- 
cgit v1.2.3

