Skip to content

Commit

Permalink
some additions
Browse files Browse the repository at this point in the history
  • Loading branch information
tdanielles committed Aug 12, 2024
1 parent 48d909d commit 6805753
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 17 deletions.
34 changes: 27 additions & 7 deletions components/questionCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,19 +204,39 @@ const QuestionCard = ({
customValue={question.description || ''}
onChangeCustomValue={e => handleChange(id, 'description', e.target.value)}
/>
<QuestionTitle color={`${COLOR.MIDNIGHT_PURPLE_DEEP}`}>Form Input Field</QuestionTitle>
<QuestionDropdown
onSelect={o => handleChange(id, 'formInput', o)}
defaultValue={question.formInput || ''}
options={formInputOptions}
locked={locked}
/>
<QuestionTitle color={`${COLOR.MIDNIGHT_PURPLE_DEEP}`}>Question Type</QuestionTitle>
<QuestionDropdown
onSelect={o => handleChange(id, 'type', o)}
defaultValue={question.type || ''}
options={Object.values(QUESTION_TYPES)}
/>
{![
QUESTION_TYPES.MAJOR,
QUESTION_TYPES.SCHOOL,
QUESTION_TYPES.COUNTRY,
QUESTION_TYPES.PORTFOLIO,
QUESTION_TYPES.LEGALNAME,
].includes(question.type) && (
<>
<QuestionTitle color={`${COLOR.MIDNIGHT_PURPLE_DEEP}`}>Form Input Field</QuestionTitle>
<QuestionDropdown
onSelect={o => handleChange(id, 'formInput', o)}
defaultValue={question.formInput || ''}
options={formInputOptions}
locked={locked}
/>
</>
)}
</>
)}
{isToggled && question.type === QUESTION_TYPES.LONGANS && (
<>
<QuestionTitle color={`${COLOR.MIDNIGHT_PURPLE_DEEP}`}>Max Words</QuestionTitle>
<TextField
placeholder="Max words"
customValue={question.maxWords || ''}
onChangeCustomValue={e => handleChange(id, 'maxWords', e.target.value)}
/>
</>
)}
{isToggled &&
Expand Down
11 changes: 3 additions & 8 deletions constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,13 +346,14 @@ export const QUESTION_TYPES = Object.freeze({
COUNTRY: 'Country',
MAJOR: 'Major',
UPLOAD: 'File Upload',
PORTFOLIO: 'Portfolio',
LEGALNAME: 'Full Legal Name',
})

export const BASIC_INFO_FORM_INPUT_FIELDS = [
'academicYear',
'ageByHackathon',
'canadianStatus',
'countryOfResidence',
'culturalBackground',
'dietaryRestriction',
'disability',
Expand All @@ -363,21 +364,15 @@ export const BASIC_INFO_FORM_INPUT_FIELDS = [
'haveTransExperience',
'identifyAsUnderrepresented',
'indigenousIdentification',
'legalFirstName',
'legalLastName',
'legalMiddleName',
'major',
'phoneNumber',
'preferredName',
'pronouns',
'race',
'school',
]

export const SKILLS_FORM_INPUT_FIELDS = [
'numHackathonsAttended',
'contributionRole',
'github',
'linkedin',
'longAnswers1',
'longAnswers2',
'longAnswers3',
Expand Down
2 changes: 1 addition & 1 deletion pages/hackerapps/[id]/basicinfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const StyledMetadataP = styled.p`

export default ({ id, hackathons }) => {
const [questions, setQuestions] = useState([
{ title: '', description: '', type: '', options: [''], other: false, required: false, formInput: '' },
{ title: '', description: '', type: '', options: [''], other: false, required: false, formInput: '', maxWords: '' },
])
const [metadata, setMetadata] = useState({})
const { email: user } = useAuth().user
Expand Down
2 changes: 1 addition & 1 deletion pages/hackerapps/[id]/skills.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const StyledMetadataP = styled.p`

export default ({ id, hackathons }) => {
const [questions, setQuestions] = useState([
{ title: '', description: '', type: '', options: [''], other: false, required: false, formInput: '' },
{ title: '', description: '', type: '', options: [''], other: false, required: false, formInput: '', maxWords: '' },
])
const [metadata, setMetadata] = useState({})
const { email: user } = useAuth().user
Expand Down

0 comments on commit 6805753

Please sign in to comment.