diff --git a/components/quests/questBanner.tsx b/components/quests/questBanner.tsx index f9b155e3..b3b1a48c 100644 --- a/components/quests/questBanner.tsx +++ b/components/quests/questBanner.tsx @@ -1,37 +1,34 @@ -import { FunctionComponent, useMemo } from "react"; -import questBanners from "../../public/utils/questbanners.json"; +import { FunctionComponent } from "react"; import styles from "@styles/quests.module.css"; import Button from "@components/UI/button"; +import type { Banner } from "types/backTypes"; type QuestBannerProps = { - questId: string; + banner: Banner; }; -const QuestBanner: FunctionComponent = ({ questId }) => { - const bannerDetails = useMemo(() => { - return questBanners.find((banner) => banner.questId === questId); - }, [questId]); - return bannerDetails ? ( +const QuestBanner: FunctionComponent = ({ banner }) => { + return banner ? (

- {bannerDetails.tag ? ( - {bannerDetails.tag} - + {banner.tag ? ( + {banner.tag} - ) : null} - {bannerDetails.title} + {banner.title}

-

{bannerDetails.description}

+

{banner.description}

diff --git a/components/quests/questDetails.tsx b/components/quests/questDetails.tsx index af418c0c..b7b2d72b 100644 --- a/components/quests/questDetails.tsx +++ b/components/quests/questDetails.tsx @@ -430,7 +430,7 @@ const QuestDetails: FunctionComponent = ({ /> ); })} - + {quest.banner && }