-
-
Notifications
You must be signed in to change notification settings - Fork 266
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
Showing
10 changed files
with
146 additions
and
148 deletions.
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
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
File renamed without changes.
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
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
This file was deleted.
Oops, something went wrong.
83 changes: 83 additions & 0 deletions
83
packages/connect-popup/src/view/react/views/Passphrase.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,83 @@ | ||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
import { variables, PassphraseTypeCard } from '@trezor/components'; | ||
|
||
import { postMessage } from '../../common'; | ||
import { UI, createUiResponse } from '@trezor/connect'; | ||
|
||
const Wrapper = styled.div<{ authConfirmation?: boolean }>` | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
@media screen and (max-width: ${variables.SCREEN_SIZE.MD}) { | ||
width: 100%; | ||
} | ||
`; | ||
|
||
const WalletsWrapper = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
width: 100%; | ||
`; | ||
|
||
const Divider = styled.div` | ||
margin: 16px 16px; | ||
height: 1px; | ||
background: ${props => props.theme.STROKE_GREY}; | ||
`; | ||
|
||
// todo: | ||
const Translation = (props: any) => <span>{props.id}</span>; | ||
|
||
// todo: | ||
export const Passphrase = (props: any) => { | ||
console.log('Passphrase.props', props); | ||
const { device } = props; | ||
const { features } = device; | ||
|
||
const offerPassphraseOnDevice = | ||
features && | ||
features.capabilities && | ||
features.capabilities.includes('Capability_PassphraseEntry'); | ||
|
||
const onSubmit = (value: string, passphraseOnDevice = false) => { | ||
console.log('onSubmit', value, passphraseOnDevice); | ||
postMessage( | ||
createUiResponse(UI.RECEIVE_PASSPHRASE, { | ||
value, | ||
passphraseOnDevice, | ||
// todo: what is this param? | ||
save: true, | ||
}), | ||
); | ||
}; | ||
|
||
return ( | ||
<> | ||
<h3>Passphrase</h3> | ||
|
||
{/* todo: this part could be shared with suite? */} | ||
<Wrapper> | ||
<WalletsWrapper> | ||
<PassphraseTypeCard | ||
title={<Translation id="TR_NO_PASSPHRASE_WALLET" />} | ||
description={<Translation id="TR_STANDARD_WALLET_DESCRIPTION" />} | ||
submitLabel={<Translation id="TR_ACCESS_STANDARD_WALLET" />} | ||
type="standard" | ||
onSubmit={onSubmit} | ||
/> | ||
<Divider /> | ||
<PassphraseTypeCard | ||
title={<Translation id="TR_WALLET_SELECTION_HIDDEN_WALLET" />} | ||
description={<Translation id="TR_HIDDEN_WALLET_DESCRIPTION" />} | ||
submitLabel={<Translation id="TR_WALLET_SELECTION_ACCESS_HIDDEN_WALLET" />} | ||
type="hidden" | ||
offerPassphraseOnDevice={offerPassphraseOnDevice} | ||
onSubmit={onSubmit} | ||
/> | ||
</WalletsWrapper> | ||
</Wrapper> | ||
</> | ||
); | ||
}; |
13 changes: 13 additions & 0 deletions
13
packages/connect-popup/src/view/react/views/PassphraseOnDevice.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,13 @@ | ||
import React from 'react'; | ||
|
||
// todo: maybe follow instructions on device would be enough? | ||
// todo: | ||
export const PassphraseOnDevice = (props: any) => { | ||
console.log('Passphrase.props', props); | ||
|
||
return ( | ||
<> | ||
<h3>Passphrase on device</h3> | ||
</> | ||
); | ||
}; |
4 changes: 1 addition & 3 deletions
4
packages/suite/src/components/suite/modals/Passphrase/index.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
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