wallet improvements

This commit is contained in:
feruz 2021-03-03 14:15:49 +02:00
parent 8b1d77ddfb
commit 1f13e0b6d8
12 changed files with 38 additions and 32 deletions

View File

@ -9,7 +9,7 @@ import { MainButton } from '../../mainButton';
import { CollapsibleCard } from '../../collapsibleCard'; import { CollapsibleCard } from '../../collapsibleCard';
import { WalletDetails } from '../../walletDetails'; import { WalletDetails } from '../../walletDetails';
import { WalletDetailsPlaceHolder } from '../../basicUIElements'; import { WalletDetailsPlaceHolder } from '../../basicUIElements';
import { ThemeContainer, SteemWalletContainer } from '../../../containers'; import { ThemeContainer, WalletContainer } from '../../../containers';
// Styles // Styles
import styles from './walletStyles'; import styles from './walletStyles';
@ -32,7 +32,7 @@ const WalletView = ({ setEstimatedWalletValue, selectedUser, handleOnScroll }) =
); );
return ( return (
<SteemWalletContainer <WalletContainer
setEstimatedWalletValue={setEstimatedWalletValue} setEstimatedWalletValue={setEstimatedWalletValue}
selectedUser={selectedUser} selectedUser={selectedUser}
handleOnScroll={handleOnScroll} handleOnScroll={handleOnScroll}
@ -115,7 +115,7 @@ const WalletView = ({ setEstimatedWalletValue, selectedUser, handleOnScroll }) =
)} )}
</ThemeContainer> </ThemeContainer>
)} )}
</SteemWalletContainer> </WalletContainer>
); );
}; };

View File

