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

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

+

{bannerDetails.description}

+
+ +
+
+
+ ) : null; +}; + +export default QuestBanner; diff --git a/components/quests/questDetails.tsx b/components/quests/questDetails.tsx index 4997ffd7..af418c0c 100644 --- a/components/quests/questDetails.tsx +++ b/components/quests/questDetails.tsx @@ -36,6 +36,7 @@ import { } from "@services/apiService"; import Typography from "@components/UI/typography/typography"; import { TEXT_TYPE } from "@constants/typography"; +import QuestBanner from "./questBanner"; type QuestDetailsProps = { quest: QuestDocument; @@ -429,7 +430,7 @@ const QuestDetails: FunctionComponent = ({ /> ); })} - +