From f57f2887d6920736c30ae27ce25a6de5d5703d8c Mon Sep 17 00:00:00 2001 From: Stanislaw-Golebiewski Date: Sun, 22 Dec 2019 21:30:23 +0100 Subject: [PATCH] add Receipts mock screens --- bk_webapp/src/App.js | 5 +- bk_webapp/src/screens/Home/Home.js | 2 +- bk_webapp/src/screens/Receipts/Home.js | 17 --- .../Receipts/{Home.css => Receipts.css} | 0 bk_webapp/src/screens/Receipts/Receipts.js | 101 ++++++++++++++++++ bk_webapp/src/screens/index.js | 3 +- 6 files changed, 108 insertions(+), 20 deletions(-) delete mode 100644 bk_webapp/src/screens/Receipts/Home.js rename bk_webapp/src/screens/Receipts/{Home.css => Receipts.css} (100%) create mode 100644 bk_webapp/src/screens/Receipts/Receipts.js diff --git a/bk_webapp/src/App.js b/bk_webapp/src/App.js index a667399..aa31bbf 100644 --- a/bk_webapp/src/App.js +++ b/bk_webapp/src/App.js @@ -8,7 +8,7 @@ import { useParams } from "react-router-dom"; -import { Home, Login, AddReceipt, Statistics } from "./screens"; +import { Home, Login, AddReceipt, Statistics, Receipts } from "./screens"; import SimpleReactFileUpload from "./react-file-upload.js"; function App() { @@ -21,6 +21,9 @@ function App() { + + + diff --git a/bk_webapp/src/screens/Home/Home.js b/bk_webapp/src/screens/Home/Home.js index 371fea4..bd1068d 100644 --- a/bk_webapp/src/screens/Home/Home.js +++ b/bk_webapp/src/screens/Home/Home.js @@ -23,7 +23,7 @@ function Home() { icon size="massive" className="home-button-wrapper" - onClick={() => history.push("/home/statistics")} + onClick={() => history.push("/home/receipts")} > Zakupy diff --git a/bk_webapp/src/screens/Receipts/Home.js b/bk_webapp/src/screens/Receipts/Home.js deleted file mode 100644 index 0007b0b..0000000 --- a/bk_webapp/src/screens/Receipts/Home.js +++ /dev/null @@ -1,17 +0,0 @@ -import React from "react"; -import { Button } from "semantic-ui-react"; - -import "./styles.css"; - -function Home() { - return ( -
-

Home

- - - -
- ); -} - -export default Home; diff --git a/bk_webapp/src/screens/Receipts/Home.css b/bk_webapp/src/screens/Receipts/Receipts.css similarity index 100% rename from bk_webapp/src/screens/Receipts/Home.css rename to bk_webapp/src/screens/Receipts/Receipts.css diff --git a/bk_webapp/src/screens/Receipts/Receipts.js b/bk_webapp/src/screens/Receipts/Receipts.js new file mode 100644 index 0000000..c1e3be6 --- /dev/null +++ b/bk_webapp/src/screens/Receipts/Receipts.js @@ -0,0 +1,101 @@ +import React, { useState } from "react"; +import { + Container, + Header, + Icon, + Image, + Menu, + Segment, + Sidebar, + Pagination, + Accordion, + Table, + Label +} from "semantic-ui-react"; +import { useHistory } from "react-router-dom"; + +import "./Receipts.css"; + +function Receipts() { + const history = useHistory(); + const [active, setActive] = useState(0); + const handleClick = (current_index, new_index) => { + const newIndex = current_index === new_index ? -1 : new_index; + setActive(newIndex); + }; + + return ( +
+ + history.push("/home")}> + + + + + + handleClick(active, 0)} + > + Zakup #1 + + + + + + Produkt + Cena + + + Cell + Cell + + + Cell + Cell + + + Cell + Cell + + +
+
+ + handleClick(active, 1)} + > + Zakup #2 + + + + + + Produkt + Cena + + + Cell + Cell + + + Cell + Cell + + + Cell + Cell + + +
+
+
+
+
+ ); +} + +export default Receipts; diff --git a/bk_webapp/src/screens/index.js b/bk_webapp/src/screens/index.js index 16628b4..21f5197 100644 --- a/bk_webapp/src/screens/index.js +++ b/bk_webapp/src/screens/index.js @@ -2,5 +2,6 @@ import Home from "./Home/Home"; import Login from "./Login/Login"; import AddReceipt from "./AddReceipt/AddReceipt"; import Statistics from "./Statistics/Statistics"; +import Receipts from "./Receipts/Receipts"; -export { Home, Login, AddReceipt, Statistics }; +export { Home, Login, AddReceipt, Statistics, Receipts };