@ -29,7 +29,7 @@ export default {
nameKey: 'wallet.delegation', nameKey: 'wallet.delegation',
descriptionKey: 'wallet.delegation_desc', descriptionKey: 'wallet.delegation_desc',
iconType: 'MaterialCommunityIcons', iconType: 'MaterialCommunityIcons',
point: 5, point: 10,
}, },
100: { 100: {
icon: 'pencil-outline', icon: 'pencil-outline',
@ -77,7 +77,7 @@ export default {
nameKey: 'wallet.login', nameKey: 'wallet.login',
descriptionKey: 'wallet.login_desc', descriptionKey: 'wallet.login_desc',
iconType: 'MaterialIcons', iconType: 'MaterialIcons',
point: 100, point: 10,
}, },
30: { 30: {
icon: 'check-all', icon: 'check-all',

View File

@ -6,7 +6,7 @@ import ProfileContainer from './profileContainer';
import ProfileEditContainer from './profileEditContainer'; import ProfileEditContainer from './profileEditContainer';
import RedeemContainer from './redeemContainer'; import RedeemContainer from './redeemContainer';
import SpinGameContainer from './spinGameContainer'; import SpinGameContainer from './spinGameContainer';
import SteemWalletContainer from './steemWalletContainer'; import WalletContainer from './walletContainer';
import ThemeContainer from './themeContainer'; import ThemeContainer from './themeContainer';
import TransferContainer from './transferContainer'; import TransferContainer from './transferContainer';
@ -19,7 +19,7 @@ export {
ProfileEditContainer, ProfileEditContainer,
RedeemContainer, RedeemContainer,
SpinGameContainer, SpinGameContainer,
SteemWalletContainer, WalletContainer,
ThemeContainer, ThemeContainer,
TransferContainer, TransferContainer,
}; };

View File

@ -23,6 +23,7 @@ import { getUser } from '../providers/ecency/ePoint';
// Utils // Utils
import { countDecimals } from '../utils/number'; import { countDecimals } from '../utils/number';
import bugsnag from '../config/bugsnag';
/* /*
* Props Name Description Value * Props Name Description Value
@ -195,7 +196,8 @@ class TransferContainer extends Component {
}) })
.catch((err) => { .catch((err) => {
navigation.goBack(); navigation.goBack();
dispatch(toastNotification(err.message)); bugsnag.notify(err);
dispatch(toastNotification(intl.formatMessage({ id: 'alert.key_warning' })));
}); });
}; };

View File

@ -21,12 +21,12 @@ import { getEstimatedAmount } from '../utils/vote';
// Constants // Constants
import ROUTES from '../constants/routeNames'; 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 BTC_DROPDOWN = ['transfer_token'];
const SBD_DROPDOWN = ['purchase_estm', 'transfer_token', 'transfer_to_saving', 'convert']; const HBD_DROPDOWN = ['purchase_estm', 'transfer_token', 'transfer_to_saving', 'convert'];
const SAVING_STEEM_DROPDOWN = ['withdraw_steem']; const SAVING_HIVE_DROPDOWN = ['withdraw_steem'];
const SAVING_SBD_DROPDOWN = ['withdraw_sbd']; const SAVING_HBD_DROPDOWN = ['withdraw_sbd'];
const STEEM_POWER_DROPDOWN = ['delegate', 'power_down']; const HIVE_POWER_DROPDOWN = ['delegate', 'power_down'];
const WalletContainer = ({ const WalletContainer = ({
children, children,
@ -302,12 +302,12 @@ const WalletContainer = ({
estimatedSpValue, estimatedSpValue,
delegationsAmount, delegationsAmount,
navigate: _navigate, navigate: _navigate,
steemDropdown: STEEM_DROPDOWN, steemDropdown: HIVE_DROPDOWN,
sbdDropdown: SBD_DROPDOWN, sbdDropdown: HBD_DROPDOWN,
btcDropdown: BTC_DROPDOWN, btcDropdown: BTC_DROPDOWN,
savingSteemDropdown: SAVING_STEEM_DROPDOWN, savingSteemDropdown: SAVING_HIVE_DROPDOWN,
savingSbdDropdown: SAVING_SBD_DROPDOWN, savingSbdDropdown: SAVING_HBD_DROPDOWN,
steemPowerDropdown: STEEM_POWER_DROPDOWN, steemPowerDropdown: HIVE_POWER_DROPDOWN,
unclaimedBalance: unclaimedBalance && unclaimedBalance.trim(), unclaimedBalance: unclaimedBalance && unclaimedBalance.trim(),
estimatedAmount, estimatedAmount,
}) })

View File

@ -150,7 +150,7 @@ class ApplicationScreen extends Component {
{isShowToastNotification && ( {isShowToastNotification && (
<ToastNotification <ToastNotification
text={toastNotification} text={toastNotification}
duration={3000} duration={4000}
onHide={this._handleOnHideToastNotification} onHide={this._handleOnHideToastNotification}
/> />
)} )}

View File

@ -2,7 +2,7 @@ import React from 'react';
import { View } from 'react-native'; import { View } from 'react-native';
import { WalletHeader, FormattedCurrency } from '../../../components'; import { WalletHeader, FormattedCurrency } from '../../../components';
import { SteemWalletContainer, AccountContainer } from '../../../containers'; import { WalletContainer, AccountContainer } from '../../../containers';
import globalStyles from '../../../globalStyles'; import globalStyles from '../../../globalStyles';
@ -10,7 +10,7 @@ const BtcView = ({ handleOnSelected, index, currentIndex, refreshing: reload })
<View style={globalStyles.swipeItemWrapper}> <View style={globalStyles.swipeItemWrapper}>
<AccountContainer> <AccountContainer>
{({ currentAccount }) => ( {({ currentAccount }) => (
<SteemWalletContainer selectedUser={currentAccount}> <WalletContainer selectedUser={currentAccount}>
{({ {({
isClaiming, isClaiming,
claimRewardBalance, claimRewardBalance,
@ -50,7 +50,7 @@ const BtcView = ({ handleOnSelected, index, currentIndex, refreshing: reload })
]} ]}
/> />
)} )}
</SteemWalletContainer> </WalletContainer>
)} )}
</AccountContainer> </AccountContainer>
</View> </View>

View File

@ -2,7 +2,7 @@ import React from 'react';
import { View } from 'react-native'; import { View } from 'react-native';
import { WalletHeader, FormattedCurrency } from '../../../components'; import { WalletHeader, FormattedCurrency } from '../../../components';
import { SteemWalletContainer, AccountContainer } from '../../../containers'; import { WalletContainer, AccountContainer } from '../../../containers';
import globalStyles from '../../../globalStyles'; import globalStyles from '../../../globalStyles';
@ -10,7 +10,7 @@ const SbdView = ({ handleOnSelected, index, currentIndex, refreshing: reload })
<View style={globalStyles.swipeItemWrapper}> <View style={globalStyles.swipeItemWrapper}>
<AccountContainer> <AccountContainer>
{({ currentAccount }) => ( {({ currentAccount }) => (
<SteemWalletContainer selectedUser={currentAccount}> <WalletContainer selectedUser={currentAccount}>
{({ {({
isClaiming, isClaiming,
claimRewardBalance, claimRewardBalance,
@ -52,7 +52,7 @@ const SbdView = ({ handleOnSelected, index, currentIndex, refreshing: reload })
]} ]}
/> />
)} )}
</SteemWalletContainer> </WalletContainer>
)} )}
</AccountContainer> </AccountContainer>
</View> </View>

View File

@ -2,7 +2,7 @@ import React from 'react';
import { View, Text } from 'react-native'; import { View, Text } from 'react-native';
import { WalletHeader, FormattedCurrency } from '../../../components'; import { WalletHeader, FormattedCurrency } from '../../../components';
import { SteemWalletContainer, AccountContainer } from '../../../containers'; import { WalletContainer, AccountContainer } from '../../../containers';
import globalStyles from '../../../globalStyles'; import globalStyles from '../../../globalStyles';
@ -10,7 +10,7 @@ const SpView = ({ handleOnSelected, index, currentIndex, refreshing: reload }) =
<View style={globalStyles.swipeItemWrapper}> <View style={globalStyles.swipeItemWrapper}>
<AccountContainer> <AccountContainer>
{({ currentAccount }) => ( {({ currentAccount }) => (
<SteemWalletContainer selectedUser={currentAccount}> <WalletContainer selectedUser={currentAccount}>
{({ {({
isClaiming, isClaiming,
claimRewardBalance, claimRewardBalance,
@ -66,7 +66,7 @@ const SpView = ({ handleOnSelected, index, currentIndex, refreshing: reload }) =
]} ]}
/> />
)} )}
</SteemWalletContainer> </WalletContainer>
)} )}
</AccountContainer> </AccountContainer>
</View> </View>

View File

@ -2,7 +2,7 @@ import React from 'react';
import { View } from 'react-native'; import { View } from 'react-native';
import { WalletHeader, FormattedCurrency } from '../../../components'; import { WalletHeader, FormattedCurrency } from '../../../components';
import { SteemWalletContainer, AccountContainer } from '../../../containers'; import { WalletContainer, AccountContainer } from '../../../containers';
import globalStyles from '../../../globalStyles'; import globalStyles from '../../../globalStyles';
@ -10,7 +10,7 @@ const SteemView = ({ handleOnSelected, index, currentIndex, refreshing: reload }
<View style={globalStyles.swipeItemWrapper}> <View style={globalStyles.swipeItemWrapper}>
<AccountContainer> <AccountContainer>
{({ currentAccount }) => ( {({ currentAccount }) => (
<SteemWalletContainer selectedUser={currentAccount}> <WalletContainer selectedUser={currentAccount}>
{({ {({
isClaiming, isClaiming,
claimRewardBalance, claimRewardBalance,
@ -56,7 +56,7 @@ const SteemView = ({ handleOnSelected, index, currentIndex, refreshing: reload }
]} ]}
/> />
)} )}
</SteemWalletContainer> </WalletContainer>
)} )}
</AccountContainer> </AccountContainer>
</View> </View>

View File

@ -50,9 +50,10 @@ const WalletScreen = () => {
<> <>
<Animated.View style={[styles.header, { height: headerHeight }]}> <Animated.View style={[styles.header, { height: headerHeight }]}>
<Swiper <Swiper
loop={false} loop={true}
showsPagination={true} showsPagination={true}
index={0} index={0}
dotStyle={styles.dotStyle}
onIndexChanged={(index) => setCurrentIndex(index)} onIndexChanged={(index) => setCurrentIndex(index)}
> >
<EstmView <EstmView

View File

@ -7,4 +7,7 @@ export default EStyleSheet.create({
header: { header: {
backgroundColor: '$primaryBackgroundColor', backgroundColor: '$primaryBackgroundColor',
}, },
dotStyle: {
backgroundColor: '$primaryDarkText',
},
}); });