Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Last-minute demo tweaks #58

Merged
merged 4 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/design/sass/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ iframe:focus {
}

.usa-button {
background: #e7e3fa;
background: none;
margin: 0;
padding: 2px;
}
Expand Down
64 changes: 33 additions & 31 deletions packages/design/src/Form/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,12 @@ export default function Form({
context,
session,
onSubmit,
isPreview, // ideally this should be removed. just here now for the FFP demo
}: {
context: FormUIContext;
session: FormSession;
onSubmit?: (data: Record<string, string>) => void;
isPreview?: boolean;
}) {
const initialPrompt = createPrompt(context.config, session, {
validate: false,
Expand All @@ -93,46 +95,46 @@ export default function Form({
<FormProvider {...formMethods}>
<div className="preview">
<div className="grid-row">
<nav className="sideNav tablet:grid-col-3 margin-bottom-4 tablet:margin-bottom-0">
<ul className="usa-sidenav">
<li className="usa-sidenav__item">
<a href="">County</a>
</li>
<li className="usa-sidenav__item">
<a className="usa-current" href="">
Current name
</a>
</li>
<ul className="usa-sidenav__sublist">
{!isPreview && (
<nav className="sideNav tablet:grid-col-3 margin-bottom-4 tablet:margin-bottom-0">
<ul className="usa-sidenav">
<li className="usa-sidenav__item">
<a className="usa-current" href="">
First name
County
</a>
</li>
<li className="usa-sidenav__item">
<a href="">Middle name</a>
<a href="">Current name</a>
</li>
<ul className="usa-sidenav__sublist">
<li className="usa-sidenav__item">
<a href="">First name</a>
</li>
<li className="usa-sidenav__item">
<a href="">Middle name</a>
</li>
<li className="usa-sidenav__item">
<a href="">Last name</a>
</li>
</ul>
<li className="usa-sidenav__item">
<a href="">Last name</a>
<a href="">Declarations</a>
</li>
<li className="usa-sidenav__item">
<a href="">Address</a>
</li>
<li className="usa-sidenav__item">
<a href="">Telephone</a>
</li>
<li className="usa-sidenav__item">
<a href="">Date of Birth</a>
</li>
<li className="usa-sidenav__item">
<a href="">Name at Birth</a>
</li>
</ul>
<li className="usa-sidenav__item">
<a href="">Declarations</a>
</li>
<li className="usa-sidenav__item">
<a href="">Address</a>
</li>
<li className="usa-sidenav__item">
<a href="">Telephone</a>
</li>
<li className="usa-sidenav__item">
<a href="">Date of Birth</a>
</li>
<li className="usa-sidenav__item">
<a href="">Name at Birth</a>
</li>
</ul>
</nav>
</nav>
)}
<div className="grid-col-9 usa-prose">
<form
className="previewForm usa-form usa-form--large margin-bottom-3"
Expand Down
8 changes: 7 additions & 1 deletion packages/design/src/FormManager/FormEdit/Preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ export const PreviewForm = ({ uiContext, form }: PreviewFormProps) => {
uswdsRoot: uiContext.uswdsRoot,
};
const disposable = createFormSession(form); // nullSession instead?
return <Form context={previewUiContext} session={disposable}></Form>;
return (
<Form
isPreview={true}
context={previewUiContext}
session={disposable}
></Form>
);
};

const createPreviewComponents = (
Expand Down
2 changes: 1 addition & 1 deletion packages/design/src/config/view/Fieldset/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const FormSummary: FormElementComponent<Pattern<FieldsetPattern>> = ({
children,
}) => {
return (
<fieldset className="usa-fieldset">
<fieldset className="usa-fieldset margin-top-4">
<legend className="usa-legend">{pattern.legend}</legend>
{children}
</fieldset>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ const SubmissionConfirmation: FormElementComponent<
<h2>Next steps:</h2>
<div className="margin-bottom-4">
<ul className="usa-list">
<li>Review your document package for accuracy</li>
<li>Print your document package </li>
<li>Print your document package</li>
<li>Review your documents for accuracy</li>
<li>Follow the instructions on the first page of your package</li>
</ul>
</div>
Expand Down
Loading