mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-22 12:51:42 +03:00
New container design
This commit is contained in:
parent
790abbe0cf
commit
bce3778a0e
@ -140,24 +140,25 @@ class TransferContainer extends Component {
|
||||
};
|
||||
|
||||
render() {
|
||||
const { accounts, currentAccount, navigation } = this.props;
|
||||
const { accounts, currentAccount, navigation, children } = this.props;
|
||||
const { balance, fundType } = this.state;
|
||||
|
||||
const transferType = navigation.getParam('transferType', '');
|
||||
|
||||
return (
|
||||
<TransferView
|
||||
accounts={accounts}
|
||||
fetchBalance={this.fetchBalance}
|
||||
getAccountsWithUsername={this._getAccountsWithUsername}
|
||||
transferToAccount={this._transferToAccount}
|
||||
handleOnModalClose={this._handleOnModalClose}
|
||||
accountType={currentAccount.local.authType}
|
||||
currentAccountName={currentAccount.name}
|
||||
balance={balance}
|
||||
fundType={fundType}
|
||||
transferType={transferType}
|
||||
/>
|
||||
children &&
|
||||
children({
|
||||
accounts,
|
||||
balance,
|
||||
fundType,
|
||||
transferType,
|
||||
fetchBalance: this.fetchBalance,
|
||||
getAccountsWithUsername: this._getAccountsWithUsername,
|
||||
transferToAccount: this._transferToAccount,
|
||||
handleOnModalClose: this._handleOnModalClose,
|
||||
accountType: currentAccount.local.authType,
|
||||
currentAccountName: currentAccount.name,
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,45 @@
|
||||
import TransferScreen from './screen/transferScreen';
|
||||
import Transfer from './container/transferContainer';
|
||||
import React from 'react';
|
||||
|
||||
import TransferContainer from './container/transferContainer';
|
||||
|
||||
import TransferScreen from './screen/transferScreen';
|
||||
|
||||
const Transfer = ({ navigation }) => (
|
||||
<TransferContainer navigation={navigation}>
|
||||
{({
|
||||
accounts,
|
||||
balance,
|
||||
fundType,
|
||||
transferType,
|
||||
fetchBalance,
|
||||
getAccountsWithUsername,
|
||||
transferToAccount,
|
||||
handleOnModalClose,
|
||||
accountType,
|
||||
currentAccountName,
|
||||
}) => {
|
||||
switch (transferType) {
|
||||
case 'transfer_token':
|
||||
return (
|
||||
<TransferScreen
|
||||
accounts={accounts}
|
||||
balance={balance}
|
||||
fundType={fundType}
|
||||
transferType={transferType}
|
||||
fetchBalance={fetchBalance}
|
||||
getAccountsWithUsername={getAccountsWithUsername}
|
||||
transferToAccount={transferToAccount}
|
||||
handleOnModalClose={handleOnModalClose}
|
||||
accountType={accountType}
|
||||
currentAccountName={currentAccountName}
|
||||
/>
|
||||
);
|
||||
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}}
|
||||
</TransferContainer>
|
||||
);
|
||||
|
||||
export { TransferScreen, Transfer };
|
||||
export default Transfer;
|
||||
|
Loading…
Reference in New Issue
Block a user