-
Notifications
You must be signed in to change notification settings - Fork 16
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
Migrate account #834
Merged
Merged
Migrate account #834
Changes from 25 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
4ba9956
added basic concise explainer screen
tanmoyAtb 66c5f16
Merge branch 'dev' of github.com:imploy/ui into feat/migrate-account-829
tanmoyAtb 3d17029
inittial screens ready
tanmoyAtb 043afeb
migrate functionality wire up
tanmoyAtb 100a5d7
added translations
tanmoyAtb 93c8cd1
translations update
tanmoyAtb 31fd225
added error message
tanmoyAtb f7e172d
merged
tanmoyAtb 3d211fe
linted
tanmoyAtb 101a573
functionality update
tanmoyAtb be77354
removed logs and comments
tanmoyAtb 8170229
updated validate password
tanmoyAtb 6e0e8b7
CSS updates
tanmoyAtb de8dad5
Update packages/files-ui/src/Components/Modules/LoginModule/ConciseEx…
tanmoyAtb 33cfce2
Update packages/files-ui/src/Components/Modules/LoginModule/ConciseEx…
tanmoyAtb 8842e83
Merge branch 'dev' of github.com:imploy/ui into feat/migrate-account-829
tanmoyAtb 15b6645
Merge branch 'feat/migrate-account-829' of github.com:imploy/ui into …
tanmoyAtb fff264d
added extractions
tanmoyAtb 7acbcd6
linted
tanmoyAtb dc9111b
added extractions
tanmoyAtb f17972d
Update packages/files-ui/src/Components/Modules/LoginModule/ConciseEx…
tanmoyAtb 38d8437
updated translations
tanmoyAtb c7c6699
Update packages/files-ui/src/Components/Modules/LoginModule/MigrateAc…
tanmoyAtb 7a32f1c
Merge branch 'feat/migrate-account-829' of github.com:imploy/ui into …
tanmoyAtb f712ee2
added extractions
tanmoyAtb 93e530d
added fixes
tanmoyAtb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
174 changes: 174 additions & 0 deletions
174
packages/files-ui/src/Components/Modules/LoginModule/ConciseExplainer.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,174 @@ | ||
import React from "react" | ||
import { createStyles, makeStyles, useThemeSwitcher } from "@chainsafe/common-theme" | ||
import { CSFTheme } from "../../../Themes/types" | ||
import { Button, Typography } from "@chainsafe/common-components" | ||
import DesktopMobilePNG from "../../../Media/landing/layers/desktop-mobile.png" | ||
import PasswordKeyPNG from "../../../Media/landing/layers/password-key.png" | ||
import PeacefulSuccotashPNG from "../../../Media/landing/layers/peaceful-succotash.png" | ||
import { t, Trans } from "@lingui/macro" | ||
import { ROUTE_LINKS } from "../../FilesRoutes" | ||
|
||
// Concise explainer is used in both initialize and migrate account | ||
const useStyles = makeStyles( | ||
({ constants, breakpoints, typography }: CSFTheme) => | ||
createStyles({ | ||
root: { | ||
padding: `${constants.generalUnit * 6}px ${constants.generalUnit * 4}px`, | ||
minHeight: "inherit", | ||
display: "flex", | ||
flexDirection: "column", | ||
justifyContent: "space-between", | ||
[breakpoints.down("md")]: { | ||
padding: `${constants.generalUnit * 3}px ${constants.generalUnit * 3}px` | ||
} | ||
}, | ||
title: { | ||
fontWeight: 400, | ||
marginBottom: constants.generalUnit * 2, | ||
[breakpoints.down("md")]: { | ||
...typography.h4 | ||
} | ||
}, | ||
subtitle: { | ||
...typography.body1, | ||
[breakpoints.down("md")]: { | ||
...typography.body2 | ||
} | ||
}, | ||
graphicsContainer: { | ||
display: "flex", | ||
justifyContent: "space-between", | ||
[breakpoints.down("md")]: { | ||
flexDirection: "column" | ||
} | ||
}, | ||
imageBox: { | ||
padding: constants.generalUnit * 1, | ||
display: "flex", | ||
flexDirection: "column", | ||
alignItems: "center", | ||
[breakpoints.up("md")]: { | ||
textAlign: "center" | ||
}, | ||
[breakpoints.down("md")]: { | ||
flexDirection: "row" | ||
}, | ||
"& img": { | ||
maxHeight: 64, | ||
marginRight: constants.generalUnit * 3 | ||
} | ||
}, | ||
buttonContainer: { | ||
paddingTop: constants.generalUnit * 3, | ||
display: "flex", | ||
justifyContent: "flex-end", | ||
[breakpoints.down("md")]: { | ||
paddingTop: constants.generalUnit * 3, | ||
flexDirection: "row", | ||
justifyContent: "center" | ||
} | ||
}, | ||
doItButton: { | ||
minWidth: 120, | ||
[breakpoints.down("md")]: { | ||
minWidth: "100%" | ||
} | ||
} | ||
}) | ||
) | ||
|
||
interface IConciseExplainerProps { | ||
screen: "initialize" | "migrate" | ||
onLetsDoIt: () => void | ||
} | ||
|
||
const ConciseExplainer: React.FC<IConciseExplainerProps> = ({ screen, onLetsDoIt }) => { | ||
const classes = useStyles() | ||
|
||
const { desktop } = useThemeSwitcher() | ||
|
||
return ( | ||
<div className={classes.root}> | ||
<div> | ||
<Typography variant="h2" component="h2" className={classes.title}> | ||
<Trans>Introducing multi-factor sign in</Trans> | ||
</Typography> | ||
<Typography variant="body1" component="p" className={classes.subtitle}> | ||
{screen === "initialize" | ||
? t`Welcome! Here at Files we don’t require emails and phone numbers to set up an account. ` | ||
: t`Previously, you required a password to access your Files account. | ||
We’re happy to announce that you don’t need a password to sign in anymore. | ||
All you have to do is set up multiple sign-in methods.` | ||
} | ||
</Typography> | ||
<br /> | ||
<Typography variant="body1" component="p" className={classes.subtitle}> | ||
{screen === "initialize" | ||
? t`Instead, we use multiple sign-in methods for security and account recovery purposes. | ||
Each time you log in with your cryptowallet, Google, Facebook, or Github, | ||
you’ll be asked for one of the sign-in methods below:` | ||
: t`Setting these up means you’ll be able to recover your account if you do get locked out somehow. | ||
Here’s what you can do now:` | ||
} | ||
</Typography> | ||
<br /> | ||
<div className={classes.graphicsContainer}> | ||
<div className={classes.imageBox}> | ||
<img src={DesktopMobilePNG} alt="devices" /> | ||
<br /> | ||
<Typography variant="body1" component="p" className={classes.subtitle}> | ||
<Trans>Save the device</Trans> | ||
</Typography> | ||
</div> | ||
<div className={classes.imageBox}> | ||
<img src={PasswordKeyPNG} alt="password and keys" /> | ||
<br /> | ||
<Typography variant="body1" component="p" className={classes.subtitle}> | ||
<Trans>Add and change passwords</Trans> | ||
</Typography> | ||
</div> | ||
<div className={classes.imageBox}> | ||
<img src={PeacefulSuccotashPNG} alt="peaceful succotash" /> | ||
<br /> | ||
<Typography variant="body1" component="p" className={classes.subtitle}> | ||
<Trans>Recover with passphrase</Trans> | ||
</Typography> | ||
</div> | ||
</div> | ||
<br /> | ||
<Typography variant="body1" component="p" className={classes.subtitle}> | ||
{screen === "initialize" | ||
? ( | ||
<> | ||
<Trans>Setting up multiple sign-in methods makes signing in on multiple devices and restoring your account a breeze, | ||
tanmoyAtb marked this conversation as resolved.
Show resolved
Hide resolved
|
||
all done without us storing information about you. Think that’s cool? | ||
<a href={ROUTE_LINKS.ApplyCryptography} target="_blank" rel="noopener noreferrer"> | ||
Learn how we apply cryptography to ensure the privacy of your data. | ||
</a> | ||
</Trans> | ||
</> | ||
) : | ||
( | ||
<> | ||
<Trans> | ||
Check out | ||
<a href={ROUTE_LINKS.ApplyCryptography} target="_blank" rel="noopener noreferrer"> | ||
how we apply cryptography | ||
</a> | ||
to ensure the privacy of your data. | ||
</Trans> | ||
</> | ||
) | ||
} | ||
</Typography> | ||
</div> | ||
<div className={classes.buttonContainer}> | ||
<Button onClick={onLetsDoIt} className={classes.doItButton}> | ||
<Trans>{desktop ? t`Let's do it` : t`Next`}</Trans> | ||
</Button> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default ConciseExplainer |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm for creating an issue rather than adding this here, which we might ignore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely better to have an issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added it #849