-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #825 from PedroCo3lho/testnet
feat: Onboarding flow for dashboard
- Loading branch information
Showing
2 changed files
with
49 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import React, { useContext, useEffect, useState } from "react"; | ||
import Typography from "@components/UI/typography/typography"; | ||
import { TEXT_TYPE } from "@constants/typography"; | ||
import QuestStyles from "@styles/Home.module.css"; | ||
import QuestCardCustomised from "./CustomisedQuestCard"; | ||
import { QuestDocument } from "../../types/backTypes"; | ||
import { QuestsContext } from "@context/QuestsProvider"; | ||
|
||
const SuggestedQuests: React.FC = () => { | ||
const { quests: contextQuests } = useContext(QuestsContext); | ||
const [quests, setQuests] = useState<QuestDocument[]>([]); | ||
|
||
useEffect(() => { | ||
const onboardingQuests = contextQuests.filter((quest) => quest.category === "onboarding"); | ||
setQuests(onboardingQuests); | ||
}, [contextQuests]); | ||
|
||
return ( | ||
<div className="text-center"> | ||
<Typography type={TEXT_TYPE.H1} className="title extrabold mb-3.5">New explorer, start your quest!</Typography> | ||
<div className="mb-12">Get started on your Starknet adventure by tackling your first quest and begin collecting rewards!</div> | ||
<div className={QuestStyles.questContainer}> | ||
{quests.map((quest) => ( | ||
<QuestCardCustomised key={quest.id} id={quest.id} /> | ||
))} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default SuggestedQuests; |