mirror of
https://github.com/status-im/safe-react.git
synced 2025-02-17 03:57:04 +00:00
WA-238 Logic for showing Withdrawn form after clicking on Safe's button
This commit is contained in:
parent
9f2ea3d4e6
commit
88795cf890
@ -3,18 +3,27 @@ import * as React from 'react'
|
|||||||
import { ListItem } from 'material-ui/List'
|
import { ListItem } from 'material-ui/List'
|
||||||
import Avatar from 'material-ui/Avatar'
|
import Avatar from 'material-ui/Avatar'
|
||||||
import NotificationsPaused from 'material-ui-icons/NotificationsPaused'
|
import NotificationsPaused from 'material-ui-icons/NotificationsPaused'
|
||||||
|
import Button from '~/components/layout/Button'
|
||||||
import ListItemText from '~/components/List/ListItemText'
|
import ListItemText from '~/components/List/ListItemText'
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
limit: number,
|
limit: number,
|
||||||
|
onWithdrawn: () => void,
|
||||||
}
|
}
|
||||||
|
|
||||||
const DailyLimit = ({ limit }: Props) => (
|
const DailyLimit = ({ limit, onWithdrawn }: Props) => (
|
||||||
<ListItem>
|
<ListItem>
|
||||||
<Avatar>
|
<Avatar>
|
||||||
<NotificationsPaused />
|
<NotificationsPaused />
|
||||||
</Avatar>
|
</Avatar>
|
||||||
<ListItemText primary="Daily Limit" secondary={`${limit} ETH`} />
|
<ListItemText primary="Daily Limit" secondary={`${limit} ETH`} />
|
||||||
|
<Button
|
||||||
|
variant="raised"
|
||||||
|
color="primary"
|
||||||
|
onClick={onWithdrawn}
|
||||||
|
>
|
||||||
|
Withdrawn
|
||||||
|
</Button>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -9,6 +9,8 @@ import Row from '~/components/layout/Row'
|
|||||||
import { type Safe } from '~/routes/safe/store/model/safe'
|
import { type Safe } from '~/routes/safe/store/model/safe'
|
||||||
import List from 'material-ui/List'
|
import List from 'material-ui/List'
|
||||||
|
|
||||||
|
import Withdrawn from '~/routes/safe/component/Withdrawn'
|
||||||
|
|
||||||
import Address from './Address'
|
import Address from './Address'
|
||||||
import Balance from './Balance'
|
import Balance from './Balance'
|
||||||
import Owners from './Owners'
|
import Owners from './Owners'
|
||||||
@ -22,33 +24,46 @@ type SafeProps = {
|
|||||||
balance: string,
|
balance: string,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type State = {
|
||||||
|
component: React$Node,
|
||||||
|
}
|
||||||
|
|
||||||
const listStyle = {
|
const listStyle = {
|
||||||
width: '100%',
|
width: '100%',
|
||||||
}
|
}
|
||||||
|
|
||||||
class GnoSafe extends React.PureComponent<SafeProps> {
|
class GnoSafe extends React.PureComponent<SafeProps, State> {
|
||||||
|
state = {
|
||||||
|
component: undefined,
|
||||||
|
}
|
||||||
|
|
||||||
|
onWithdrawn = () => {
|
||||||
|
this.setState({ component: <Withdrawn /> })
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { safe, balance } = this.props
|
const { safe, balance } = this.props
|
||||||
|
const { component } = this.state
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Row grow>
|
<Row grow>
|
||||||
<Col sm={12} top="xs" md={4} margin="xl" overflow>
|
<Col sm={12} top="xs" md={6} margin="xl" overflow>
|
||||||
<List style={listStyle}>
|
<List style={listStyle}>
|
||||||
<Balance balance={balance} />
|
<Balance balance={balance} />
|
||||||
<Owners owners={safe.owners} />
|
<Owners owners={safe.owners} />
|
||||||
<Confirmations confirmations={safe.get('confirmations')} />
|
<Confirmations confirmations={safe.get('confirmations')} />
|
||||||
<Address address={safe.get('address')} />
|
<Address address={safe.get('address')} />
|
||||||
<DailyLimit limit={safe.get('dailyLimit')} />
|
<DailyLimit limit={safe.get('dailyLimit')} onWithdrawn={this.onWithdrawn} />
|
||||||
</List>
|
</List>
|
||||||
</Col>
|
</Col>
|
||||||
<Col sm={12} center="xs" md={8} margin="xl" layout="column">
|
<Col sm={12} center="xs" md={6} margin="xl" layout="column">
|
||||||
<Block margin="xl">
|
<Block margin="xl">
|
||||||
<Paragraph size="lg" noMargin align="right">
|
<Paragraph size="lg" noMargin align="right">
|
||||||
<Bold>{safe.name.toUpperCase()}</Bold>
|
<Bold>{safe.name.toUpperCase()}</Bold>
|
||||||
</Paragraph>
|
</Paragraph>
|
||||||
</Block>
|
</Block>
|
||||||
<Row grow align="center">
|
<Row grow align={component ? undefined : 'center'}>
|
||||||
<Img alt="Safe Icon" src={safeIcon} height={330} />
|
{ component || <Img alt="Safe Icon" src={safeIcon} height={330} /> }
|
||||||
</Row>
|
</Row>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
10
src/routes/safe/component/Withdrawn/index.jsx
Normal file
10
src/routes/safe/component/Withdrawn/index.jsx
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
// @flow
|
||||||
|
import * as React from 'react'
|
||||||
|
|
||||||
|
const Withdrawn = () => (
|
||||||
|
<div>
|
||||||
|
Withdrawn form
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
|
||||||
|
export default Withdrawn
|
Loading…
x
Reference in New Issue
Block a user