Skip to content

Commit

Permalink
Merge pull request #2405 from rameshsyn/next
Browse files Browse the repository at this point in the history
Allow to override SnackBar style in Notification Component
  • Loading branch information
fzaninotto authored Oct 26, 2018
2 parents e0c37c0 + d9e136f commit 7167385
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/ra-ui-materialui/src/layout/Notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,12 @@ class Notification extends React.Component {
hideNotification,
...rest
} = this.props;

const {
warning,
confirm,
undo: undoClass, // Rename classes.undo to undoClass in this scope to avoid name conflicts
...snackbarClasses
} = classes;
return (
<Snackbar
open={this.state.open}
Expand All @@ -96,14 +101,15 @@ class Notification extends React.Component {
notification && notification.undoable ? (
<Button
color="primary"
className={classes.undo}
className={undoClass}
size="small"
onClick={undo}
>
{translate('ra.action.undo')}
</Button>
) : null
}
classes={snackbarClasses}
{...rest}
/>
);
Expand Down

0 comments on commit 7167385

Please sign in to comment.