diff options
author | Alexander Tseung <alextsg@gmail.com> | 2018-04-22 15:14:40 +0800 |
---|---|---|
committer | Alexander Tseung <alextsg@gmail.com> | 2018-04-23 00:24:21 +0800 |
commit | 3082d2e4ef02306d5c09fbd1032a22d2efa33324 (patch) | |
tree | a51591358ceb63b4704ff415b783dc6312da6548 /ui/app/components/export-text-container | |
parent | 477b74124d24c9497fafb0c976eba27712c69d79 (diff) | |
download | tangerine-wallet-browser-3082d2e4ef02306d5c09fbd1032a22d2efa33324.tar tangerine-wallet-browser-3082d2e4ef02306d5c09fbd1032a22d2efa33324.tar.gz tangerine-wallet-browser-3082d2e4ef02306d5c09fbd1032a22d2efa33324.tar.bz2 tangerine-wallet-browser-3082d2e4ef02306d5c09fbd1032a22d2efa33324.tar.lz tangerine-wallet-browser-3082d2e4ef02306d5c09fbd1032a22d2efa33324.tar.xz tangerine-wallet-browser-3082d2e4ef02306d5c09fbd1032a22d2efa33324.tar.zst tangerine-wallet-browser-3082d2e4ef02306d5c09fbd1032a22d2efa33324.zip |
Use new design for reveal seed screen. Persist seed words only in first time flow
Diffstat (limited to 'ui/app/components/export-text-container')
3 files changed, 99 insertions, 0 deletions
diff --git a/ui/app/components/export-text-container/export-text-container.component.js b/ui/app/components/export-text-container/export-text-container.component.js new file mode 100644 index 000000000..c2546fa9b --- /dev/null +++ b/ui/app/components/export-text-container/export-text-container.component.js @@ -0,0 +1,45 @@ +const { Component } = require('react') +const PropTypes = require('prop-types') +const h = require('react-hyperscript') +const copyToClipboard = require('copy-to-clipboard') +const { exportAsFile } = require('../../util') + +class ExportTextContainer extends Component { + render () { + const { text = '', filename = '' } = this.props + const { t } = this.context + + return ( + h('.export-text-container', [ + h('.export-text-container__text-container', [ + h('.export-text-container__text', text), + ]), + h('.export-text-container__buttons-container', [ + h('.export-text-container__button.export-text-container__button--copy', { + onClick: () => copyToClipboard(text), + }, [ + h('img', { src: 'images/copy-to-clipboard.svg' }), + h('.export-text-container__button-text', t('copyToClipboard')), + ]), + h('.export-text-container__button', { + onClick: () => exportAsFile(filename, text), + }, [ + h('img', { src: 'images/download.svg' }), + h('.export-text-container__button-text', t('saveAsCsvFile')), + ]), + ]), + ]) + ) + } +} + +ExportTextContainer.propTypes = { + text: PropTypes.string, + filename: PropTypes.string, +} + +ExportTextContainer.contextTypes = { + t: PropTypes.func, +} + +module.exports = ExportTextContainer diff --git a/ui/app/components/export-text-container/export-text-container.scss b/ui/app/components/export-text-container/export-text-container.scss new file mode 100644 index 000000000..a42de8233 --- /dev/null +++ b/ui/app/components/export-text-container/export-text-container.scss @@ -0,0 +1,52 @@ +.export-text-container { + display: flex; + justify-content: center; + flex-direction: column; + align-items: center; + border: 1px solid $alto; + border-radius: 4px; + font-weight: 400; + + &__text-container { + width: 100%; + display: flex; + justify-content: center; + padding: 20px; + border-radius: 4px; + background: $alabaster; + } + + &__text { + resize: none; + border: none; + background: $alabaster; + font-size: 20px; + text-align: center; + } + + &__buttons-container { + display: flex; + flex-direction: row; + border-top: 1px solid $alto; + width: 100%; + } + + &__button { + padding: 10px; + flex: 1; + display: flex; + justify-content: center; + align-items: center; + font-size: 14px; + cursor: pointer; + color: $curious-blue; + + &--copy { + border-right: 1px solid $alto; + } + } + + &__button-text { + padding-left: 10px; + } +} diff --git a/ui/app/components/export-text-container/index.js b/ui/app/components/export-text-container/index.js new file mode 100644 index 000000000..b2864a717 --- /dev/null +++ b/ui/app/components/export-text-container/index.js @@ -0,0 +1,2 @@ +const ExportTextContainer = require('./export-text-container.component') +module.exports = ExportTextContainer |