feat(settings): new FlowSetup2faBackupCodeDownload component#18941
feat(settings): new FlowSetup2faBackupCodeDownload component#18941MagentaManifold merged 1 commit intomainfrom
Conversation
vpomerleau
left a comment
There was a problem hiding this comment.
Great work! Comments are small nits/suggestions for improvements. Not blocking!
packages/fxa-settings/src/components/Settings/FlowSetup2faBackupCodeDownload/en.ftl
Outdated
Show resolved
Hide resolved
packages/fxa-settings/src/components/Settings/FlowSetup2faBackupCodeDownload/index.stories.tsx
Show resolved
Hide resolved
packages/fxa-settings/src/components/Settings/FlowSetup2faBackupCodeDownload/index.stories.tsx
Outdated
Show resolved
Hide resolved
packages/fxa-settings/src/components/Settings/FlowSetup2faBackupCodeDownload/index.test.tsx
Outdated
Show resolved
Hide resolved
packages/fxa-settings/src/components/Settings/FlowSetup2faBackupCodeDownload/index.test.tsx
Outdated
Show resolved
Hide resolved
packages/fxa-settings/src/components/Settings/FlowSetup2faBackupCodeDownload/index.tsx
Outdated
Show resolved
Hide resolved
packages/fxa-settings/src/components/Settings/FlowSetup2faBackupCodeDownload/index.tsx
Outdated
Show resolved
Hide resolved
packages/fxa-settings/src/components/Settings/FlowSetup2faBackupCodeDownload/index.tsx
Outdated
Show resolved
Hide resolved
packages/fxa-settings/src/components/Settings/FlowSetup2faBackupCodeDownload/index.tsx
Outdated
Show resolved
Hide resolved
packages/fxa-settings/src/components/Settings/FlowSetup2faBackupCodeDownload/index.tsx
Show resolved
Hide resolved
f2e6f02 to
9f8abe0
Compare
|
I implemented the logic for UA detection inside the FlowSetup2faBackupCodeDownload component instead of passing it in as a prop, because I don't feel the need to pass it through so many layers of components, since this is the only component relying on the UA anyway. |
bcolsson
left a comment
There was a problem hiding this comment.
Looks good, some minor suggestions (try to avoid acronyms in descriptions since those aren't easily understood by localizers).
Also adding a ending group comment as insurance due to quirks related to the string extract process.
packages/fxa-settings/src/components/Settings/FlowSetup2faBackupCodeDownload/en.ftl
Outdated
Show resolved
Hide resolved
packages/fxa-settings/src/components/Settings/FlowSetup2faBackupCodeDownload/en.ftl
Show resolved
Hide resolved
Because: * The design for 2FA setup has been updated * We want the UI component to be reusable * We want to document the component and states in storybook This commit: * Creates a new UI component with l10n, storybook and unit tests * Tweaks Datablock to match the lastest design * Does not hook up the component in the setup flow - that will be done in a later ticket Closes #FXA-11624
9f8abe0 to
85960ef
Compare
vpomerleau
left a comment
There was a problem hiding this comment.
Thanks for the updates! Approving with a small recommendation for the ua check.
| onContinue, | ||
| reason = GleanClickEventType2FA.setup, | ||
| }: FlowSetup2faBackupCodeDownloadProps) => { | ||
| const [isMobile, setIsMobile] = React.useState(false); |
There was a problem hiding this comment.
Why set as state? This should only need to be computed once, since it is static (vs checking based on viewport sizing which could change). Perhaps useMemo or a plain const would be sufficient?
If updating this - it might also be good to update the comment with a tad more detail about what types will be reported as 'mobile' here vs having no known "type" (≈ desktop)
There was a problem hiding this comment.
Checking UA is impure, so useMemo is not correct here. Using a plain const will cause the UA check to run every re-render. So I am using a combination of useState and useEffect, so that the check is only run once (on mount).
Will update in future PRs if better solution exists
Because
This pull request
Issue that this pull request solves
Closes: FXA-11624
Checklist
Put an
xin the boxes that applyScreenshots (Optional)
Other information (Optional)
Any other information that is important to this pull request.