fixed hover

This commit is contained in:
wrzesinski-hubert
2021-01-12 22:59:12 +01:00
parent d4f7ad341a
commit 1c7888a478
13 changed files with 210 additions and 58 deletions

View File

@ -3,6 +3,7 @@ import { useState } from 'react';
import { SchedulerEvents } from './SchedulerEvents';
import { days, hours } from '../constants/index';
import styled from 'styled-components/macro';
import { SchedulerEvent } from '../types';
const SchedulerWrapper = styled.div`
border-collapse: collapse;
@ -61,7 +62,11 @@ const TableCell = styled.div<TableCellProps>`
font-weight: bold;
`;
export const Scheduler = () => {
interface SchedulerProps {
schedulerEvents: Array<SchedulerEvent>;
}
export const Scheduler = ({ schedulerEvents }: SchedulerProps) => {
const cellRef = useRef<HTMLDivElement>(null);
const [cellWidth, setCellWidth] = useState(0);
const [cellHeight, setCellHeight] = useState(0);
@ -123,7 +128,7 @@ export const Scheduler = () => {
)}
</TableRow>
))}
<SchedulerEvents cellWidth={cellWidth} cellHeight={cellHeight} />
<SchedulerEvents cellWidth={cellWidth} cellHeight={cellHeight} schedulerEvents={schedulerEvents} />
</TableBody>
</SchedulerWrapper>
);