From 4adafd2db94aa005e2b0953aa2b0ead0ef5bc569 Mon Sep 17 00:00:00 2001 From: ljc1991 Date: Mon, 30 Oct 2023 13:10:29 +0800 Subject: [PATCH] refactor: add projectCard component --- homepage/src/components/cards/card.jsx | 45 ++----------------- homepage/src/components/cards/projectCard.jsx | 40 +++++++++++++++++ 2 files changed, 44 insertions(+), 41 deletions(-) create mode 100644 homepage/src/components/cards/projectCard.jsx diff --git a/homepage/src/components/cards/card.jsx b/homepage/src/components/cards/card.jsx index c2bb781d..60c89ea0 100644 --- a/homepage/src/components/cards/card.jsx +++ b/homepage/src/components/cards/card.jsx @@ -1,48 +1,11 @@ -import Image from 'next/image'; import DefaultCard from './defaultCard'; -import { ParseMarkdownAndHtml } from '../parseMarkdownAndHtml'; +import ProjectCard from './projectCard'; const Card = ({ card }) => { - if (card.data.type !== 'project') { - return ; - } else { - return ( -
-
-

{card.data.title}

-
-
- {card.data.avatarList.map((avatar) => ( -
-
-   -
-
- ))} -
- {card.data.description} - - {card.content} - -
-
-
- ); + if (card.data.type === 'project') { + return ; } + return ; }; export default Card; diff --git a/homepage/src/components/cards/projectCard.jsx b/homepage/src/components/cards/projectCard.jsx new file mode 100644 index 00000000..04a0b800 --- /dev/null +++ b/homepage/src/components/cards/projectCard.jsx @@ -0,0 +1,40 @@ +import { ParseMarkdownAndHtml } from '../parseMarkdownAndHtml'; + +const ProjectCard = ({ card }) => ( +
+
+

{card.data.title}

+
+
+ {card.data.avatarList.map((avatar) => ( +
+
+   +
+
+ ))} +
+ {card.data.description} + + {card.content} + +
+
+
+); + +export default ProjectCard;