-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #316 from buberdds/mz/newExtWarning
Warn about not storing mnemonic in next version
- Loading branch information
Showing
14 changed files
with
183 additions
and
6 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,36 @@ | ||
import differenceInDays from 'date-fns/differenceInDays'; | ||
import { NEW_EXTENSION_RELEASE_DATE } from '../../../../config'; | ||
import warningIconSrc from '../../../assets/images/warning.svg'; | ||
import { getLanguage } from '../../../i18n'; | ||
import { DISMISSED_NEW_EXTENSION_WARNING } from '../../../constant/storageKey'; | ||
import { saveLocal } from '../../../background/storage/localStorage'; | ||
import './index.scss'; | ||
|
||
const canDismiss = NEW_EXTENSION_RELEASE_DATE | ||
? differenceInDays(new Date(NEW_EXTENSION_RELEASE_DATE), new Date()) > 3 | ||
: true; | ||
|
||
export const NewExtensionWarning = (props) => { | ||
const handleClick = () => { | ||
saveLocal(DISMISSED_NEW_EXTENSION_WARNING, new Date().toISOString()); | ||
props.handleClick(); | ||
}; | ||
|
||
return ( | ||
<div className="indicator"> | ||
<div> | ||
<img src={warningIconSrc} alt={getLanguage('warning')} /> | ||
</div> | ||
<div className="indicator-content"> | ||
{getLanguage('newExtensionNotice')} | ||
{canDismiss && ( | ||
<div> | ||
<button className="indicator-reminder" onClick={handleClick}> | ||
{getLanguage('remindMe')} | ||
</button> | ||
</div> | ||
)} | ||
</div> | ||
</div> | ||
); | ||
}; |
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,26 @@ | ||
.indicator { | ||
display: flex; | ||
padding: 10px 5px; | ||
justify-content: center; | ||
align-items: flex-start; | ||
gap: 10px; | ||
background: #fcf1d0; | ||
|
||
&-content { | ||
color: #06152b; | ||
font-size: 14px; | ||
font-style: normal; | ||
font-weight: 500; | ||
line-height: 125%; | ||
} | ||
|
||
&-reminder { | ||
background-color: transparent; | ||
border: 0; | ||
padding: 0; | ||
margin: 0; | ||
cursor: pointer; | ||
font: inherit; | ||
color: #0092f6; | ||
} | ||
} |
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