[resumes][refactor] Refactor comments form

pull/306/head
Terence Ho 3 years ago committed by Wu Peirong
parent 40a2f61ddb
commit 42825e7eb9

@ -57,18 +57,45 @@ export default function CommentsForm({
onSubmit={onFormSubmit}> onSubmit={onFormSubmit}>
{/* TODO: Convert TextInput to TextArea */} {/* TODO: Convert TextInput to TextArea */}
<div className="mt-4 space-y-4"> <div className="mt-4 space-y-4">
{COMMENTS_SECTIONS.map(({ label, value, placeholder }) => { <TextInput
return ( id="general"
<TextInput label="General"
key={value} name="general"
id={value} placeholder="General comments about the resume"
label={label} type="text"
name={value} />
placeholder={placeholder}
type="text" <TextInput
/> id="education"
); label="Education"
})} name="education"
placeholder="Comments about the Education section"
type="text"
/>
<TextInput
id="experience"
label="Experience"
name="experience"
placeholder="Comments about the Experience section"
type="text"
/>
<TextInput
id="projects"
label="Projects"
name="projects"
placeholder="Comments about the Projects section"
type="text"
/>
<TextInput
id="skills"
label="Skills"
name="skills"
placeholder="Comments about the Skills section"
type="text"
/>
</div> </div>
<div className="flex justify-end space-x-2 pt-4"> <div className="flex justify-end space-x-2 pt-4">

@ -2,27 +2,22 @@
export const COMMENTS_SECTIONS = [ export const COMMENTS_SECTIONS = [
{ {
label: 'General', label: 'General',
placeholder: 'General comments about the resume',
value: 'general', value: 'general',
}, },
{ {
label: 'Education', label: 'Education',
placeholder: 'Comments about the Education section',
value: 'education', value: 'education',
}, },
{ {
label: 'Experience', label: 'Experience',
placeholder: 'Comments about the Experience section',
value: 'experience', value: 'experience',
}, },
{ {
label: 'Projects', label: 'Projects',
placeholder: 'Comments about the Projects section',
value: 'projects', value: 'projects',
}, },
{ {
label: 'Skills', label: 'Skills',
placeholder: 'Comments about the Skills section',
value: 'skills', value: 'skills',
}, },
]; ];

Loading…
Cancel
Save