2021-01-05 23:46:51 +01:00
|
|
|
import React, { useContext } from 'react';
|
|
|
|
import styled from 'styled-components';
|
|
|
|
import { coursesContext } from '../contexts/CoursesProvider';
|
2021-01-07 19:57:06 +01:00
|
|
|
import RightArrow from '../assets/right-arrow.svg';
|
|
|
|
import LeftArrow from '../assets/left-arrow.svg';
|
2021-01-05 23:46:51 +01:00
|
|
|
|
|
|
|
type ButtonProps = {
|
|
|
|
direction: 'left' | 'right';
|
|
|
|
};
|
|
|
|
|
|
|
|
const Wrapper = styled.div`
|
|
|
|
display: flex;
|
2021-01-07 19:57:06 +01:00
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
|
|
|
margin-top:-15px;
|
2021-01-05 23:46:51 +01:00
|
|
|
`;
|
|
|
|
|
2021-01-07 19:57:06 +01:00
|
|
|
const StyledButton = styled.div<ButtonProps>`
|
|
|
|
cursor:pointer;
|
|
|
|
user-select: none;
|
|
|
|
margin:10px;
|
|
|
|
border-radius:5px;
|
|
|
|
border-radius: 15px;
|
|
|
|
background-color: #9ed3ff;
|
|
|
|
border: 2px solid white;
|
|
|
|
min-width: 45px;
|
|
|
|
color: black;
|
|
|
|
display:flex;
|
|
|
|
align-items:center;
|
|
|
|
justify-content:center;
|
|
|
|
padding: 12px;
|
|
|
|
:hover{
|
|
|
|
background-color:#85c8ff;
|
|
|
|
}
|
|
|
|
transition: color 0.3s, background-color 0.3s;
|
|
|
|
`;
|
|
|
|
|
|
|
|
const StyledArrow = styled.img`
|
|
|
|
width:20px;
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
|
|
const StyledDate = styled.div`
|
|
|
|
user-select: none;
|
|
|
|
margin:10px;
|
|
|
|
border-radius:5px;
|
|
|
|
border-radius: 15px;
|
|
|
|
background-color: #FFDC61;
|
|
|
|
border: 2px solid white;
|
|
|
|
min-width: 45px;
|
|
|
|
text-align:center;
|
|
|
|
color: black;
|
|
|
|
padding: 10px;
|
2021-01-05 23:46:51 +01:00
|
|
|
`;
|
|
|
|
|
|
|
|
type SchedulerHistoryNavigationProps = {
|
|
|
|
commisionDate?: Date;
|
2021-01-07 19:57:06 +01:00
|
|
|
SubstractCurrentTimetable: (value: number) => void;
|
|
|
|
AddCurrentTimetable: (value: number) => void;
|
2021-01-05 23:46:51 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
export const SchedulerHistoryNavigation = ({
|
|
|
|
commisionDate,
|
2021-01-07 19:57:06 +01:00
|
|
|
SubstractCurrentTimetable,
|
|
|
|
AddCurrentTimetable,
|
2021-01-05 23:46:51 +01:00
|
|
|
}: SchedulerHistoryNavigationProps) => {
|
2021-01-07 19:57:06 +01:00
|
|
|
|
|
|
|
console.log("231213231231",commisionDate)
|
|
|
|
|
2021-01-05 23:46:51 +01:00
|
|
|
return (
|
|
|
|
<Wrapper>
|
|
|
|
<StyledButton
|
|
|
|
direction="left"
|
|
|
|
onClick={() => {
|
|
|
|
console.log('left clicked');
|
2021-01-07 19:57:06 +01:00
|
|
|
SubstractCurrentTimetable(-1);
|
2021-01-05 23:46:51 +01:00
|
|
|
}}
|
|
|
|
>
|
2021-01-07 19:57:06 +01:00
|
|
|
<StyledArrow src={LeftArrow}></StyledArrow>
|
2021-01-05 23:46:51 +01:00
|
|
|
</StyledButton>
|
2021-01-07 19:57:06 +01:00
|
|
|
<StyledDate>{commisionDate}</StyledDate>
|
2021-01-05 23:46:51 +01:00
|
|
|
<StyledButton
|
|
|
|
direction="right"
|
|
|
|
onClick={() => {
|
|
|
|
console.log('right clicked');
|
2021-01-07 19:57:06 +01:00
|
|
|
AddCurrentTimetable(1);
|
2021-01-05 23:46:51 +01:00
|
|
|
}}
|
|
|
|
>
|
2021-01-07 19:57:06 +01:00
|
|
|
<StyledArrow src={RightArrow}></StyledArrow>
|
2021-01-05 23:46:51 +01:00
|
|
|
</StyledButton>
|
|
|
|
</Wrapper>
|
|
|
|
);
|
|
|
|
};
|