Skip to content

Commit

Permalink
fix(snackBarAction): replace snackbar action and color
Browse files Browse the repository at this point in the history
  • Loading branch information
Clm-Roig committed Apr 13, 2022
1 parent 4d1fd67 commit 68bcca5
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 5 deletions.
9 changes: 6 additions & 3 deletions src/app/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import VisibilityOffIcon from '@mui/icons-material/VisibilityOff';
import CloseIcon from '@mui/icons-material/Close';
import { LocalizationProvider } from '@mui/lab';
import DateAdapter from '@mui/lab/AdapterDateFns';
import { Container, IconButton, Paper } from '@mui/material';
Expand Down Expand Up @@ -68,8 +68,11 @@ function App() {
maxSnack={3}
ref={notistackRef}
action={(key) => (
<IconButton onClick={onClickDismiss(key)} size="small">
<VisibilityOffIcon />
<IconButton
onClick={onClickDismiss(key)}
size="small"
sx={{ color: 'common.white' }}>
<CloseIcon />
</IconButton>
)}>
<AppBar toggleDrawerMenu={toggleDrawerMenu} />
Expand Down
2 changes: 0 additions & 2 deletions src/components/TrackerCard/TrackerCardActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ const TrackerCardActions: FC<Props> = ({
enqueueSnackbar('Tracker validé !', { variant: 'success' });
};

// TODO: remove next line when feature is implemented
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const handleMakeVisible = () => {
dispatch(makeTrackerVisible(tracker.id));
setIsMakeVisibleOpen(false);
Expand Down
36 changes: 36 additions & 0 deletions src/components/settings/DeleteDataDialog.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import {
Button,
Dialog,
DialogActions,
DialogContent,
DialogContentText,
DialogProps,
DialogTitle
} from '@mui/material';
import { FC } from 'react';

interface Props {
dialogProps: DialogProps;
onDelete: () => void;
}

const DeleteDataDialog: FC<Props> = ({ dialogProps, onDelete }) => {
return (
<Dialog {...dialogProps}>
<DialogTitle>Suppression de vos données</DialogTitle>
<DialogContent>
<DialogContentText gutterBottom>
Êtes vous sûr·e de vouloir supprimer toutes vos données ? Cette action est{' '}
<b>irréversible</b>.
</DialogContentText>
</DialogContent>
<DialogActions>
<Button onClick={onDelete} color="error" autoFocus>
Supprimer
</Button>
</DialogActions>
</Dialog>
);
};

export default DeleteDataDialog;
4 changes: 4 additions & 0 deletions src/config/CustomTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ const commonTheme = {
secondary: YELLOW_CRAYOLA,
text: {
primary: CHARCOAL.main
},
common: {
white: '#eee',
black: '#111'
}
};

Expand Down

0 comments on commit 68bcca5

Please sign in to comment.