From 4f289e505114eb5ee5052fd0d31741f1d8ba4484 Mon Sep 17 00:00:00 2001 From: Xevion Date: Sat, 24 Dec 2022 12:21:20 -0600 Subject: [PATCH] Refactor into ItemCard component for upcoming mobile-focus click --- src/components/ItemCard.tsx | 31 +++++++++++++++++++++++++++++++ src/pages/index.tsx | 21 ++------------------- 2 files changed, 33 insertions(+), 19 deletions(-) create mode 100644 src/components/ItemCard.tsx diff --git a/src/components/ItemCard.tsx b/src/components/ItemCard.tsx new file mode 100644 index 0000000..51518fc --- /dev/null +++ b/src/components/ItemCard.tsx @@ -0,0 +1,31 @@ +import Image from "next/image"; +import {ArrowLongRightIcon} from "@heroicons/react/24/outline"; +import React from "react"; + +type ItemCardProps = { + banner: string; + title: React.ReactNode; + description: React.ReactNode; +} + +const ItemCard = ({banner, title, description}: ItemCardProps) => { + return
+ {`Banner +
+
+
{title}
+
{description}
+
+
+
+ +
+
+
+} + +export default ItemCard; \ No newline at end of file diff --git a/src/pages/index.tsx b/src/pages/index.tsx index b34b404..f7d9e65 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -1,8 +1,7 @@ import {type NextPage} from "next"; import Head from "next/head"; -import Image from "next/image"; -import {ArrowLongRightIcon} from "@heroicons/react/24/outline"; import React from "react"; +import ItemCard from "../components/ItemCard"; interface Project { title: string; @@ -42,23 +41,7 @@ const Home: NextPage = () => {
{ projects.map((project, index) => -
- {`Banner -
-
-
{project.title}
-
{project.description}
-
-
-
- -
-
-
+ ) }