Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
aishakhan0925 committed Aug 26, 2020
1 parent 56972ac commit 06cb357
Show file tree
Hide file tree
Showing 12 changed files with 590 additions and 86 deletions.
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@material-ui/core": "^4.11.0",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"bootstrap": "^4.5.2",
"fontawesome": "^5.6.3",
"react": "^16.13.1",
"react-bootstrap": "^1.3.0",
"react-dom": "^16.13.1",
"react-scripts": "3.4.1"
},
Expand Down
55 changes: 17 additions & 38 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -1,43 +1,22 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.

Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="Web site created using create-react-app" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />

You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<script src="https://kit.fontawesome.com/33e99dd524.js" crossorigin="anonymous"></script>
<title>Expensify</title>
</head>

To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
</body>

</html>
137 changes: 112 additions & 25 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -1,38 +1,125 @@
.App {
@import url("https://fonts.googleapis.com/css?family=Lato&display=swap");

.container {
display: flex;
justify-content: center;
padding: 10px 50px;
}
.main_container {
width: 400px !important;
height: auto;
background-color: #d9d9d9;
background-image: linear-gradient(315deg, #d9d9d9 0%, #f6f2f2 74%);
box-shadow: 0 0 10px #008080;
margin-top: 30px;
padding: 10px 50px;
}
.header {
text-align: center;
margin: 10px, 0;
color: #008080;
}
.expence_income {
display: flex;
justify-content: space-around;
align-items: center;
background-color: white;
box-shadow: 0 0 10px gray;
height: 100px;
}
h1 {
letter-spacing: 1px;
margin: 0;
text-align: center;
}

h2 {
letter-spacing: 1px;
margin: 0;
text-align: center;
}

h3 {
border-bottom: 1px solid #bbb;
padding-bottom: 10px;
margin: 40px 0 10px;
text-align: center;
}

.App-logo {
height: 40vmin;
pointer-events: none;
h4 {
margin: 0;
text-transform: uppercase;
text-align: center;
}
.form_container input {
width: 100%;
padding: 10px;
margin: 10px, 10px;
}
.form_container {
padding: 10px;
margin: 10px, 10px;
}
.btn {
cursor: pointer;
background-color: #008080;
box-shadow: var(--box-shadow);
color: #fff;
border: 0;
display: block;
font-size: 16px;
margin: 10px 0 30px;
padding: 10px;
font-weight: bold;
}
.money {
font-size: 20px;
letter-spacing: 1px;
margin: 5px 0;
}
.money.plus {
color: #b6960a;
font-weight: bold;
}

@media (prefers-reduced-motion: no-preference) {
.App-logo {
animation: App-logo-spin infinite 20s linear;
}
.money.minus {
color: #008080;
font-weight: bold;
}

.App-header {
background-color: #282c34;
min-height: 100vh;
.list {
list-style-type: none;
padding: 0;
margin-bottom: 40px;
}

.list li {
background-color: #fff;
box-shadow: var(--box-shadow);
color: #333;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
justify-content: space-between;
position: relative;
padding: 10px;
margin: 10px 0;
}

.list li.plus {
border-right: 5px solid #b6960a;
}

.list li.plus:hover {
border-right: 5px solid #b6960a;
background-color: #b6960a;
color: #f7f7f7;
}

.App-link {
color: #61dafb;
.list li.minus {
border-right: 5px solid #2da3ad;
}

@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
.list li.minus:hover {
border-right: 5px solid #2da3ad;
background-color: #2da3ad;
color: #f7f7f7;
}
24 changes: 5 additions & 19 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,10 @@
import React from 'react';
import logo from './logo.svg';
import './App.css';

import React from "react";
import "./App.css";
import Main from "./Components/Main";
function App() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.js</code> and save to reload.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
<div className="container">
<Main />
</div>
);
}
Expand Down
65 changes: 65 additions & 0 deletions src/Components/ExpenseIncome.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import React, { useContext } from "react";
import { HISTORY } from "../Context/createContext";
export default function ExpenseIncome() {
let history = useContext(HISTORY);

const addTransaction = (e) => {
e.preventDefault();
};

return (
<div>
<div>
<h2>
Your Total Balance
<br />
$5000
</h2>
</div>
<div className="expence_income">
<span className="money plus">
INCOME
<br />
$3000
</span>
<span className="money minus">
EXPENSE
<br />
$3000
</span>
</div>
<h2> Transaction History</h2>
<hr />
<div>
{history.map((trans, ind) => {
return (
<span className="list">
<li key={ind}>
<span>{trans.des}</span>
<span>{trans.amount}</span>
</li>
</span>
);
})}
</div>
<h2> Add Transaction</h2>
<hr />
<div>
<form className="form_container" onSubmit={addTransaction}>
<lable>Description</lable>
<br />

<input type="text" required placeholder="Enter your Description" />
<br />

<lable>Amout</lable>
<br />

<input type="number" required placeholder="Enter your Amout" />
<br />
<input type="submit" value="ADD TRANSACTION" className="btn" />
</form>
</div>
</div>
);
}
12 changes: 12 additions & 0 deletions src/Components/Header.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from "react";

export default function Header() {
return (
<div className="header">
<h2>
<i className="fab fa-google-wallet"></i> Expensify
</h2>
<h5>By: Aisha Khan</h5>
</div>
);
}
14 changes: 14 additions & 0 deletions src/Components/Main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React, { useContext, useState } from "react";
import { Header, ExpenseIncome } from ".";
import { HISTORY } from "../Context/createContext";
export default function Main() {
let history = useContext(HISTORY);
return (
<HISTORY.Provider value={history}>
<div className="main_container">
<Header />
<ExpenseIncome />
</div>
</HISTORY.Provider>
);
}
2 changes: 2 additions & 0 deletions src/Components/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { default as Header } from "./Header";
export { default as ExpenseIncome } from "./ExpenseIncome";
10 changes: 10 additions & 0 deletions src/Context/createContext.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { createContext } from "react";
const history = [
{ des: "cash", amount: 200 },
{ des: "cash", amount: 200 },
{ des: "cash", amount: 200 },
{ des: "cash", amount: 200 },
{ des: "cash", amount: 200 },
];

export const HISTORY = createContext(history);
9 changes: 9 additions & 0 deletions src/Parent.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from "react";
import Child from "./Child";
export default function Parent() {
return (
<div>
<Child />
</div>
);
}
6 changes: 6 additions & 0 deletions src/Redux/createReducer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export const Reducer = (state, action) => {
switch(action.type){
case 'ADD_TRANSACTION':
return (...state)
}
};
Loading

0 comments on commit 06cb357

Please sign in to comment.