forked from brave/browser-laptop
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes backup keys export/import; improves print flow
Resolves brave#13274 Auditors: Test Plan:
- Loading branch information
Showing
11 changed files
with
149 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!DOCTYPE html> | ||
<!-- This Source Code Form is subject to the terms of the Mozilla Public | ||
- License, v. 2.0. If a copy of the MPL was not distributed with this | ||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. --> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="availableLanguages" content=""> | ||
<meta name="defaultLanguage" content="en-US"> | ||
<meta name='theme-color' content='#ff5000'> | ||
<meta name="referrer" content="no-referrer"> | ||
<link rel="shortcut icon"type="image/x-icon" href="img/favicon.ico"> | ||
<title data-l10n-id="printKeysTitle"></title> | ||
<script src="ext/l20n.min.js"></script> | ||
<script src="gen/aboutPages.entry.js" async></script> | ||
<link rel="localization" href="locales/{locale}/app.properties"> | ||
</head> | ||
<body> | ||
<div id="appContainer"/> | ||
</body> | ||
</html> |
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 |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
const React = require('react') | ||
const format = require('date-fns/format') | ||
const {StyleSheet, css} = require('aphrodite/no-important') | ||
const ipc = window.chrome.ipcRenderer | ||
|
||
// Constants | ||
const messages = require('../../../../js/constants/messages') | ||
|
||
class PrintKeys extends React.Component { | ||
constructor (props) { | ||
super(props) | ||
this.state = { | ||
passphrase: '' | ||
} | ||
|
||
ipc.on(messages.PRINTKEYS_UPDATED, (e, detail) => { | ||
if (detail) { | ||
this.setState({ | ||
passphrase: detail && detail.passphrase | ||
}) | ||
} | ||
}) | ||
} | ||
|
||
componentDidUpdate (prevProps, prevState) { | ||
if (prevState.passphrase !== this.state.passphrase) { | ||
setTimeout(() => { | ||
window.print() | ||
}, 500) | ||
} | ||
} | ||
|
||
render () { | ||
const date = format(new Date(), 'MM/DD/YYYY') | ||
|
||
return <div className={css(styles.content)}> | ||
<div data-l10n-id='ledgerBackupText1' /> | ||
<div> | ||
<span data-l10n-id='ledgerBackupText2' /> {date} | ||
</div> | ||
<br /> | ||
<div> | ||
<span data-l10n-id='ledgerBackupText4' /> <b>{this.state.passphrase}</b> | ||
</div> | ||
<br /> | ||
<div data-l10n-id='ledgerBackupText5' /> | ||
</div> | ||
} | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
content: { | ||
fontWeight: '400', | ||
color: '#3b3b3b', | ||
fontSize: '16px' | ||
} | ||
}) | ||
|
||
module.exports = <PrintKeys /> |
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