diff --git a/components/quests/featuredQuest.tsx b/components/quests/featuredQuest.tsx index 005a75d7..e8695ebd 100644 --- a/components/quests/featuredQuest.tsx +++ b/components/quests/featuredQuest.tsx @@ -12,7 +12,7 @@ type FeaturedQuestProps = { issuer?: Issuer; reward?: string; desc?: string; - expiry: number; + expiry: string | null | undefined; }; const FeaturedQuest: FunctionComponent = ({ @@ -41,7 +41,7 @@ const FeaturedQuest: FunctionComponent = ({ - + {expiry ? : null} ) : !onClick && !isSmallScreen ? ( diff --git a/pages/index.tsx b/pages/index.tsx index fc227196..6266d669 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -47,7 +47,7 @@ const Quests: NextPage = () => { }} reward={featuredQuest?.rewards_title} desc={featuredQuest?.desc} - expiry={Number(featuredQuest?.expiry.$date.$numberLong)} + expiry={featuredQuest?.expiry_timestamp} />

Accomplish your Starknet Quests

diff --git a/pages/quest/[questPage].tsx b/pages/quest/[questPage].tsx index e9080fb4..c45b6d85 100644 --- a/pages/quest/[questPage].tsx +++ b/pages/quest/[questPage].tsx @@ -64,7 +64,7 @@ const QuestPage: NextPage = () => { title_card: "", hidden: false, disabled: false, - expiry: { $date: { $numberLong: "0" } }, + expiry_timestamp: "loading", }); const [tasks, setTasks] = useState([]); const [rewardsEnabled, setRewardsEnabled] = useState(false); @@ -314,8 +314,8 @@ const QuestPage: NextPage = () => {

{quest.desc}

)}
- {quest?.expiry ? ( - + {quest?.expiry_timestamp && quest?.expiry_timestamp !== "loading" ? ( + ) : null}
{tasks.length === 0 || quest.rewards_title === "loading" ? ( diff --git a/types/backTypes.d.ts b/types/backTypes.d.ts index 33a122f3..f1856cf6 100644 --- a/types/backTypes.d.ts +++ b/types/backTypes.d.ts @@ -15,13 +15,7 @@ type QuestDocument = { title_card: string; hidden: boolean; disabled: boolean; - expiry: ExpiryObject; -}; - -type ExpiryObject = { - $date: { - $numberLong: string; - }; + expiry_timestamp: string | null; }; type NFTItem = {