-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWeddingWebMain.js
43 lines (37 loc) · 1.21 KB
/
WeddingWebMain.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import React, { useState, useEffect } from 'react';
import WeddingTable from './WeddingCP/WeddingTable';
import WeddingCompare from './WeddingCP/WeddingCompare';
function App() {
const [values, setValues] = useState({
weddingHall: 0,
Sdm: 0,
Shots: 0,
});
const [total, setTotal] = useState(0);
const[analizes, setAnalizes]=useState({
arrow:'',
average:'',
hardNum:'',
})
useEffect(() => {
const sum = parseInt(values.weddingHall) + parseInt(values.Sdm) + parseInt(values.Shots);
setTotal(sum);
}, [values]);
const handlePopupValue = (item, value) => {
setValues(prevValues => ({
...prevValues,
[item]: value,
}));
};
return (
<div>
<h1 style={{ fontSize: '60px', textAlign: 'center', textDecoration:'bold' ,borderBottom: '1px dashed black'}}>Wedding Planner</h1>
<br/>
<div className="tables-container" style={{textAlign:'center'}}>
<WeddingTable values={values} total={total} handleSelection={handlePopupValue} />
<WeddingCompare analizes={analizes}/>
</div>
</div>
);
};
export default App;