add Statistics screen mock
This commit is contained in:
parent
5d8fcb7293
commit
1ebbf6573b
@ -8,9 +8,7 @@ import {
|
|||||||
useParams
|
useParams
|
||||||
} from "react-router-dom";
|
} from "react-router-dom";
|
||||||
|
|
||||||
import { Home, Login, AddReceipt } from "./screens";
|
import { Home, Login, AddReceipt, Statistics } from "./screens";
|
||||||
// import logo from "./img/logo_project.svg";
|
|
||||||
// import "./App.css";
|
|
||||||
import SimpleReactFileUpload from "./react-file-upload.js";
|
import SimpleReactFileUpload from "./react-file-upload.js";
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
@ -20,6 +18,9 @@ function App() {
|
|||||||
<Route path="/add_receipt">
|
<Route path="/add_receipt">
|
||||||
<AddReceipt />
|
<AddReceipt />
|
||||||
</Route>
|
</Route>
|
||||||
|
<Route path="/home/statistics">
|
||||||
|
<Statistics />
|
||||||
|
</Route>
|
||||||
<Route path="/debug">
|
<Route path="/debug">
|
||||||
<SimpleReactFileUpload />
|
<SimpleReactFileUpload />
|
||||||
</Route>
|
</Route>
|
||||||
@ -34,35 +35,4 @@ function App() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// class Form extends React.Component {
|
|
||||||
// constructor(props) {
|
|
||||||
// super(props);
|
|
||||||
// this.state = { username: "" };
|
|
||||||
// this.handleChange = this.handleChange.bind(this);
|
|
||||||
// this.handleSubmit = this.handleSubmit.bind(this);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// handleChange(event) {
|
|
||||||
// this.setState({ value: event.target.value });
|
|
||||||
// }
|
|
||||||
|
|
||||||
// handleSubmit(event) {
|
|
||||||
// alert(this.state.username);
|
|
||||||
// event.preventDefault();
|
|
||||||
// }
|
|
||||||
|
|
||||||
// render() {
|
|
||||||
// return (
|
|
||||||
// <form onSubmit={this.handleSubmit}>
|
|
||||||
// <input
|
|
||||||
// type="text"
|
|
||||||
// value={this.state.username}
|
|
||||||
// onChange={this.handleChange}
|
|
||||||
// />
|
|
||||||
// <input type="submit" value="Submit" />
|
|
||||||
// </form>
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
export default App;
|
export default App;
|
||||||
|
@ -1,20 +1,40 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { Button, Container, Grid, Icon } from "semantic-ui-react";
|
import { Button, Container, Grid, Icon } from "semantic-ui-react";
|
||||||
|
import { useHistory } from "react-router-dom";
|
||||||
|
|
||||||
import "./Home.css";
|
import "./Home.css";
|
||||||
|
|
||||||
function Home() {
|
function Home() {
|
||||||
|
const history = useHistory();
|
||||||
return (
|
return (
|
||||||
<Container className="home-container">
|
<Container className="home-container">
|
||||||
<Button fluid icon size="massive" className="home-button-wrapper">
|
<Button
|
||||||
|
fluid
|
||||||
|
icon
|
||||||
|
size="massive"
|
||||||
|
className="home-button-wrapper"
|
||||||
|
onClick={() => history.push("/home/statistics")}
|
||||||
|
>
|
||||||
<Icon name="pie chart" className="home-button-icon" />
|
<Icon name="pie chart" className="home-button-icon" />
|
||||||
Statystyki
|
Statystyki
|
||||||
</Button>
|
</Button>
|
||||||
<Button fluid icon size="massive" className="home-button-wrapper">
|
<Button
|
||||||
|
fluid
|
||||||
|
icon
|
||||||
|
size="massive"
|
||||||
|
className="home-button-wrapper"
|
||||||
|
onClick={() => history.push("/home/statistics")}
|
||||||
|
>
|
||||||
<Icon name="shop" />
|
<Icon name="shop" />
|
||||||
Zakupy
|
Zakupy
|
||||||
</Button>
|
</Button>
|
||||||
<Button fluid icon size="massive" className="home-button-wrapper">
|
<Button
|
||||||
|
fluid
|
||||||
|
icon
|
||||||
|
size="massive"
|
||||||
|
className="home-button-wrapper"
|
||||||
|
onClick={() => history.push("/home/statistics")}
|
||||||
|
>
|
||||||
<Icon name="add circle" />
|
<Icon name="add circle" />
|
||||||
Dodaj paragon
|
Dodaj paragon
|
||||||
</Button>
|
</Button>
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
import React from "react";
|
|
||||||
import { Button } from "semantic-ui-react";
|
|
||||||
|
|
||||||
import "./styles.css";
|
|
||||||
|
|
||||||
function Home() {
|
|
||||||
return (
|
|
||||||
<div class="home">
|
|
||||||
<h2>Home</h2>
|
|
||||||
<Button>Statystyki</Button>
|
|
||||||
<Button>Zakupy</Button>
|
|
||||||
<Button>Dodaj paragon</Button>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default Home;
|
|
53
bk_webapp/src/screens/Statistics/Statistics.js
Normal file
53
bk_webapp/src/screens/Statistics/Statistics.js
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
import React, { Component, useState } from "react";
|
||||||
|
import {
|
||||||
|
Container,
|
||||||
|
Header,
|
||||||
|
Icon,
|
||||||
|
Image,
|
||||||
|
Menu,
|
||||||
|
Segment,
|
||||||
|
Sidebar
|
||||||
|
} from "semantic-ui-react";
|
||||||
|
import { useHistory } from "react-router-dom";
|
||||||
|
|
||||||
|
import "./Statistics.css";
|
||||||
|
|
||||||
|
function Statistics() {
|
||||||
|
const [visible, setVisible] = useState(false);
|
||||||
|
const history = useHistory();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Sidebar.Pushable>
|
||||||
|
<Sidebar
|
||||||
|
as={Menu}
|
||||||
|
animation="overlay"
|
||||||
|
icon="labeled"
|
||||||
|
inverted
|
||||||
|
onHide={() => setVisible(false)}
|
||||||
|
vertical
|
||||||
|
visible={visible}
|
||||||
|
width="thin"
|
||||||
|
>
|
||||||
|
<Menu.Item>Ogólne</Menu.Item>
|
||||||
|
<Menu.Item>Tagi</Menu.Item>
|
||||||
|
<Menu.Item>Produkty</Menu.Item>
|
||||||
|
<Menu.Item>Zakupy</Menu.Item>
|
||||||
|
</Sidebar>
|
||||||
|
|
||||||
|
<Sidebar.Pusher dimmed={visible}>
|
||||||
|
<Menu icon>
|
||||||
|
<Menu.Item onClick={() => history.push("/home")}>
|
||||||
|
<Icon name="arrow left" />
|
||||||
|
</Menu.Item>
|
||||||
|
|
||||||
|
<Menu.Item position="right" onClick={() => setVisible(true)}>
|
||||||
|
<Icon name="sidebar" />
|
||||||
|
</Menu.Item>
|
||||||
|
</Menu>
|
||||||
|
<Container></Container>
|
||||||
|
</Sidebar.Pusher>
|
||||||
|
</Sidebar.Pushable>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Statistics;
|
@ -1,5 +1,6 @@
|
|||||||
import Home from "./Home/Home";
|
import Home from "./Home/Home";
|
||||||
import Login from "./Login/Login";
|
import Login from "./Login/Login";
|
||||||
import AddReceipt from "./AddReceipt/AddReceipt";
|
import AddReceipt from "./AddReceipt/AddReceipt";
|
||||||
|
import Statistics from "./Statistics/Statistics";
|
||||||
|
|
||||||
export { Home, Login, AddReceipt };
|
export { Home, Login, AddReceipt, Statistics };
|
||||||
|
Loading…
Reference in New Issue
Block a user