-
Notifications
You must be signed in to change notification settings - Fork 312
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' of https://github.com/CityOfZion/neon-wallet into …
…feature/offline-signing
- Loading branch information
Showing
27 changed files
with
531 additions
and
136 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,27 @@ | ||
export { default } from './EncryptPanel' | ||
// @flow | ||
import { connect } from 'react-redux' | ||
import { compose } from 'recompose' | ||
import { bindActionCreators } from 'redux' | ||
import { | ||
getEncryptedWIF, | ||
resetEncryptedWIF, | ||
} from '../../../modules/generateEncryptedWIF' | ||
import EncryptPanel from './EncryptPanel' | ||
|
||
const mapStateToProps = (state: Object) => ({ | ||
encryptedWIF: getEncryptedWIF(state), | ||
}) | ||
|
||
const actionCreators = { | ||
resetEncryptedWIF, | ||
} | ||
|
||
const mapDispatchToProps = dispatch => | ||
bindActionCreators(actionCreators, dispatch) | ||
|
||
export default compose( | ||
connect( | ||
mapStateToProps, | ||
mapDispatchToProps, | ||
), | ||
)(EncryptPanel) |
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,89 @@ | ||
// @flow | ||
import React, { Component } from 'react' | ||
|
||
import Button from '../../Button' | ||
import { ROUTES } from '../../../core/constants' | ||
import styles from './EncryptQR.scss' | ||
import FullHeightPanel from '../../Panel/FullHeightPanel' | ||
import CloseButton from '../../CloseButton' | ||
import BackButton from '../../BackButton' | ||
import ConfirmIcon from '../../../assets/icons/confirm.svg' | ||
import CopyIcon from '../../../assets/icons/copy.svg' | ||
import CheckIcon from '../../../assets/icons/check.svg' | ||
import AddIcon from '../../../assets/icons/add.svg' | ||
import withCopyCanvasToClipboard from '../../../hocs/withCopyCanvasToClipboard' | ||
|
||
type Props = { | ||
encryptedWIF: string, | ||
resetEncryptedWIF: Function, | ||
handleCopy: (?HTMLCanvasElement, string, ?boolean) => Promise<void>, | ||
handleCreateCanvas: (?HTMLCanvasElement, string) => any, | ||
copied: boolean, | ||
} | ||
|
||
class EncryptQR extends Component<Props> { | ||
encryptedCanvas: ?HTMLCanvasElement | ||
|
||
componentDidMount() { | ||
const { encryptedWIF } = this.props | ||
this.props.handleCreateCanvas(this.encryptedCanvas, encryptedWIF) | ||
} | ||
|
||
render() { | ||
const { resetEncryptedWIF } = this.props | ||
return ( | ||
<FullHeightPanel | ||
headerText="Encrypted QR Code" | ||
renderInstructions={false} | ||
headerContainerClassName={styles.headerIconMargin} | ||
renderHeaderIcon={() => <CheckIcon />} | ||
renderCloseButton={() => ( | ||
<div onClick={resetEncryptedWIF}> | ||
<CloseButton routeTo={ROUTES.SETTINGS} /> | ||
</div> | ||
)} | ||
renderBackButton={() => <BackButton routeTo={ROUTES.ENCRYPT} />} | ||
iconColor="#F7BC33" | ||
> | ||
<div | ||
id="encrypted-wif-qr-codes" | ||
className={styles.encryptedKeyContainer} | ||
> | ||
<div className={styles.qrContainer}> | ||
<div className={styles.qr}> | ||
<label> encrypted key </label> | ||
<canvas | ||
ref={node => { | ||
this.encryptedCanvas = node | ||
}} | ||
/> | ||
<Button | ||
className={styles.submitButton} | ||
renderIcon={() => | ||
this.props.copied ? <ConfirmIcon /> : <CopyIcon /> | ||
} | ||
type="submit" | ||
onClick={() => { | ||
this.props.handleCopy(this.encryptedCanvas, 'encrypted-wif') | ||
}} | ||
> | ||
Copy Code Image | ||
</Button> | ||
</div> | ||
</div> | ||
</div> | ||
<div className={styles.qrPrintButtonContainer}> | ||
<Button renderIcon={AddIcon} primary onClick={this.handlePrint}> | ||
</Button> | ||
</div> | ||
</FullHeightPanel> | ||
) | ||
} | ||
|
||
handlePrint = () => { | ||
window.print() | ||
} | ||
} | ||
|
||
export default withCopyCanvasToClipboard(EncryptQR) |
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,43 @@ | ||
.encryptedKeyContainer { | ||
display: flex; | ||
align-items: center; | ||
flex-direction: column; | ||
flex: 1; | ||
} | ||
|
||
.qrContainer { | ||
display: flex; | ||
justify-content: space-around; | ||
flex: 1; | ||
margin-top: 24px; | ||
width: 100%; | ||
|
||
.qr { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
} | ||
|
||
canvas { | ||
min-width: 200px; | ||
min-height: 200px; | ||
} | ||
|
||
button { | ||
margin-top: 12px; | ||
} | ||
|
||
label { | ||
font-weight: bold; | ||
font-size: 12px; | ||
text-transform: uppercase; | ||
opacity: var(--input-label-opacity); | ||
color: var(--input-label); | ||
margin-bottom: 10px; | ||
} | ||
} | ||
|
||
.qrPrintButtonContainer { | ||
margin-bottom: 50px; | ||
width: 490px; | ||
} |
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,25 @@ | ||
// @flow | ||
import { connect } from 'react-redux' | ||
import { bindActionCreators } from 'redux' | ||
|
||
import { | ||
getEncryptedWIF, | ||
resetEncryptedWIF, | ||
} from '../../../modules/generateEncryptedWIF' | ||
import EncryptQR from './EncryptQR' | ||
|
||
const mapStateToProps = (state: Object) => ({ | ||
encryptedWIF: getEncryptedWIF(state), | ||
}) | ||
|
||
const actionCreators = { | ||
resetEncryptedWIF, | ||
} | ||
|
||
const mapDispatchToProps = dispatch => | ||
bindActionCreators(actionCreators, dispatch) | ||
|
||
export default connect( | ||
mapStateToProps, | ||
mapDispatchToProps, | ||
)(EncryptQR) |
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.