From fc604324b14f01d8c2e7434d2382970ba52f75aa Mon Sep 17 00:00:00 2001 From: rocky-fleek Date: Mon, 8 Aug 2022 11:59:16 +0200 Subject: [PATCH 01/12] Fixed spacing on network creation. Fixed placeholders and title. Made status dot green --- .../Popup/Views/NetworkCreation/constants.js | 3 -- source/Popup/Views/NetworkCreation/index.jsx | 38 ++++++++++--------- source/Popup/Views/NetworkCreation/styles.js | 11 ++++-- .../components/ConnectionControls/index.jsx | 2 +- .../components/ConnectionControls/styles.js | 7 ---- source/locales/en/translation.json | 3 ++ 6 files changed, 31 insertions(+), 33 deletions(-) diff --git a/source/Popup/Views/NetworkCreation/constants.js b/source/Popup/Views/NetworkCreation/constants.js index 8490707e..101726e7 100644 --- a/source/Popup/Views/NetworkCreation/constants.js +++ b/source/Popup/Views/NetworkCreation/constants.js @@ -19,21 +19,18 @@ export const NETWORK_CREATION_DEFAULT_VALUES = { export const NETWORK_CREATION_FIELDS = { name: { name: 'name', - placeholder: 'Enter a name for the network', required: true, validate: (value, networks) => requiredValidation(value) || uniqueValidation(value, networks, 'name'), }, host: { name: 'host', - placeholder: 'Enter the host of the network', required: true, validate: (value, networks) => requiredValidation(value) || uniqueValidation(value, networks, 'host'), }, ledgerCanisterId: { name: 'ledgerCanisterId', - placeholder: 'Enter the ledger canister ID of the network', required: false, validate: canisterIdValidation, }, diff --git a/source/Popup/Views/NetworkCreation/index.jsx b/source/Popup/Views/NetworkCreation/index.jsx index 669790ed..49b2b881 100644 --- a/source/Popup/Views/NetworkCreation/index.jsx +++ b/source/Popup/Views/NetworkCreation/index.jsx @@ -53,33 +53,35 @@ const NetworkCreation = () => { setErrors(newErrors); } else { dispatch(addNetwork(values)); - navigator.navigate('network'); + navigator.navigate('home'); } }; return (
{t('network.network')}} + center={{t('network.addNetwork')}} left={} right={ navigator.navigate('home')} />} />
- {Object.values(NETWORK_CREATION_FIELDS).map((field) => ( -
- - {`${t(`network.${field.name}`)}${field.required ? '*' : ''}`} - - - {errors[field.name] && {errors[field.name]}} -
- ))} +
+ {Object.values(NETWORK_CREATION_FIELDS).map((field) => ( +
+ + {`${t(`network.${field.name}`)}${field.required ? '*' : ''}`} + + + {errors[field.name] && {errors[field.name]}} +
+ ))} +
) : ( -
reload diff --git a/source/components/ConnectionStatus/components/ConnectionControls/styles.js b/source/components/ConnectionStatus/components/ConnectionControls/styles.js index 8b024ebe..403a16e9 100644 --- a/source/components/ConnectionStatus/components/ConnectionControls/styles.js +++ b/source/components/ConnectionStatus/components/ConnectionControls/styles.js @@ -68,4 +68,15 @@ export default makeStyles(() => ({ opacity: 0.5, pointer: 'arrow', }, + '@keyframes rotate': { + '0%': { + transform: 'rotate(0deg)', + }, + '100%': { + transform: 'rotate(360deg)', + }, + }, + loading: { + animation: '$rotate 1s infinite linear', + }, })); diff --git a/source/components/ConnectionStatus/components/NetworkSelector/index.jsx b/source/components/ConnectionStatus/components/NetworkSelector/index.jsx index a72e06fa..0e1e977b 100644 --- a/source/components/ConnectionStatus/components/NetworkSelector/index.jsx +++ b/source/components/ConnectionStatus/components/NetworkSelector/index.jsx @@ -15,6 +15,10 @@ const NetworkSelector = ({ onClose, refreshWallet }) => { const { t } = useTranslation(); const { networks } = useSelector((state) => state.network); const { navigator } = useRouter(); + const handleNetworkClick = () => { + refreshWallet(); + onClose?.(); + }; return ( <>
@@ -32,7 +36,7 @@ const NetworkSelector = ({ onClose, refreshWallet }) => { ))}
diff --git a/source/components/Profile/index.jsx b/source/components/Profile/index.jsx index 54621bd1..b9e30840 100644 --- a/source/components/Profile/index.jsx +++ b/source/components/Profile/index.jsx @@ -21,7 +21,6 @@ import { setAssetsLoading, setCollections, setTransactions, - setTransactionsLoading, } from '@redux/wallet'; import BluePencil from '@assets/icons/blue-pencil.svg'; import VisibleIcon from '@assets/icons/visible.svg'; @@ -131,7 +130,6 @@ const Profile = ({ disableProfile }) => { dispatch(setICNSData(newWallet.icnsData)); dispatch(setAssetsLoading(true)); dispatch(setTransactions([])); - dispatch(setTransactionsLoading(true)); sendMessage({ type: HANDLER_TYPES.GET_ICNS_DATA, params: { refresh: true }, diff --git a/source/redux/wallet.js b/source/redux/wallet.js index c1ccf202..34bd7764 100644 --- a/source/redux/wallet.js +++ b/source/redux/wallet.js @@ -29,7 +29,7 @@ export const walletSlice = createSlice({ assetsLoading: true, collections: [], collectionsLoading: false, - transactionsLoading: true, + transactionsLoading: false, }, reducers: { updateWalletDetails: (state, action) => { From 5f019801371039f2faebdc5ea41e318910e4a039 Mon Sep 17 00:00:00 2001 From: tomiir Date: Thu, 11 Aug 2022 19:06:58 +0200 Subject: [PATCH 12/12] Fix: custom network off msg for non-icp tokens (#539) * Added valid url validation * Installed controller 0.19.7 with activity performance improvements * Fixed error message for non-icp tokens when custom network is down Co-authored-by: rocky-fleek --- source/ui/AssetItem/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ui/AssetItem/index.jsx b/source/ui/AssetItem/index.jsx index f30475b1..e16247e3 100644 --- a/source/ui/AssetItem/index.jsx +++ b/source/ui/AssetItem/index.jsx @@ -39,7 +39,7 @@ const AssetItem = ({ <> {name} - {t(`tokens.${ledgerNotSpecified ? 'ledgerNotSpecified' : 'failedToFetchBalance'}`)} + {t(`tokens.${ledgerNotSpecified && name === 'ICP' ? 'ledgerNotSpecified' : 'failedToFetchBalance'}`)} )