diff --git a/app/src/components/Layout/Notification.tsx b/app/src/components/Layout/Notification.tsx index 9de3751..bbe27ac 100644 --- a/app/src/components/Layout/Notification.tsx +++ b/app/src/components/Layout/Notification.tsx @@ -37,7 +37,7 @@ class Notification extends React.Component { ({ - snackbar: { - backgroundColor: green[600], - color: theme.typography.button.color, - }, -}) - class Copy extends React.Component { constructor(props: Props) { super(props) - this.state = { didCopy: false, snackBarOpen: false } + this.state = { didCopy: false } } private handleClick = (event: React.MouseEvent) => { event.stopPropagation() copy(this.props.value) - this.setState({ didCopy: true, snackBarOpen: true }) + this.props.actions.global.showNotification('Copied to clipboard') + this.setState({ didCopy: true }) setTimeout(() => { this.setState({ didCopy: false }) }, 1500) @@ -53,23 +48,17 @@ class Copy extends React.Component { {icon} - { this.setState({ snackBarOpen: false }) }} - > - - ) } } -export default withStyles(styles)(Copy) +const mapDispatchToProps = (dispatch: any) => { + return { + actions: { + global: bindActionCreators(globalActions, dispatch), + }, + } +} + +export default connect(undefined, mapDispatchToProps)(Copy)