Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
15 word shelley wallet support (#1628)
- Loading branch information
1 parent
d93d472
commit 73566ea
Showing
25 changed files
with
431 additions
and
182 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
83 changes: 83 additions & 0 deletions
83
app/components/wallet/add/option-dialog/WalletEraOptionDialog.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,83 @@ | ||
// @flow | ||
import type { Node } from 'react'; | ||
import React, { Component } from 'react'; | ||
import { observer } from 'mobx-react'; | ||
import { defineMessages, intlShape } from 'react-intl'; | ||
|
||
import Dialog from '../../../widgets/Dialog'; | ||
import DialogCloseButton from '../../../widgets/DialogCloseButton'; | ||
import OptionBlock from '../../../widgets/options/OptionBlock'; | ||
import type { $npm$ReactIntl$IntlFormat } from 'react-intl'; | ||
import styles from '../../../widgets/options/OptionListWrapperStyle.scss'; | ||
import DialogBackButton from '../../../widgets/DialogBackButton'; | ||
|
||
const messages = defineMessages({ | ||
dialogTitle: { | ||
id: 'wallet.add.optionDialog.walletEra.dialogTitle', | ||
defaultMessage: '!!!Choose era', | ||
}, | ||
restoreByronEraWalletTitle: { | ||
id: 'wallet.add.optionDialog.walletEra.byronEra.title', | ||
defaultMessage: '!!!Byron-era (read-only) wallet', | ||
}, | ||
restoreByronEraWalletDescription: { | ||
id: 'wallet.add.optionDialog.walletEra.byronEra.description', | ||
defaultMessage: '!!!Wallets created before July 29th, 2020 are Byron-era wallets and cannot delegate.', | ||
}, | ||
restoreShelleyEraWalletTitle: { | ||
id: 'wallet.add.optionDialog.walletEra.shelleyEra.title', | ||
defaultMessage: '!!!Shelley-era wallet', | ||
}, | ||
restoreShelleyEraWalletDescription: { | ||
id: 'wallet.add.optionDialog.walletEra.shelleyEra.description', | ||
defaultMessage: '!!!Shelley-era wallets support delegation to stake pools.', | ||
}, | ||
}); | ||
|
||
type Props = {| | ||
+onCancel: void => void, | ||
+onByron: void => void, | ||
+onShelley: void => void, | ||
+onBack: void => void, | ||
|}; | ||
|
||
@observer | ||
export default class WalletEraOptionDialog extends Component<Props> { | ||
static contextTypes: {|intl: $npm$ReactIntl$IntlFormat|} = { | ||
intl: intlShape.isRequired, | ||
}; | ||
|
||
render(): Node { | ||
const { intl } = this.context; | ||
|
||
return ( | ||
<Dialog | ||
title={intl.formatMessage(messages.dialogTitle)} | ||
closeOnOverlayClick={false} | ||
onClose={this.props.onCancel} | ||
closeButton={<DialogCloseButton />} | ||
className="WalletEraOptionDialog" | ||
backButton={<DialogBackButton onBack={this.props.onBack} />} | ||
> | ||
<div className={styles.component}> | ||
<ul className={styles.optionBlockList}> | ||
<OptionBlock | ||
parentName="WalletEraOptionDialog" | ||
type="bgByronMainnet" | ||
title={intl.formatMessage(messages.restoreByronEraWalletTitle)} | ||
learnMoreText={intl.formatMessage(messages.restoreByronEraWalletDescription)} | ||
onSubmit={this.props.onByron} | ||
/> | ||
<OptionBlock | ||
parentName="WalletEraOptionDialog" | ||
type="bgShelleyMainnet" | ||
title={intl.formatMessage(messages.restoreShelleyEraWalletTitle)} | ||
learnMoreText={intl.formatMessage(messages.restoreShelleyEraWalletDescription)} | ||
onSubmit={this.props.onShelley} | ||
/> | ||
</ul> | ||
</div> | ||
</Dialog> | ||
); | ||
} | ||
} |
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 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 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 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
Oops, something went wrong.