Add notification when merging changes into the tree

This commit is contained in:
Thomas Nordquist
2019-04-08 00:57:32 +02:00
parent 436b569e93
commit 8c5f708386
5 changed files with 47 additions and 13 deletions

View File

@@ -6,6 +6,7 @@ import { green, red } from '@material-ui/core/colors'
interface Props {
message?: string
type: 'error' | 'notification'
onClose: () => void
classes: any
}
@@ -16,7 +17,7 @@ class Notification extends React.Component<Props, {}> {
}
public static styles = (theme: Theme) => ({
success: {
notification: {
backgroundColor: green[600],
color: theme.typography.button.color,
},
@@ -40,7 +41,7 @@ class Notification extends React.Component<Props, {}> {
onClose={this.props.onClose}
>
<SnackbarContent
className={this.props.classes.error}
className={this.props.type === 'error' ? this.props.classes.error : this.props.classes.notification}
message={this.props.message}
/>
</Snackbar>