Add ignore wallet suggestion button
This commit is contained in:
parent
4b9bd7009b
commit
4b555ff0cb
21
src/App.js
21
src/App.js
|
@ -85,13 +85,21 @@ function PageContents() {
|
||||||
const wallet = useWallet();
|
const wallet = useWallet();
|
||||||
const [page] = usePage();
|
const [page] = usePage();
|
||||||
const [showWalletSuggestion, setShowWalletSuggestion] = useState(true);
|
const [showWalletSuggestion, setShowWalletSuggestion] = useState(true);
|
||||||
|
const suggestionKey = 'private-irgnore-wallet-suggestion';
|
||||||
|
const ignoreSuggestion = window.localStorage.getItem(suggestionKey);
|
||||||
if (!wallet) {
|
if (!wallet) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<WalletSuggestionDialog
|
{!ignoreSuggestion && (
|
||||||
open={showWalletSuggestion}
|
<WalletSuggestionDialog
|
||||||
onClose={() => setShowWalletSuggestion(false)}
|
open={showWalletSuggestion}
|
||||||
/>
|
onClose={() => setShowWalletSuggestion(false)}
|
||||||
|
onIgnore={() => {
|
||||||
|
window.localStorage.setItem(suggestionKey, true);
|
||||||
|
setShowWalletSuggestion(false);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
<LoginPage />
|
<LoginPage />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
@ -116,7 +124,7 @@ const useStyles = makeStyles(() => ({
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
function WalletSuggestionDialog({ open, onClose }) {
|
function WalletSuggestionDialog({ open, onClose, onIgnore }) {
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
return (
|
return (
|
||||||
<DialogForm open={open} onClose={onClose} fullWidth>
|
<DialogForm open={open} onClose={onClose} fullWidth>
|
||||||
|
@ -202,6 +210,9 @@ function WalletSuggestionDialog({ open, onClose }) {
|
||||||
</List>
|
</List>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
|
<Button type="submit" color="primary" onClick={onIgnore}>
|
||||||
|
Ignore Future Dialog
|
||||||
|
</Button>
|
||||||
<Button type="submit" color="primary" onClick={onClose}>
|
<Button type="submit" color="primary" onClick={onClose}>
|
||||||
Ok
|
Ok
|
||||||
</Button>
|
</Button>
|
||||||
|
|
Loading…
Reference in New Issue