From 6d2cdce202923b72faad59a77911edbfaf0617e2 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Thu, 14 Dec 2017 21:20:14 +0300 Subject: [PATCH] close modals on esc or overlay click --- react/src/components/addcoin/addcoin.js | 6 ++- .../src/components/addcoin/addcoin.render.js | 6 +++ react/src/components/addcoin/addcoin.scss | 35 ------------- .../claimInterestModal.render.js | 6 +++ .../coindDownModal/coindDownModal.render.js | 6 +++ .../importKeyModal/importKeyModal.render.js | 6 +++ .../invoiceModal/invoiceModal.render.js | 6 +++ .../loginSettingsModal.render.js | 6 +++ .../dashboard/navbar/navbar.render.js | 5 ++ .../dashboard/qrModal/qrModal.render.js | 6 +++ .../walletsTxInfo/walletsTxInfo.render.js | 6 +++ .../zcparamsFetchModal.render.js | 6 +++ react/src/components/main/walletMain.js | 52 +++++++++++++++++++ react/src/components/overrides.scss | 46 ++++++++++++++++ react/src/store.js | 3 -- 15 files changed, 161 insertions(+), 40 deletions(-) diff --git a/react/src/components/addcoin/addcoin.js b/react/src/components/addcoin/addcoin.js index e9adb62..d2d2d6a 100644 --- a/react/src/components/addcoin/addcoin.js +++ b/react/src/components/addcoin/addcoin.js @@ -181,14 +181,15 @@ class AddCoin extends React.Component { src={ `/assets/images/cryptologo/${option.icon.toLowerCase()}.png` } alt={ option.label } width="30px" - height="30px"/> + height="30px" /> { option.label } ); } updateSelectedCoin(e, index) { - if (e.value && + if (e && + e.value && e.value.indexOf('|')) { const coin = e.value.split('|'); const defaultMode = coin[1]; @@ -242,6 +243,7 @@ class AddCoin extends React.Component { } handleKeydown(e) { + console.warn(e); if (e.key === 'Escape') { this.dismiss(); } diff --git a/react/src/components/addcoin/addcoin.render.js b/react/src/components/addcoin/addcoin.render.js index d2fcd65..ed08b9b 100644 --- a/react/src/components/addcoin/addcoin.render.js +++ b/react/src/components/addcoin/addcoin.render.js @@ -7,7 +7,13 @@ const AddCoinRender = function() { return (
this.handleKeydown(event) }>
+
+