frontend/src/App.tsx

88 lines
2.1 KiB
TypeScript
Raw Normal View History

2020-06-03 15:43:11 +02:00
import React, { useState } from "react";
import TopBar from "./components/TopBar/";
import Transfer from "./components/Transfer/";
2020-05-24 18:32:11 +02:00
import "./App.scss";
2020-06-05 14:31:48 +02:00
import Schedule from "./components/Calendar/";
2020-06-07 15:57:51 +02:00
import { appointments } from "./components/Calendar/appointments";
import RightBar from "./components/RightBar";
function App() {
2020-06-08 20:10:20 +02:00
const [isOpenTransfer, setOpenTransfer] = useState(false);
2020-06-03 15:43:11 +02:00
const [text, setText] = useState("");
2020-06-14 14:24:49 +02:00
var data = [
{
classname: "E-gospodarka - narzędzia i bezpieczeństwo",
classgroups: [
{
group_id: "1CB",
day: "Pn",
time: "10:00",
lecturer: "dr inż. Michał Ren",
room: "A2-01",
},
{
group_id: "1XD",
day: "Wt",
time: "12:00",
lecturer: "dr inż. Michał Ren",
room: "A3-01",
},
],
},
{
classname: "Statystyka",
classgroups: [
{
group_id: "2CB",
day: "Pn",
time: "10:00",
lecturer: "dr inż. Michał Ren",
room: "A2-01",
},
{
group_id: "2XD",
day: "Wt",
time: "12:00",
lecturer: "dr inż. Michał Ren",
room: "A3-01",
},
],
},
];
2020-06-03 15:43:11 +02:00
return (
<div className="App">
<TopBar
textChangeHandler={(e) => {
setText(e.target.value);
}}
2020-06-03 18:15:51 +02:00
handleTransfer={(e) => {
2020-06-08 20:10:20 +02:00
setOpenTransfer(!isOpenTransfer);
2020-06-03 15:43:11 +02:00
}}
2020-06-09 16:27:32 +02:00
onLangChange={(e) => {
console.log(e);
2020-06-03 18:15:51 +02:00
}}
2020-06-03 15:43:11 +02:00
/>
<Transfer
2020-06-08 20:10:20 +02:00
isOpen={isOpenTransfer}
2020-06-03 15:43:11 +02:00
handleClose={(e) => {
2020-06-08 20:10:20 +02:00
setOpenTransfer(!isOpenTransfer);
2020-06-03 15:43:11 +02:00
}}
/>
2020-06-07 15:57:51 +02:00
<div className="wraper">
<div className="wraper__calendar">
2020-06-07 16:31:35 +02:00
<Schedule data={appointments} />
2020-06-07 15:57:51 +02:00
</div>
<div className="wraper__rightbar">
2020-06-14 14:24:49 +02:00
<RightBar onClassHover={(group_id,class_id)=>{console.log("group id: ",group_id,"class id",class_id)}} lectures={data}/>
2020-06-07 15:57:51 +02:00
</div>
</div>
<h1>{text}</h1>
2020-06-03 15:43:11 +02:00
</div>
);
}
export default App;