snackbar done

This commit is contained in:
Maciek Głowacki 2020-11-25 04:16:22 +01:00
parent 42fb405033
commit 391bb51ab0

View File

@ -3,6 +3,15 @@ import { Course, Group, Basket, GroupType, SchedulerEvent } from '../types';
import { useSnackbar } from 'notistack'; import { useSnackbar } from 'notistack';
import { createClassTime } from '../utils'; import { createClassTime } from '../utils';
import { axiosInstance } from '../utils/axiosInstance'; import { axiosInstance } from '../utils/axiosInstance';
import CloseIcon from '@material-ui/icons/Close';
import styled from 'styled-components';
const StyledCloseIcon = styled(CloseIcon)`
&:hover {
cursor: pointer;
}
`;
interface CourseContext { interface CourseContext {
courses: Array<Course>; courses: Array<Course>;
basket: Array<Basket>; basket: Array<Basket>;
@ -74,13 +83,11 @@ export const CoursesProvider = ({ children }: CoursesProviderProps) => {
const basketIds = selectBasketIds(); const basketIds = selectBasketIds();
const action = (key: any) => ( const action = (key: any) => (
<> <>
<button <StyledCloseIcon
onClick={() => { onClick={() => {
closeSnackbar(key); closeSnackbar(key);
}} }}
> ></StyledCloseIcon>
X
</button>
</> </>
); );