Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to override SnackBar style in Notification Component #2405

Merged
merged 2 commits into from
Oct 26, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
rameshsyn marked this conversation as resolved.
Show resolved Hide resolved
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