Skip to content

Commit

Permalink
prevent customising heading if section is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
ducaale committed Jan 1, 2024
1 parent 304def0 commit a9d6e95
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 25 deletions.
12 changes: 7 additions & 5 deletions src/components/generator/form/sections/AwardsSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ export function AwardSection() {

return (
<FormSection title="Honors & Awards">
<LabeledInput
name="headings.awards"
label="Section Heading"
placeholder="Awards"
/>
{fields.length > 0 && (
<LabeledInput
name="headings.awards"
label="Section Heading"
placeholder="Awards"
/>
)}
{fields.map((field, index) => (
<Fragment key={field.id}>
<Divider />
Expand Down
12 changes: 7 additions & 5 deletions src/components/generator/form/sections/EducationSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ export function EducationSection() {

return (
<FormSection title="Your Educational Background">
<LabeledInput
name="headings.education"
label="Section Heading"
placeholder="Education"
/>
{fields.length > 0 && (
<LabeledInput
name="headings.education"
label="Section Heading"
placeholder="Education"
/>
)}
{fields.map((field, index) => (
<Fragment key={field.id}>
<Divider />
Expand Down
12 changes: 7 additions & 5 deletions src/components/generator/form/sections/SkillsSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ export function SkillsSection() {

return (
<FormSection title="Your Skills">
<LabeledInput
name="headings.skills"
label="Section Heading"
placeholder="Skills"
/>
{fields.length > 0 && (
<LabeledInput
name="headings.skills"
label="Section Heading"
placeholder="Skills"
/>
)}
{fields.map((field, index) => (
<Fragment key={field.id}>
<Divider />
Expand Down
12 changes: 7 additions & 5 deletions src/components/generator/form/sections/WorkSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ export function WorkSection() {

return (
<FormSection title="Your Work Experience">
<LabeledInput
name="headings.work"
label="Section Heading"
placeholder="Work"
/>
{fields.length > 0 && (
<LabeledInput
name="headings.work"
label="Section Heading"
placeholder="Work"
/>
)}
{fields.map((field, index) => (
<Fragment key={field.id}>
<Divider />
Expand Down
12 changes: 7 additions & 5 deletions src/components/generator/form/sections/projectsSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ export function ProjectsSection() {

return (
<FormSection title="Your Projects">
<LabeledInput
name="headings.projects"
label="Section Heading"
placeholder="Projects"
/>
{fields.length > 0 && (
<LabeledInput
name="headings.projects"
label="Section Heading"
placeholder="Projects"
/>
)}
{fields.map((field, index) => (
<Fragment key={field.id}>
<Divider />
Expand Down

0 comments on commit a9d6e95

Please sign in to comment.