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

View File

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

View File

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