frontend/src/App.tsx

50 lines
1.3 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);
const [isPolish, setLanguage] = useState(true);
2020-06-03 15:43:11 +02:00
const [text, setText] = useState("");
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-07 15:57:51 +02:00
handleLanguage={(e) => {
2020-06-08 20:10:20 +02:00
setLanguage(!isPolish);
2020-06-03 18:15:51 +02:00
}}
2020-06-08 20:10:20 +02:00
isOpenTransfer={isOpenTransfer}
isPolish={isPolish}
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">
<RightBar />
</div>
</div>
<h1>{text}</h1>
2020-06-03 15:43:11 +02:00
</div>
);
}
export default App;