From 1f13e0b6d8148331d9f5b41a78fa0e0ae60b8da1 Mon Sep 17 00:00:00 2001 From: feruz Date: Wed, 3 Mar 2021 14:15:49 +0200 Subject: [PATCH] wallet improvements --- src/components/wallet/view/walletView.js | 6 +++--- src/constants/options/points.js | 4 ++-- src/containers/index.js | 4 ++-- src/containers/transferContainer.js | 4 +++- ...mWalletContainer.js => walletContainer.js} | 20 +++++++++---------- .../application/screen/applicationScreen.js | 2 +- src/screens/wallet/screen/btcView.js | 6 +++--- src/screens/wallet/screen/sbdView.js | 6 +++--- src/screens/wallet/screen/spView.js | 6 +++--- src/screens/wallet/screen/steemView.js | 6 +++--- src/screens/wallet/screen/walletScreen.js | 3 ++- .../wallet/screen/walletScreenStyles.js | 3 +++ 12 files changed, 38 insertions(+), 32 deletions(-) rename src/containers/{steemWalletContainer.js => walletContainer.js} (95%) diff --git a/src/components/wallet/view/walletView.js b/src/components/wallet/view/walletView.js index 1288b5dff..963cf1e60 100644 --- a/src/components/wallet/view/walletView.js +++ b/src/components/wallet/view/walletView.js @@ -9,7 +9,7 @@ import { MainButton } from '../../mainButton'; import { CollapsibleCard } from '../../collapsibleCard'; import { WalletDetails } from '../../walletDetails'; import { WalletDetailsPlaceHolder } from '../../basicUIElements'; -import { ThemeContainer, SteemWalletContainer } from '../../../containers'; +import { ThemeContainer, WalletContainer } from '../../../containers'; // Styles import styles from './walletStyles'; @@ -32,7 +32,7 @@ const WalletView = ({ setEstimatedWalletValue, selectedUser, handleOnScroll }) = ); return ( - )} - + ); }; diff --git a/src/constants/options/points.js b/src/constants/options/points.js index 035f38ed7..f4327526b 100644 --- a/src/constants/options/points.js +++ b/src/constants/options/points.js @@ -29,7 +29,7 @@ export default { nameKey: 'wallet.delegation', descriptionKey: 'wallet.delegation_desc', iconType: 'MaterialCommunityIcons', - point: 5, + point: 10, }, 100: { icon: 'pencil-outline', @@ -77,7 +77,7 @@ export default { nameKey: 'wallet.login', descriptionKey: 'wallet.login_desc', iconType: 'MaterialIcons', - point: 100, + point: 10, }, 30: { icon: 'check-all', diff --git a/src/containers/index.js b/src/containers/index.js index abe7bdab2..7f31e9a33 100644 --- a/src/containers/index.js +++ b/src/containers/index.js @@ -6,7 +6,7 @@ import ProfileContainer from './profileContainer'; import ProfileEditContainer from './profileEditContainer'; import RedeemContainer from './redeemContainer'; import SpinGameContainer from './spinGameContainer'; -import SteemWalletContainer from './steemWalletContainer'; +import WalletContainer from './walletContainer'; import ThemeContainer from './themeContainer'; import TransferContainer from './transferContainer'; @@ -19,7 +19,7 @@ export { ProfileEditContainer, RedeemContainer, SpinGameContainer, - SteemWalletContainer, + WalletContainer, ThemeContainer, TransferContainer, }; diff --git a/src/containers/transferContainer.js b/src/containers/transferContainer.js index 8c342bb08..35b319a93 100644 --- a/src/containers/transferContainer.js +++ b/src/containers/transferContainer.js @@ -23,6 +23,7 @@ import { getUser } from '../providers/ecency/ePoint'; // Utils import { countDecimals } from '../utils/number'; +import bugsnag from '../config/bugsnag'; /* * Props Name Description Value @@ -195,7 +196,8 @@ class TransferContainer extends Component { }) .catch((err) => { navigation.goBack(); - dispatch(toastNotification(err.message)); + bugsnag.notify(err); + dispatch(toastNotification(intl.formatMessage({ id: 'alert.key_warning' }))); }); }; diff --git a/src/containers/steemWalletContainer.js b/src/containers/walletContainer.js similarity index 95% rename from src/containers/steemWalletContainer.js rename to src/containers/walletContainer.js index c6e3e3755..b923df5a8 100644 --- a/src/containers/steemWalletContainer.js +++ b/src/containers/walletContainer.js @@ -21,12 +21,12 @@ import { getEstimatedAmount } from '../utils/vote'; // Constants import ROUTES from '../constants/routeNames'; -const STEEM_DROPDOWN = ['purchase_estm', 'transfer_token', 'transfer_to_saving', 'powerUp']; +const HIVE_DROPDOWN = ['purchase_estm', 'transfer_token', 'transfer_to_saving', 'powerUp']; const BTC_DROPDOWN = ['transfer_token']; -const SBD_DROPDOWN = ['purchase_estm', 'transfer_token', 'transfer_to_saving', 'convert']; -const SAVING_STEEM_DROPDOWN = ['withdraw_steem']; -const SAVING_SBD_DROPDOWN = ['withdraw_sbd']; -const STEEM_POWER_DROPDOWN = ['delegate', 'power_down']; +const HBD_DROPDOWN = ['purchase_estm', 'transfer_token', 'transfer_to_saving', 'convert']; +const SAVING_HIVE_DROPDOWN = ['withdraw_steem']; +const SAVING_HBD_DROPDOWN = ['withdraw_sbd']; +const HIVE_POWER_DROPDOWN = ['delegate', 'power_down']; const WalletContainer = ({ children, @@ -302,12 +302,12 @@ const WalletContainer = ({ estimatedSpValue, delegationsAmount, navigate: _navigate, - steemDropdown: STEEM_DROPDOWN, - sbdDropdown: SBD_DROPDOWN, + steemDropdown: HIVE_DROPDOWN, + sbdDropdown: HBD_DROPDOWN, btcDropdown: BTC_DROPDOWN, - savingSteemDropdown: SAVING_STEEM_DROPDOWN, - savingSbdDropdown: SAVING_SBD_DROPDOWN, - steemPowerDropdown: STEEM_POWER_DROPDOWN, + savingSteemDropdown: SAVING_HIVE_DROPDOWN, + savingSbdDropdown: SAVING_HBD_DROPDOWN, + steemPowerDropdown: HIVE_POWER_DROPDOWN, unclaimedBalance: unclaimedBalance && unclaimedBalance.trim(), estimatedAmount, }) diff --git a/src/screens/application/screen/applicationScreen.js b/src/screens/application/screen/applicationScreen.js index 7b197ca64..d8d52f19f 100644 --- a/src/screens/application/screen/applicationScreen.js +++ b/src/screens/application/screen/applicationScreen.js @@ -150,7 +150,7 @@ class ApplicationScreen extends Component { {isShowToastNotification && ( )} diff --git a/src/screens/wallet/screen/btcView.js b/src/screens/wallet/screen/btcView.js index ca9cab4d5..d71d46ccd 100644 --- a/src/screens/wallet/screen/btcView.js +++ b/src/screens/wallet/screen/btcView.js @@ -2,7 +2,7 @@ import React from 'react'; import { View } from 'react-native'; import { WalletHeader, FormattedCurrency } from '../../../components'; -import { SteemWalletContainer, AccountContainer } from '../../../containers'; +import { WalletContainer, AccountContainer } from '../../../containers'; import globalStyles from '../../../globalStyles'; @@ -10,7 +10,7 @@ const BtcView = ({ handleOnSelected, index, currentIndex, refreshing: reload }) {({ currentAccount }) => ( - + {({ isClaiming, claimRewardBalance, @@ -50,7 +50,7 @@ const BtcView = ({ handleOnSelected, index, currentIndex, refreshing: reload }) ]} /> )} - + )} diff --git a/src/screens/wallet/screen/sbdView.js b/src/screens/wallet/screen/sbdView.js index e1c14a61c..7e8b835de 100644 --- a/src/screens/wallet/screen/sbdView.js +++ b/src/screens/wallet/screen/sbdView.js @@ -2,7 +2,7 @@ import React from 'react'; import { View } from 'react-native'; import { WalletHeader, FormattedCurrency } from '../../../components'; -import { SteemWalletContainer, AccountContainer } from '../../../containers'; +import { WalletContainer, AccountContainer } from '../../../containers'; import globalStyles from '../../../globalStyles'; @@ -10,7 +10,7 @@ const SbdView = ({ handleOnSelected, index, currentIndex, refreshing: reload }) {({ currentAccount }) => ( - + {({ isClaiming, claimRewardBalance, @@ -52,7 +52,7 @@ const SbdView = ({ handleOnSelected, index, currentIndex, refreshing: reload }) ]} /> )} - + )} diff --git a/src/screens/wallet/screen/spView.js b/src/screens/wallet/screen/spView.js index 42e23987e..bf29217ec 100644 --- a/src/screens/wallet/screen/spView.js +++ b/src/screens/wallet/screen/spView.js @@ -2,7 +2,7 @@ import React from 'react'; import { View, Text } from 'react-native'; import { WalletHeader, FormattedCurrency } from '../../../components'; -import { SteemWalletContainer, AccountContainer } from '../../../containers'; +import { WalletContainer, AccountContainer } from '../../../containers'; import globalStyles from '../../../globalStyles'; @@ -10,7 +10,7 @@ const SpView = ({ handleOnSelected, index, currentIndex, refreshing: reload }) = {({ currentAccount }) => ( - + {({ isClaiming, claimRewardBalance, @@ -66,7 +66,7 @@ const SpView = ({ handleOnSelected, index, currentIndex, refreshing: reload }) = ]} /> )} - + )} diff --git a/src/screens/wallet/screen/steemView.js b/src/screens/wallet/screen/steemView.js index e95d190ef..4c720aa70 100644 --- a/src/screens/wallet/screen/steemView.js +++ b/src/screens/wallet/screen/steemView.js @@ -2,7 +2,7 @@ import React from 'react'; import { View } from 'react-native'; import { WalletHeader, FormattedCurrency } from '../../../components'; -import { SteemWalletContainer, AccountContainer } from '../../../containers'; +import { WalletContainer, AccountContainer } from '../../../containers'; import globalStyles from '../../../globalStyles'; @@ -10,7 +10,7 @@ const SteemView = ({ handleOnSelected, index, currentIndex, refreshing: reload } {({ currentAccount }) => ( - + {({ isClaiming, claimRewardBalance, @@ -56,7 +56,7 @@ const SteemView = ({ handleOnSelected, index, currentIndex, refreshing: reload } ]} /> )} - + )} diff --git a/src/screens/wallet/screen/walletScreen.js b/src/screens/wallet/screen/walletScreen.js index 7780d597f..004e8f02c 100644 --- a/src/screens/wallet/screen/walletScreen.js +++ b/src/screens/wallet/screen/walletScreen.js @@ -50,9 +50,10 @@ const WalletScreen = () => { <> setCurrentIndex(index)} >