mirror of
https://github.com/status-im/visual-identity.git
synced 2025-02-08 02:33:53 +00:00
add toaster for events
This commit is contained in:
parent
53f1ddb2f8
commit
fd253531bc
@ -322,7 +322,6 @@ class SketchFieldDemo extends React.Component {
|
||||
id='lineColor' color={this.state.lineColor}
|
||||
onChange={(color) => this.setState({lineColor: color.hex})}/>
|
||||
</CardContent>
|
||||
<Button onClick={this.props.request}>Get Content</Button>
|
||||
</Card>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -31,7 +31,7 @@ class SimpleSnackbar extends React.Component {
|
||||
}}
|
||||
message={<span id="message-id">Transaction Validated</span>}
|
||||
action={[
|
||||
<Button key="undo" color="secondary" size="small" onClick={handleClose}>
|
||||
<Button key="undo" color="secondary" size="small" onClick={(e) => handleClose(e, 'UNDO')}>
|
||||
UNDO
|
||||
</Button>,
|
||||
<IconButton
|
||||
|
@ -80,9 +80,15 @@ class App extends React.Component {
|
||||
}
|
||||
|
||||
closeValidationToast = (event, reason) => {
|
||||
console.log({event, reason})
|
||||
if (reason === 'clickaway') {
|
||||
return;
|
||||
}
|
||||
if (reason === 'UNDO') {
|
||||
const { canvasState } = this.state;
|
||||
console.log(canvasState, JSON.parse(canvasState))
|
||||
|
||||
}
|
||||
this.setState({ validationToast: false });
|
||||
}
|
||||
|
||||
@ -93,7 +99,7 @@ class App extends React.Component {
|
||||
const { web3Provider, loading, canvasState, validationToast } = this.state;
|
||||
return (
|
||||
<Web3Render ready={web3Provider}>
|
||||
<DrawField setTileMapState={setTileMapState} canvasState={canvasState} request={this.requestUpdateTilesOnCanvas.bind(this)}/>
|
||||
<DrawField setTileMapState={setTileMapState} canvasState={canvasState} />
|
||||
<Toaster open={validationToast} handleClose={closeValidationToast}/>
|
||||
</Web3Render>
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user