Skip to content

Commit

Permalink
Feat: Add Mandatory Domain checkbox to QuestDetailsForm and update Cr…
Browse files Browse the repository at this point in the history
…eateQuest and UpdateQuest types
  • Loading branch information
Snehagupta1907 committed Jan 28, 2025
1 parent bebf69b commit 0d363c9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
22 changes: 22 additions & 0 deletions components/admin/formSteps/QuestDetailsForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,28 @@ const QuestDetailsForm: FunctionComponent<QuestDetailsFormProps> = ({
</Typography>
</div>

<div className="flex flex-col gap-1">
<div className="flex items-center gap-2">
<input
type="checkbox"
name="mandatory_domain"
checked={questInput.mandatory_domain === null}
onChange={(e) => {
setQuestInput((prev: any) => ({
...prev,
mandatory_domain: e.target.checked ? null : "none",
}));
}}
id="mandatory-domain-checkbox"
className={styles.customCheckbox}
/>
<label htmlFor="mandatory-domain-checkbox">Mandatory Domain</label>
</div>
<Typography type={TEXT_TYPE.BODY_MICRO} color="textGray">
Check this box if a domain is mandatory for this quest.
</Typography>
</div>

<div className="w-full sm:w-fit">
<Button onClick={onSubmit} disabled={submitButtonDisabled}>
<p>Save Changes</p>
Expand Down
2 changes: 2 additions & 0 deletions types/backTypes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ export type CreateQuest = {
img_card: string;
title_card: string;
issuer: string;
mandatory_domain?: boolean | null;
};

export type UpdateQuest = {
Expand All @@ -314,6 +315,7 @@ export type UpdateQuest = {
href: string;
image: string;
};
mandatory_domain?: boolean | null;
};

export type CreateBoost = {
Expand Down

0 comments on commit 0d363c9

Please sign in to comment.