show ethBalance in safe info in sendFunds modal

This commit is contained in:
mmv 2019-04-30 16:32:52 +04:00
parent 8b0bb4fe4f
commit f10df9fea5
3 changed files with 15 additions and 4 deletions

View File

@ -13,6 +13,7 @@ type Props = {
safeAddress: string,
etherScanLink: string,
safeName: string,
ethBalance: string,
}
type ActiveScreen = 'chooseTxType' | 'sendFunds'
@ -24,7 +25,7 @@ const styles = () => ({
})
const Send = ({
onClose, isOpen, classes, safeAddress, etherScanLink, safeName,
onClose, isOpen, classes, safeAddress, etherScanLink, safeName, ethBalance,
}: Props) => {
const [activeScreen, setActiveScreen] = useState<ActiveScreen>('sendFunds')
const smallerModalSize = activeScreen === 'chooseTxType'
@ -54,6 +55,7 @@ const Send = ({
safeAddress={safeAddress}
etherScanLink={etherScanLink}
safeName={safeName}
ethBalance={ethBalance}
/>
)}
</React.Fragment>

View File

@ -8,6 +8,7 @@ import ArrowDown from '@material-ui/icons/ArrowDownward'
import Identicon from '~/components/Identicon'
import Paragraph from '~/components/layout/Paragraph'
import Row from '~/components/layout/Row'
import GnoForm from '~/components/forms/GnoForm'
import Link from '~/components/layout/Link'
import Col from '~/components/layout/Col'
@ -59,10 +60,11 @@ type Props = {
safeAddress: string,
etherScanLink: string,
safeName: string,
ethBalance: string,
}
const SendFunds = ({
classes, onClose, safeAddress, etherScanLink, safeName,
classes, onClose, safeAddress, etherScanLink, safeName, ethBalance,
}: Props) => (
<React.Fragment>
<Row align="center" grow className={classes.heading}>
@ -93,7 +95,11 @@ const SendFunds = ({
<Paragraph noMargin>
Balance:
{' '}
<Bold>1.349 ETH</Bold>
<Bold>
{ethBalance}
{' '}
ETH
</Bold>
</Paragraph>
</Block>
</Col>
@ -106,6 +112,7 @@ const SendFunds = ({
<Hairline />
</Col>
</Row>
<GnoForm>{() => <Row />}</GnoForm>
</Block>
</React.Fragment>
)

View File

@ -40,6 +40,7 @@ type Props = {
safeAddress: string,
safeName: string,
etherScanLink: string,
ethBalance: string,
}
type Action = 'Token' | 'Send' | 'Receive'
@ -71,7 +72,7 @@ class Balances extends React.Component<Props, State> {
hideZero, showToken, showReceive, showSend,
} = this.state
const {
classes, granted, tokens, safeAddress, activeTokens, safeName, etherScanLink,
classes, granted, tokens, safeAddress, activeTokens, safeName, etherScanLink, ethBalance,
} = this.props
const columns = generateColumns()
@ -165,6 +166,7 @@ class Balances extends React.Component<Props, State> {
etherScanLink={etherScanLink}
safeAddress={safeAddress}
safeName={safeName}
ethBalance={ethBalance}
/>
<Modal
title="Receive Tokens"