-
Notifications
You must be signed in to change notification settings - Fork 0
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 #33 from Quest-Protocol/create_quest
Quest Steps
- Loading branch information
Showing
13 changed files
with
720 additions
and
401 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
30 changes: 30 additions & 0 deletions
30
questverse-widgets/apps/QuestVerse/widget/components/createQuestSteps/stepFive.jsx
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,30 @@ | ||
// State.init({ | ||
// isChecked: false, | ||
// isSubmitEnabled: false, | ||
// }); | ||
|
||
// const handleCheckboxChange = (event) => { | ||
// console.log(event.target.checked); | ||
// State.update({ | ||
// isChecked: event.target.checked, | ||
// isSubmitEnabled: true, | ||
// }); | ||
// }; | ||
|
||
// const handleSubmit = () => { | ||
// if (state.isChecked) { | ||
// console.log("Form submitted!"); | ||
// } else { | ||
// console.log("Checkbox must be checked to submit."); | ||
// } | ||
// }; | ||
|
||
const FORM_DATA = props.data; | ||
console.log(FORM_DATA) | ||
return ( | ||
<div className="stepFive"> | ||
<h2>Review</h2> | ||
<small>Please review following Information</small> | ||
|
||
</div> | ||
); |
56 changes: 56 additions & 0 deletions
56
questverse-widgets/apps/QuestVerse/widget/components/createQuestSteps/stepFour.jsx
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,56 @@ | ||
function formatDate(date) { | ||
const year = date.getFullYear(); | ||
const month = (date.getMonth() + 1).toString().padStart(2, "0"); | ||
const day = date.getDate().toString().padStart(2, "0"); | ||
return [year, month, day].join("-"); | ||
} | ||
|
||
const TODAY = formatDate(new Date()); | ||
const DAY_IN_SECONDS = 24 * 60 * 60 * 1000; | ||
const ONE_WEEK = DAY_IN_SECONDS * 7; | ||
|
||
const setStartDate = (e) => { | ||
State.update({ | ||
date_start: e.target.value, | ||
}); | ||
}; | ||
|
||
const setEndDate = (e) => { | ||
State.update({ | ||
date_end: e.target.value, | ||
}); | ||
}; | ||
|
||
State.init({ | ||
date_start: formatDate(new Date(Date.now() + DAY_IN_SECONDS)), | ||
date_end: formatDate(new Date(Date.now() + ONE_WEEK)), | ||
}); | ||
|
||
return ( | ||
<div className="stepFour"> | ||
<div> | ||
<h2>Quest Duration</h2> | ||
<small>Please choose your quest start and end date.</small> | ||
|
||
<input | ||
aria-label="Quest Start Date" | ||
type="date" | ||
value={state.date_start} | ||
onChange={(e) => { | ||
setStartDate(e); | ||
}} | ||
min={TODAY} | ||
/> | ||
|
||
<input | ||
aria-label="Quest End Date" | ||
type="date" | ||
value={state.date_end} | ||
onChange={(e) => { | ||
setEndDate(e); | ||
}} | ||
min={TODAY} | ||
/> | ||
</div> | ||
</div> | ||
); |
Oops, something went wrong.