Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit f7a144d

Browse files
Budget manager and calculator #6
1 parent ef771f5 commit f7a144d

File tree

18 files changed

+11278
-1
lines changed

18 files changed

+11278
-1
lines changed

budget-manager-react-web-app-project/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
![under_construction](https://user-images.githubusercontent.com/37651620/93677983-a7942e00-facc-11ea-8b6d-b57e73dc73bf.png)
1+
![Budget_manager_and_Calculator](https://user-images.githubusercontent.com/37651620/96116885-e91bcb80-0f08-11eb-8653-b0dbb082f68c.png)
2+
3+
## It's Live 🎉 Visit here ==> https://budget-manager-react.netlify.app/
24

35
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
46

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"name": "budget-manager-react-web-app-project",
3+
"version": "0.1.0",
4+
"private": true,
5+
"dependencies": {
6+
"@testing-library/jest-dom": "^4.2.4",
7+
"@testing-library/react": "^9.3.2",
8+
"@testing-library/user-event": "^7.1.2",
9+
"react": "^16.13.1",
10+
"react-dom": "^16.13.1",
11+
"react-scripts": "3.4.3"
12+
},
13+
"scripts": {
14+
"start": "react-scripts start",
15+
"build": "react-scripts build",
16+
"test": "react-scripts test",
17+
"eject": "react-scripts eject"
18+
},
19+
"eslintConfig": {
20+
"extends": "react-app"
21+
},
22+
"browserslist": {
23+
"production": [
24+
">0.2%",
25+
"not dead",
26+
"not op_mini all"
27+
],
28+
"development": [
29+
"last 1 chrome version",
30+
"last 1 firefox version",
31+
"last 1 safari version"
32+
]
33+
}
34+
}
Binary file not shown.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
<meta name="theme-color" content="#000000" />
8+
<meta
9+
name="description"
10+
content="Web site created using create-react-app"
11+
/>
12+
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
13+
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
14+
<title>Budget Manager</title>
15+
</head>
16+
<body>
17+
<noscript>You need to enable JavaScript to run this app.</noscript>
18+
<div id="root"></div>
19+
</body>
20+
</html>
5.22 KB
Loading
9.44 KB
Loading
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"short_name": "React App",
3+
"name": "Create React App Sample",
4+
"icons": [
5+
{
6+
"src": "favicon.ico",
7+
"sizes": "64x64 32x32 24x24 16x16",
8+
"type": "image/x-icon"
9+
},
10+
{
11+
"src": "logo192.png",
12+
"type": "image/png",
13+
"sizes": "192x192"
14+
},
15+
{
16+
"src": "logo512.png",
17+
"type": "image/png",
18+
"sizes": "512x512"
19+
}
20+
],
21+
"start_url": ".",
22+
"display": "standalone",
23+
"theme_color": "#000000",
24+
"background_color": "#ffffff"
25+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# https://www.robotstxt.org/robotstxt.html
2+
User-agent: *
3+
Disallow:
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import React,{useState,useEffect} from 'react';
2+
import './styles/App.css';
3+
import Header from "./components/Header"
4+
import BudgetForm from "./components/BudgetForm"
5+
import BudgetList from "./components/BudgetList"
6+
import BudgetCalculator from "./components/BudgetCalculator"
7+
8+
function App() {
9+
const [budget, setBudget]= useState([]);
10+
const [totalBudget,setTotalBudget]= useState(0);
11+
12+
13+
useEffect(()=>{
14+
let temp =0
15+
for(let i=0; i<budget.length; i++){
16+
temp +=parseInt(budget[i].price)
17+
}
18+
setTotalBudget(temp);
19+
},[budget])
20+
21+
22+
23+
24+
return (
25+
<>
26+
27+
<Header />
28+
29+
<BudgetForm budget={budget} setBudget={setBudget} />
30+
31+
<BudgetList budget={budget} setBudget={setBudget}/>
32+
33+
<BudgetCalculator totalBudget={totalBudget}/>
34+
</>
35+
);
36+
}
37+
38+
export default App;
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import React from 'react';
2+
3+
4+
function BudgetCalculator({totalBudget}) {
5+
return (
6+
<>
7+
<div className="total-budget">Total $.{totalBudget}</div>
8+
</>
9+
)
10+
}
11+
12+
export default BudgetCalculator

0 commit comments

Comments
 (0)