diff --git a/modules-js/react-fleet/.storybook/preview-head.html b/modules-js/react-fleet/.storybook/preview-head.html index 650950bbe..eb9fd5339 100644 --- a/modules-js/react-fleet/.storybook/preview-head.html +++ b/modules-js/react-fleet/.storybook/preview-head.html @@ -1,6 +1,7 @@ - + + + + - + - \ No newline at end of file + \ No newline at end of file diff --git a/modules-js/storybook-common/src/wrappers.tsx b/modules-js/storybook-common/src/wrappers.tsx index b89881759..725f42a49 100644 --- a/modules-js/storybook-common/src/wrappers.tsx +++ b/modules-js/storybook-common/src/wrappers.tsx @@ -13,6 +13,7 @@ export function NarrowWrapper(props: { children: Children }): JSX.Element { const CENTER_STYLING = { margin: '2rem auto' }; const NARROW_STYLING = { - maxWidth: '600px', + // maxWidth: '600px', + maxWidth: '768px', ...CENTER_STYLING, }; diff --git a/services-js/access-boston/src/pages/mfa.tsx b/services-js/access-boston/src/pages/mfa.tsx index 8249802c8..c1e84c392 100644 --- a/services-js/access-boston/src/pages/mfa.tsx +++ b/services-js/access-boston/src/pages/mfa.tsx @@ -143,10 +143,12 @@ export default class RegisterMfaPage extends React.Component { // Stopping the submission process closes the modal. setSubmitting(false); - this.setState({ - status: VerificationStatus.NONE, - verificationError: e.toString(), - }); + if (e) { + this.setState({ + status: VerificationStatus.NONE, + verificationError: e.toString(), + }); + } } }; diff --git a/services-js/access-boston/src/stories/__snapshots__/Storyshots.test.ts.snap b/services-js/access-boston/src/stories/__snapshots__/Storyshots.test.ts.snap index 64a39df93..67963ac9b 100644 --- a/services-js/access-boston/src/stories/__snapshots__/Storyshots.test.ts.snap +++ b/services-js/access-boston/src/stories/__snapshots__/Storyshots.test.ts.snap @@ -3519,7 +3519,7 @@ exports[`Storyshots Confirm-Identity Review 1`] = ` Data of Birth (MM/DD/YYYY)
Day + Year +
Day + Year + How should we send security codes?
@@ -11775,6 +11846,11 @@ exports[`Storyshots RegisterMfaPage modal open 1`] = `
How should we send security codes?
@@ -12136,6 +12212,11 @@ exports[`Storyshots RegisterMfaPage/DeviceVerificationForm code sending error 1`
How should we send security codes?
@@ -12475,6 +12556,11 @@ exports[`Storyshots RegisterMfaPage/DeviceVerificationForm phone 1`] = `
How should we send security codes?
diff --git a/services-js/commissions-app/src/stories/__snapshots__/Storyshots.test.ts.snap b/services-js/commissions-app/src/stories/__snapshots__/Storyshots.test.ts.snap index af77192da..5218adb8f 100644 --- a/services-js/commissions-app/src/stories/__snapshots__/Storyshots.test.ts.snap +++ b/services-js/commissions-app/src/stories/__snapshots__/Storyshots.test.ts.snap @@ -50,11 +50,18 @@ exports[`Storyshots ApplicationForm blank 1`] = ` - {/* no stylesheets because they come in preview-head.html */} - {styleTags({ noStylesheets: true })} - - {this.props.children} -
- ); - } -} - -Wrapper.propTypes = { - headManager: PropTypes.any, - children: PropTypes.any, -}; - -Wrapper.childContextTypes = { - headManager: PropTypes.object, - router: PropTypes.object, -}; - const clientStoriesContext = require.context( '../client', true, - /.stories\.(jsx?|tsx?)$/ + /\.stories\.(jsx?|tsx?)$/ ); + const serverStoriesContext = require.context( '../server', true, @@ -71,12 +26,11 @@ addDecorator(story => { }); if (window.parent) { - // eslint-disable-next-line no-underscore-dangle window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ = window.parent.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__; } - return {story()}; + return story(); }); configure( diff --git a/services-js/registry-certs/.storybook/preview-head.html b/services-js/registry-certs/.storybook/preview-head.html index a5759e565..b66c8b037 100644 --- a/services-js/registry-certs/.storybook/preview-head.html +++ b/services-js/registry-certs/.storybook/preview-head.html @@ -4,5 +4,7 @@ prod, where this tag is written by _document.tsx. --> + + diff --git a/services-js/registry-certs/client/PageWrapper.tsx b/services-js/registry-certs/client/PageWrapper.tsx index 822f9ca0b..94609c0b0 100644 --- a/services-js/registry-certs/client/PageWrapper.tsx +++ b/services-js/registry-certs/client/PageWrapper.tsx @@ -6,8 +6,7 @@ import { Component, ReactNode } from 'react'; import { ProgressBar, - // MEDIA_LARGE, - // MEDIA_SMALL, + ProgressNav, MEDIA_X_LARGE, } from '@cityofboston/react-fleet'; @@ -15,22 +14,18 @@ import PageLayout from './PageLayout'; import { BREADCRUMB_NAV_LINKS } from '../lib/breadcrumbs'; -type CertificateRequestType = 'birth' | 'marriage' | 'intention'; +import { ProgressProps, ProgressNavProps } from '../lib/interfaces'; -export interface Progress { - totalSteps: number; - currentStep: number; - currentStepCompleted: boolean; - offset?: number | undefined; -} +type CertificateRequestType = 'birth' | 'marriage' | 'intention'; interface Props { certificateType: CertificateRequestType; - progress?: Progress; + progress?: ProgressProps; footer?: ReactNode; classString?: string; mainHeadline?: string; offset?: number; + progressNav?: ProgressNavProps; } /** @@ -48,6 +43,7 @@ export default class PageWrapper extends Component { classString, mainHeadline, offset, + progressNav, } = this.props; const sec2ndClassStr = footer ? 'b-c--nbp' : ''; const classStr = @@ -73,6 +69,7 @@ export default class PageWrapper extends Component { {progress && } + {progressNav && }
{children}
diff --git a/services-js/registry-certs/client/StatusModal.tsx b/services-js/registry-certs/client/StatusModal.tsx new file mode 100644 index 000000000..cfc5bdcda --- /dev/null +++ b/services-js/registry-certs/client/StatusModal.tsx @@ -0,0 +1,81 @@ +/** @jsx jsx */ + +import { css, jsx } from '@emotion/core'; +import { ReactNode, ReactNodeArray } from 'react'; + +interface Props { + children: ReactNode | ReactNodeArray; + header?: string; + confirmBtnText?: string; + error?: boolean; + hideTopBorderDecoration?: boolean; + closeModalHandler?: (val: boolean) => void; + confirmHandler?: (dest: string) => void | undefined; +} + +export default function StatusModal(props: Props) { + const { + children, + header, + confirmBtnText, + error, + hideTopBorderDecoration, + closeModalHandler, + confirmHandler, + } = props; + + const topBorderDecorationCss = hideTopBorderDecoration ? '' : ` br br-t400`; + + const closeHandler = () => { + if (closeModalHandler) closeModalHandler(false); + }; + + let $closeBtnProps = { + className: 'md-cb', + }; + if (closeModalHandler) $closeBtnProps['onClick'] = closeHandler; + + let $confirmBtnProps = { + className: 'btn btn--sm btn--100', + }; + if (confirmHandler) $confirmBtnProps['onClick'] = confirmHandler; + + return ( +
+
+ {closeModalHandler && ( + + )} +
+ {header && ( +
{header}
+ )} + + {children} + + {confirmHandler && ( +
+ +
+ )} +
+
+
+ ); +} + +const MODAL_STYLE = css(` + padding-top: 0; + max-width: 500px; + top: 33%; + margin-right: auto; + margin-left: auto; + + button { + border: 0; + cursor: pointer; + } +`); diff --git a/services-js/registry-certs/client/__snapshots__/Storyshots.test.ts.snap b/services-js/registry-certs/client/__snapshots__/Storyshots.test.ts.snap index 41055a109..e22e1ab3d 100644 --- a/services-js/registry-certs/client/__snapshots__/Storyshots.test.ts.snap +++ b/services-js/registry-certs/client/__snapshots__/Storyshots.test.ts.snap @@ -1,7 +1,73 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Storyshots Birth/CheckoutPage confirmation 1`] = ` -.emotion-1 { +Array [ + + Jump to content + , + , +
+
+ + +
+", + } + } + />, + .emotion-1 { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } @@ -79,73 +145,7 @@ exports[`Storyshots Birth/CheckoutPage confirmation 1`] = ` stroke: none; } -
- - Jump to content - - -
-
- - -
-", - } - } - /> -
-
+ ,