Scheduler c.d

This commit is contained in:
wrzesinski-hubert
2020-08-09 20:44:35 +02:00
parent 7aec9ff943
commit aa38625207
9 changed files with 162 additions and 131 deletions

View File

@ -0,0 +1,48 @@
import React from "react";
import { Group } from "../../../businesslogic/types/group";
interface SchedulerRowProps {
groups: Array<Group>;
indexRow: number;
cellTop: number;
cellWidth: number;
}
export const SchedulerRow = ({
groups,
indexRow,
cellTop,
cellWidth,
}: SchedulerRowProps) => {
// const handleEventClick = (e: React.MouseEvent) => {
// const eventDiv = e.target as HTMLDivElement;
// eventDiv.style.backgroundColor = "#1547C5";
// };
const group = {0: {id: 5, day: 4, time: "11.45", lecturer: "dr Dorota Blinkiewicz", room: "A2-3"}}
return (
<div>
{[...Array(5)].map((value, index) => (
<div
key = {`eventRow${indexRow}eventCol${index}`}
id={`eventRow${indexRow}eventCol${index}`}
style={{
position: "absolute",
top: cellTop,
left: cellWidth + 5 + cellWidth * index,
width: (cellWidth * 2) / 3,
height: 60,
backgroundColor: "lightblue",
zIndex: 2,
}}
>
{groups.map((value, index) => (
<div key={index}>{groups[index]?.lecturer}</div>
))}
</div>
))}
</div>
);
};