Skip to content

Commit

Permalink
Merge pull request #11 from lyytioy/snackbar-types-fix
Browse files Browse the repository at this point in the history
Snackbar types fix
  • Loading branch information
kacperkosinski authored Feb 1, 2022
2 parents 25bd6b3 + c2c4fb1 commit 5e8fe6f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@lyyti/design-system",
"description": "Lyyti Design System",
"homepage": "https://lyytioy.github.io/lyyti-design-system",
"version": "0.5.5",
"version": "0.5.6",
"dependencies": {
"@material-ui/core": "^4.11.0",
"@material-ui/data-grid": "^4.0.0-alpha.19",
Expand Down
16 changes: 7 additions & 9 deletions src/components/Snackbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import Slide from '@material-ui/core/Slide';
import { TransitionProps } from '@material-ui/core/transitions';

export interface SnackbarProps extends MuiSnackbarProps {
anchorOrigin: {
anchorOrigin?: {
horizontal: 'center' | 'left' | 'right';
vertical: 'bottom' | 'top';
};
autoHideDuration: number;
autoHideDuration?: number;
color?: 'success' | 'info' | 'warning' | 'error';
direction: 'right' | 'left' | 'up' | 'down';
severity: 'success' | 'info' | 'warning' | 'error';
variant: 'standard' | 'filled' | 'outlined';
direction?: 'right' | 'left' | 'up' | 'down';
severity?: 'success' | 'info' | 'warning' | 'error';
variant?: 'standard' | 'filled' | 'outlined';
}

const Snackbar = ({
Expand All @@ -29,12 +29,10 @@ const Snackbar = ({
}: SnackbarProps): JSX.Element => {
return (
<MuiSnackbar
{...props}
anchorOrigin={anchorOrigin}
autoHideDuration={autoHideDuration}
TransitionComponent={(params: TransitionProps) => (
<Slide {...params} direction={direction} />
)}>
TransitionComponent={(params: TransitionProps) => <Slide {...params} direction={direction} />}
{...props}>
<div>
<AlertBase color={color} severity={severity} variant={variant}>
{props.message}
Expand Down

0 comments on commit 5e8fe6f

Please sign in to comment.