Safe name change notification, setting style updates

This commit is contained in:
Mikhail Mikheev 2019-09-03 16:58:06 +04:00
parent 19b7777a41
commit 5bc5cea43e
3 changed files with 19 additions and 9 deletions

View File

@ -78,7 +78,7 @@ const ReviewTx = ({
} }
return ( return (
<React.Fragment> <>
<Row align="center" grow className={classes.heading}> <Row align="center" grow className={classes.heading}>
<Paragraph weight="bolder" className={classes.headingText} noMargin> <Paragraph weight="bolder" className={classes.headingText} noMargin>
Send Funds Send Funds
@ -154,7 +154,7 @@ const ReviewTx = ({
SUBMIT SUBMIT
</Button> </Button>
</Row> </Row>
</React.Fragment> </>
) )
}} }}
</SharedSnackbarConsumer> </SharedSnackbarConsumer>

View File

@ -5,6 +5,7 @@ import Block from '~/components/layout/Block'
import Col from '~/components/layout/Col' import Col from '~/components/layout/Col'
import Field from '~/components/forms/Field' import Field from '~/components/forms/Field'
import Heading from '~/components/layout/Heading' import Heading from '~/components/layout/Heading'
import { SharedSnackbarConsumer } from '~/components/SharedSnackBar'
import { composeValidators, required, minMaxLength } from '~/components/forms/validator' import { composeValidators, required, minMaxLength } from '~/components/forms/validator'
import TextField from '~/components/forms/TextField' import TextField from '~/components/forms/TextField'
import GnoForm from '~/components/forms/GnoForm' import GnoForm from '~/components/forms/GnoForm'
@ -28,22 +29,24 @@ type Props = {
safeAddress: string, safeAddress: string,
safeName: string, safeName: string,
updateSafe: Function, updateSafe: Function,
openSnackbar: Function,
} }
const ChangeSafeName = (props: Props) => { const ChangeSafeName = (props: Props) => {
const { const {
classes, safeAddress, safeName, updateSafe, classes, safeAddress, safeName, updateSafe, openSnackbar,
} = props } = props
const handleSubmit = (values) => { const handleSubmit = (values) => {
updateSafe({ address: safeAddress, name: values.safeName }) updateSafe({ address: safeAddress, name: values.safeName })
openSnackbar('Safe name changed', 'success')
} }
return ( return (
<React.Fragment> <>
<GnoForm onSubmit={handleSubmit}> <GnoForm onSubmit={handleSubmit}>
{() => ( {() => (
<React.Fragment> <>
<Block className={classes.formContainer}> <Block className={classes.formContainer}>
<Heading tag="h3">Modify Safe name</Heading> <Heading tag="h3">Modify Safe name</Heading>
<Paragraph> <Paragraph>
@ -78,11 +81,17 @@ const ChangeSafeName = (props: Props) => {
</Button> </Button>
</Col> </Col>
</Row> </Row>
</React.Fragment> </>
)} )}
</GnoForm> </GnoForm>
</React.Fragment> </>
) )
} }
export default withStyles(styles)(ChangeSafeName) const withSnackbar = (props) => (
<SharedSnackbarConsumer>
{({ openSnackbar }) => <ChangeSafeName {...props} openSnackbar={openSnackbar} />}
</SharedSnackbarConsumer>
)
export default withStyles(styles)(withSnackbar)

View File

@ -6,9 +6,10 @@ import {
export const styles = () => ({ export const styles = () => ({
root: { root: {
backgroundColor: 'white', backgroundColor: 'white',
boxShadow: '0 -1px 4px 0 rgba(74, 85, 121, 0.5)', boxShadow: '1px 2px 10px 0 rgba(212, 212, 211, 0.59)',
minHeight: '400px', minHeight: '400px',
display: 'flex', display: 'flex',
borderRadius: '8px',
}, },
settings: { settings: {
letterSpacing: '-0.5px', letterSpacing: '-0.5px',