Skip to content

Commit

Permalink
make Intake and Interest Form Link components more composable by add …
Browse files Browse the repository at this point in the history
…a FormLinkButton sub-component
  • Loading branch information
avrohomgottlieb committed Oct 11, 2024
1 parent d5fa500 commit 084286c
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions client/src/pages/contribute.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,13 @@ const TableRow = styled(GrommetTableRow)`
box-shadow: none !important;
`

const IntakeFormLink = () => (
const FormLinkButton = ({ ...props }) => (
<Button
href={config.links.contribute_hsform}
label="Complete the Intake Form"
margin={{ top: 'small', bottom: 'medium' }}
target="_blank"
primary
/>
)

const InterestFormLink = () => (
<Button
href={config.links.contribute_interest_hsform}
label="Complete the Interest Form"
margin={{ top: 'small', bottom: 'medium' }}
target="_blank"
primary
// eslint-disable-next-line react/jsx-props-no-spreading
{...props}
/>
)

Expand Down Expand Up @@ -102,10 +92,18 @@ export const Contribute = () => {
}
},
IntakeFormLink: {
component: IntakeFormLink
component: FormLinkButton,
props: {
href: config.links.contribute_hsform,
label: 'Complete the Intake Form'
}
},
InterestFormLink: {
component: InterestFormLink
component: FormLinkButton,
props: {
href: config.links.contribute_interest_hsform,
label: 'Complete the Interest Form'
}
},
a: {
component: Link
Expand Down

0 comments on commit 084286c

Please sign in to comment.