-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
56972ac
commit 06cb357
Showing
12 changed files
with
590 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
}; |
Oops, something went wrong.