-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e18069f
commit 7693520
Showing
18 changed files
with
549 additions
and
19 deletions.
There are no files selected for viewing
79 changes: 79 additions & 0 deletions
79
...ts/views/GetStartedPage/PreCreateWallet/CreateLedgerWalletForm/CreateLedgerWalletForm.jsx
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,79 @@ | ||
import { FormattedMessage as T, defineMessages } from "react-intl"; | ||
import { TextInput } from "inputs"; | ||
import { KeyBlueButton, InvisibleButton } from "buttons"; | ||
import styles from "./CreateLedgerWalletForm.module.css"; | ||
import { Documentation } from "shared"; | ||
|
||
const messages = defineMessages({ | ||
walletNameInputPlaceholder: { | ||
id: "createLedgerWallet.walletNameInput.placeholder", | ||
defaultMessage: "Choose a name for your Ledger Wallet" | ||
}, | ||
walletNameInputLabel: { | ||
id: "createLedgerWallet.walletNameInput.label", | ||
defaultMessage: "Wallet Name" | ||
}, | ||
messageWalletDupeNameError: { | ||
id: "createLedgerWallet.dupeWalletName.error", | ||
defaultMessage: "Please choose an unused wallet name" | ||
} | ||
}); | ||
|
||
const CreateLedgerWalletForm = ({ | ||
createWallet, | ||
hideCreateWalletForm, | ||
newWalletName, | ||
walletNameError, | ||
onChangeCreateWalletName, | ||
hasFailedAttemptName, | ||
intl | ||
}) => { | ||
return ( | ||
<div className={styles.container}> | ||
<div className={styles.title}> | ||
<T | ||
id="createLedgerWallet.title" | ||
m="Create a Ledger-backed Decrediton Wallet" | ||
/> | ||
</div> | ||
<div className={styles.grid}> | ||
<Documentation name="PreCreateLedgerWallet1" /> | ||
<Documentation name="PreCreateLedgerWallet2" /> | ||
<T id="createLedgerWallet.createAWallet" m="Create a Wallet" /> | ||
</div> | ||
|
||
<div> | ||
<TextInput | ||
newBiggerFontStyle | ||
id="walletNameInput" | ||
required | ||
invalid={walletNameError} | ||
invalidMessage={intl.formatMessage( | ||
messages.messageWalletDupeNameError | ||
)} | ||
value={newWalletName} | ||
onChange={(e) => onChangeCreateWalletName(e.target.value)} | ||
label={intl.formatMessage(messages.walletNameInputLabel)} | ||
placeholder={intl.formatMessage(messages.walletNameInputPlaceholder)} | ||
showErrors={hasFailedAttemptName} | ||
className={styles.walletNameInput} | ||
/> | ||
|
||
<div className={styles.buttonContrainer}> | ||
<InvisibleButton | ||
onClick={hideCreateWalletForm} | ||
className={styles.cancelBt}> | ||
<T id="createLedgerWallet.cancel" m="Cancel" /> | ||
</InvisibleButton> | ||
<KeyBlueButton | ||
onClick={createWallet} | ||
classNames={styles.createWalletBt}> | ||
<T id="createLedgerWallet.createWallet" m="Create Wallet" /> | ||
</KeyBlueButton> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default CreateLedgerWalletForm; |
59 changes: 59 additions & 0 deletions
59
...s/GetStartedPage/PreCreateWallet/CreateLedgerWalletForm/CreateLedgerWalletForm.module.css
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,59 @@ | ||
.container { | ||
width: 764px; | ||
} | ||
|
||
.grid { | ||
display: grid; | ||
grid-template-columns: repeat(2, 30rem); | ||
grid-column-gap: 76px; | ||
font-size: 13px; | ||
line-height: 17px; | ||
color: var(--grey-7); | ||
margin: 38px 0 32px 0; | ||
} | ||
|
||
.title { | ||
font-size: 27px; | ||
line-height: 34px; | ||
color: var(--grey-7); | ||
width: 32rem; | ||
} | ||
|
||
.textToggle { | ||
font-size: 13px; | ||
line-height: 16px; | ||
height: 29px; | ||
grid-column: 1; | ||
margin-top: 20px; | ||
} | ||
|
||
.textToggleChild { | ||
padding: 6px 31px; | ||
} | ||
|
||
.walletNameInput, | ||
.walletNameInput input { | ||
width: 279px !important; | ||
} | ||
|
||
.buttonContrainer { | ||
width: 279px; | ||
display: flex; | ||
justify-content: flex-end; | ||
margin-top: 20px; | ||
} | ||
|
||
.cancelBt, | ||
.createWalletBt { | ||
height: 44px; | ||
} | ||
|
||
@media screen and (max-width: 768px) { | ||
.container { | ||
width: 355px; | ||
} | ||
|
||
.grid { | ||
grid-template-columns: 30rem; | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
app/components/views/GetStartedPage/PreCreateWallet/CreateLedgerWalletForm/index.js
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 @@ | ||
export { default } from "./CreateLedgerWalletForm"; |
33 changes: 33 additions & 0 deletions
33
...iews/GetStartedPage/PreCreateWallet/LedgerLoaderBarContainer/LedgerLoaderBarContainer.jsx
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,33 @@ | ||
import { FormattedMessage as T } from "react-intl"; | ||
import styles from "./LedgerLoaderBarContainer.module.css"; | ||
import { useLedgerLoaderBarContainer } from "./hooks"; | ||
|
||
const LedgerLoaderBarContainer = ({ loaderBar }) => { | ||
const { ledgerDevice, deviceLabel } = useLedgerLoaderBarContainer(); | ||
return ledgerDevice ? ( | ||
<div className={styles.loaderBarContainer}> | ||
<div className={styles.deviceStatus}> | ||
<span className={styles.deviceLabel}> | ||
<T | ||
id="ledgerLoaderBarContainer.Connected" | ||
m="{label} Ledger" | ||
values={{ | ||
label: deviceLabel ? ( | ||
deviceLabel | ||
) : ( | ||
<T id="ledgerLoaderBarContainer.deviceLabel" m="New DCR" /> | ||
) | ||
}} | ||
/> | ||
</span> | ||
<span> | </span> | ||
<span className={styles.connected}> | ||
<T id="ledgerLoaderBarContainer.connected" m="Connected" /> | ||
</span> | ||
</div> | ||
<div className={styles.loaderBar}>{loaderBar}</div> | ||
</div> | ||
) : null; | ||
}; | ||
|
||
export default LedgerLoaderBarContainer; |
63 changes: 63 additions & 0 deletions
63
...tStartedPage/PreCreateWallet/LedgerLoaderBarContainer/LedgerLoaderBarContainer.module.css
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,63 @@ | ||
.loaderBarContainer { | ||
position: fixed; | ||
bottom: 0; | ||
left: 0; | ||
right: 0; | ||
box-shadow: 0px -4px 8px rgba(0, 0, 0, 0.1); | ||
display: grid; | ||
grid-template-columns: 1fr 1fr; | ||
align-items: center; | ||
background-size: 14px; | ||
background-repeat: no-repeat; | ||
background-position: 25px center; | ||
background-image: var(--tz-create-bt); | ||
} | ||
|
||
.loaderBar div { | ||
border-radius: 0; | ||
} | ||
|
||
.loaderBar, | ||
.loaderBar > div { | ||
height: 60px; | ||
background: linear-gradient( | ||
270deg, | ||
var(--display-wallet-gradient-selected-right), | ||
var(--input-color) | ||
); | ||
color: var(--white-button-text); | ||
padding-left: 1rem; | ||
font-size: 1.1rem; | ||
} | ||
|
||
.loaderBar > div > div:nth-of-type(1) { | ||
grid-column: 2; | ||
grid-row: 1; | ||
align-items: center; | ||
display: flex; | ||
padding-left: 1rem; | ||
} | ||
.loaderBar > div > div:nth-of-type(2n) { | ||
grid-column: 1; | ||
grid-row: 1; | ||
} | ||
|
||
.loaderBar > div > div:nth-of-type(2n) > div { | ||
background-size: 2rem; | ||
background-position: center; | ||
} | ||
|
||
.deviceStatus { | ||
font-size: 13px; | ||
line-height: 16px; | ||
padding-left: 55px; | ||
} | ||
|
||
.deviceLabel { | ||
font-weight: 600; | ||
color: var(--main-dark-blue); | ||
} | ||
|
||
.connected { | ||
color: var(--accent-blue); | ||
} |
10 changes: 10 additions & 0 deletions
10
app/components/views/GetStartedPage/PreCreateWallet/LedgerLoaderBarContainer/hooks.js
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,10 @@ | ||
import { useSelector } from "react-redux"; | ||
import { useDaemonStartup } from "hooks"; | ||
import * as sel from "selectors"; | ||
|
||
export const useLedgerLoaderBarContainer = () => { | ||
const { ledgerDevice } = useDaemonStartup(); | ||
const deviceLabel = useSelector(sel.ledgerLabel); | ||
|
||
return { ledgerDevice, deviceLabel }; | ||
}; |
1 change: 1 addition & 0 deletions
1
app/components/views/GetStartedPage/PreCreateWallet/LedgerLoaderBarContainer/index.js
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 @@ | ||
export { default } from "./LedgerLoaderBarContainer"; |
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
Oops, something went wrong.