Skip to content

Commit

Permalink
WIP: Move components to separate fils
Browse files Browse the repository at this point in the history
  • Loading branch information
meissadia committed Oct 24, 2023
1 parent b975085 commit 8aa7e7e
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 32 deletions.
42 changes: 10 additions & 32 deletions src/prototypes/UserProfile/CompleteUserProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,20 @@ import {
Button,
Checkbox,
FooterCfGov,
Heading,
Layout,
Link,
Dropdown as Multiselect,
PageHeader
} from '~/src/index';
import { DSRForm as Form } from './DSRForm';
import { DSRLabeledInput as TextInput } from './DSRLabeledInput';
import { FieldGroup } from './FieldGroup';
import { FormActions } from './FormActions';
import { HelperText } from './HelperText';
import { SBLInstitutionCheckboxLabel as InstitutionLabel } from './SBLInstitutionCheckboxLabel';

const TextIntroduction = ({ heading, lead, body }): JSX.Element => (
<div className='text-introduction'>
<h1>{heading}</h1>
<p className='lead-paragraph'>{lead}</p>
<p>{body}</p>
</div>
);

const Well = ({ children }): JSX.Element => (
<div className='well'>{children}</div>
);

const FormActions = (): JSX.Element => (
<div className='form-actions'>
<Button label='Submit' type='submit' />
<Button label='Clear form' asLink appearance='warning' />
</div>
);

const SectionIntroduction = ({ heading, body }): JSX.Element => (
<>
<Heading type='3'>{heading}</Heading>
<p className='body'>{body}</p>
</>
);

const HelperText = ({ children }) => <p>{children}</p>;

const FieldGroup = ({ children }) => <div className='fieldset'>{children}</div>;
import { SectionIntroduction } from './SectionIntroduction';
import { TextIntroduction } from './TextIntroduction';
import { Well } from './Well';

export const CompleteUserProfile = ({ state, setState, onChange }) => (
<>
Expand Down Expand Up @@ -153,7 +128,10 @@ export const CompleteUserProfile = ({ state, setState, onChange }) => (
</FieldGroup>
</Well>

<FormActions />
<FormActions>
<Button label='Submit' type='submit' />
<Button label='Clear form' asLink appearance='warning' />
</FormActions>
</Form>
</Layout.Main>
</Layout.Wrapper>
Expand Down
3 changes: 3 additions & 0 deletions src/prototypes/UserProfile/FieldGroup.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const FieldGroup = ({ children }) => (
<div className='fieldset'>{children}</div>
);
3 changes: 3 additions & 0 deletions src/prototypes/UserProfile/FormActions.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const FormActions = ({ children }): JSX.Element => (
<div className='form-actions'>{children}</div>
);
1 change: 1 addition & 0 deletions src/prototypes/UserProfile/HelperText.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const HelperText = ({ children }) => <p>{children}</p>;
8 changes: 8 additions & 0 deletions src/prototypes/UserProfile/SectionIntroduction.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { Heading } from '~/src/index';

export const SectionIntroduction = ({ heading, body }): JSX.Element => (
<>
<Heading type='3'>{heading}</Heading>
<p className='body'>{body}</p>
</>
);
7 changes: 7 additions & 0 deletions src/prototypes/UserProfile/TextIntroduction.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export const TextIntroduction = ({ heading, lead, body }): JSX.Element => (
<div className='text-introduction'>
<h1>{heading}</h1>
<p className='lead-paragraph'>{lead}</p>
<p>{body}</p>
</div>
);
3 changes: 3 additions & 0 deletions src/prototypes/UserProfile/Well.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const Well = ({ children }): JSX.Element => (
<div className='well'>{children}</div>
);

0 comments on commit 8aa7e7e

Please sign in to comment.