Skip to content

Commit

Permalink
v2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
maxaleks authored May 11, 2023
2 parents fda9ae0 + 0cf816d commit 72bcd0b
Show file tree
Hide file tree
Showing 30 changed files with 380 additions and 253 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zkbob-ui",
"version": "2.0.2",
"version": "2.1.0",
"private": true,
"dependencies": {
"@dicebear/avatars": "^4.10.2",
Expand Down
2 changes: 1 addition & 1 deletion src/components/AccountSetUpModal/Confirm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default ({ mnemonic, confirmMnemonic }) => {
return (
<Container>
<Description>
Please input your seed phrase to verify it.<br/> Click on a word to remove it
Please input your secret phrase to verify it.<br/> Click on a word to remove it
</Description>
<MnemonicInput>
{repeated.map(wordObj =>
Expand Down
4 changes: 2 additions & 2 deletions src/components/AccountSetUpModal/Create/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ export default ({ mnemonic, next }) => {
Write down or copy these words in the right order and save them somewhere safe
</Description>
<Warning>
Never share your recovery phrase with anyone,<br/> store it securely!
Never share your secret phrase with anyone,<br/> store it securely!
</Warning>
<SeedPhrase value={mnemonic} />
<CopyTextButton text={mnemonic} style={{ alignSelf: 'center' }}>
Copy seed phrase
Copy secret phrase
</CopyTextButton>
<Button onClick={next}>Continue</Button>
</Container>
Expand Down
22 changes: 7 additions & 15 deletions src/components/AccountSetUpModal/Generate/index.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
import React from 'react';
import styled from 'styled-components';

import Button from 'components/Button';
import WalletConnectors from 'components/WalletConnectors';

export default ({ generate, account, connectWallet }) => {
export default ({ generate, isCreation }) => {
return (
<Container>
<Description>
Your key identifies your account on Layer 2 and is saved locally on your browser.
{isCreation
? 'Choose the wallet that will be associated with your zkAccount'
: 'Select the wallet you used to create your zkAccount'
}
</Description>
{account ? (
<Button onClick={generate}>Generate key</Button>
) : (
<Button onClick={connectWallet}>Connect wallet</Button>
)}
<Note>
Signing is free and will not send a transaction. You can recover your key at any time with your wallet.
</Note>
<WalletConnectors callback={generate} />
</Container>
);
};
Expand All @@ -40,7 +36,3 @@ const Description = styled.span`
line-height: 20px;
text-align: center;
`;

const Note = styled(Description)`
color: ${({ theme }) => theme.text.color.secondary};
`;
4 changes: 2 additions & 2 deletions src/components/AccountSetUpModal/Restore/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Button from 'components/Button';
import TextAreaDefault from 'components/TextArea';

export default ({ restore }) => {
const [mnemonic, setMnemonic] = useState();
const [mnemonic, setMnemonic] = useState('');
const [error, setError] = useState(false);

const onRestore = useCallback(() => {
Expand All @@ -27,7 +27,7 @@ export default ({ restore }) => {
return (
<Container>
<Description>
Input your saved seed phrase to restore an existing account
Input your saved secret phrase to restore an existing account
</Description>
<TextArea value={mnemonic} onChange={onChange} $error={error} />
<Button onClick={onRestore}>Restore account</Button>
Expand Down
38 changes: 38 additions & 0 deletions src/components/AccountSetUpModal/Sign/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import React from 'react';
import styled from 'styled-components';

import Spinner from 'components/Spinner';

export default ({ isCreation }) => {
return (
<Container>
<Spinner />
<Note>
{isCreation
? 'Your zkAccount is being created based on the connected wallet.'
: 'Accessing your zkAccount with your connected wallet.'
}
</Note>
</Container>
);
};

const Container = styled.div`
display: flex;
flex-direction: column;
width: 100%;
box-sizing: border-box;
& > * {
margin-bottom: 16px;
&:last-child {
margin-bottom: 0;
}
}
`;

const Note = styled.span`
font-size: 14px;
color: ${({ theme }) => theme.text.color.secondary};
line-height: 20px;
text-align: center;
`;
Loading

0 comments on commit 72bcd0b

Please sign in to comment.