Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
271 changes: 271 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.5.0",
"@testing-library/user-event": "^7.2.1",
"bootstrap": "^4.4.1",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-scripts": "3.4.1"
"react-router": "^5.1.2",
"react-router-dom": "^5.1.2",
"react-scripts": "3.4.1",
"reactstrap": "^8.4.1",
"styled-components": "^5.1.0"
},
"scripts": {
"start": "react-scripts start",
Expand Down
Binary file removed public/logo192.png
Binary file not shown.
Binary file removed public/logo512.png
Binary file not shown.
10 changes: 0 additions & 10 deletions public/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,6 @@
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
Expand Down
38 changes: 0 additions & 38 deletions src/App.css

This file was deleted.

26 changes: 0 additions & 26 deletions src/App.js

This file was deleted.

9 changes: 0 additions & 9 deletions src/App.test.js

This file was deleted.

34 changes: 34 additions & 0 deletions src/components/Layout/Header/Header.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import React, { Component } from 'react';
import styled from 'styled-components';



const P = styled.text`
float: right;
margin-right: 10px;
color: #8CA1BE;
`;
const Div = styled.text`
font-size: 25px;
color: #6C6C6C;
margin-right: 10px;
float: right;
`;

class Header extends Component {
componentDidMount(){
localStorage.setItem('balance',3000);
};

render(){
return (
<header>
<P>Balance</P><br/>
<Div>${localStorage.getItem('balance')}</Div>
</header>
)
}
}


export default Header;
26 changes: 26 additions & 0 deletions src/components/Layout/Layout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React from "react";

import Sidebar from "./Sidebar/Sidebar";
import Header from "./Header/Header";

class Layout extends React.Component {
render() {
return (
<div className="Layout">
<div className="container-fluid">
<div className="row no-gutter">
<div className="col-2">
<Sidebar />
</div>
<div className="content col-10 no-gutter ">
<Header />
<main> {this.props.children}</main>
</div>
</div>
</div>
</div>
);
}
}

export default Layout;
19 changes: 19 additions & 0 deletions src/components/Layout/Sidebar/Sidebar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from "react";
import { Link } from "react-router-dom";

class Sidebar extends React.Component {
render() {
return (
<aside>
<div>Logo</div>
<div className="navigation mt-4 ml-4">
<Link to="/">Home</Link>
<Link to="/charts">Charts</Link>
<Link to="/categories">Categories</Link>
</div>
</aside>
);
}
}

export default Sidebar;
52 changes: 52 additions & 0 deletions src/components/Pages/AddCategory/AddCategory.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import React from "react";
import { Form, FormGroup, Label, Input } from "reactstrap";
import { Link } from "react-router-dom";

class AddCategory extends React.Component {
render() {
return (
<div className="container">
<Form
style={{
width: "60%",
marginTop: "50px",
border: "1px solid lightgrey",
padding: "30px",
borderRadius: "4px",
}}
>
<FormGroup>
<Label for="total">Total</Label>
<Input type="text" name="total" id="total" placeholder="total" />
</FormGroup>

<FormGroup>
<Label for="description">Description</Label>
<Input
type="text"
name="description"
id="description"
placeholder="description"
/>
</FormGroup>

<FormGroup>
<Label for="selectIcon">Select icon</Label>
<Input type="select" name="selectIcon" id="selectIcon">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</Input>
</FormGroup>
<Link to="/categories" className="btn btn-secondary">
Add new category
</Link>
</Form>
</div>
);
}
}

export default AddCategory;
20 changes: 20 additions & 0 deletions src/components/Pages/Categories/ActionMenu.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from "react";
import {
UncontrolledDropdown,
DropdownToggle,
DropdownMenu,
DropdownItem,
} from "reactstrap";

export default function ActionMenu() {
return (
<UncontrolledDropdown>
<DropdownToggle style={{ background: "none", color: "grey" }}>
Edit
</DropdownToggle>
<DropdownMenu>
<DropdownItem>Delete category</DropdownItem>
</DropdownMenu>
</UncontrolledDropdown>
);
}
55 changes: 55 additions & 0 deletions src/components/Pages/Categories/Categories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import React from "react";
import { Link } from "react-router-dom";

import ActionMenu from "./ActionMenu";

class Categories extends React.Component {
state = {
categories: [
{ categoryName: "Food", description: "my food", date: "10.04.20" },
{ categoryName: "Clothes", description: "", date: "10.04.20" },
{ categoryName: "Restaurants", description: "", date: "10.04.20" },
{ categoryName: "Utility bills", description: "", date: "10.04.20" },
{ categoryName: "Pets", description: "", date: "10.04.20" },
],
};

render() {
return (
<div className="container">
<div className="categories-header d-flex justify-content-between mt-4">
<h2>Categories</h2>
<Link to="/add_category" className="btn btn-primary">
Add category
</Link>
</div>
<div className="table">
<div
className="row mt-4"
style={{
borderBottom: "1px solid lightgrey",
fontWeight: "bolder",
}}
>
<div className="col-3 text-center">Category</div>
<div className="col-3 text-center">Description</div>
<div className="col-3 text-center">Date</div>
<div className="col-3 text-center">Action</div>
</div>
{this.state.categories.map((category) => (
<div className="row mt-2" key={category.categoryName}>
<div className="col-3 text-center">{category.categoryName}</div>
<div className="col-3 text-center">{category.description}</div>
<div className="col-3 text-center">{category.date}</div>
<div className="col-3 text-center">
<ActionMenu />
</div>
</div>
))}
</div>
</div>
);
}
}

export default Categories;
9 changes: 9 additions & 0 deletions src/components/Pages/Charts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from "react";

class Charts extends React.Component {
render() {
return <div>Charts</div>;
}
}

export default Charts;
9 changes: 9 additions & 0 deletions src/components/Pages/Home/Charges.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react';

class Charges extends React.Component {
render() {
return <div>Charges1</div>;
}
}

export default Charges;
Loading