Revize 5bedee9e
Přidáno uživatelem plundrichov před více než 4 roky(ů)
client/src/Setting.js | ||
---|---|---|
6 | 6 |
|
7 | 7 |
function Setting() { |
8 | 8 |
|
9 |
const [sickdays, setSickdays] = useState([]);
|
|
9 |
const [sickdays, setSickdays] = useState(); |
|
10 | 10 |
|
11 | 11 |
useEffect( () => { |
12 | 12 |
api_fetch.getSettingData().then(settingData => { |
... | ... | |
39 | 39 |
function changeSickday(newValue) { |
40 | 40 |
setSetting( |
41 | 41 |
{sickday: newValue, |
42 |
holiday: setting.holiday |
|
43 |
}) |
|
44 |
} |
|
45 |
|
|
46 |
function changeHoliday(newValue) { |
|
47 |
setSetting( |
|
48 |
{sickday: setting.sickday, |
|
49 |
holiday: newValue |
|
42 |
holiday: 0 |
|
50 | 43 |
}) |
51 | 44 |
} |
52 | 45 |
|
53 | 46 |
return ( |
54 | 47 |
<div className="container"> |
55 | 48 |
<div className="setting-container column"> |
56 |
<h2>Nastavení</h2>
|
|
49 |
<h2>Setting</h2>
|
|
57 | 50 |
<div className="underline-2"></div> |
58 | 51 |
<form onSubmit={(e) => submitSetting(e)} className="setting-form column"> |
59 | 52 |
<label><h3>Sick days</h3></label> |
60 | 53 |
<input onChange={(e) => changeSickday(e.target.value)} value={setting.sickday} type="number" min="0" /> |
61 |
<label><h3>Holiday</h3></label> |
|
62 |
<input onChange={(e) => changeHoliday(e.target.value)} value={setting.holiday} type="number" min="0" /> |
|
63 | 54 |
<div className="buttons row"> |
64 | 55 |
<Link to="/"><button className="btn btn-cancel" type="submit" value="Cancel">Cancel</button></Link> |
65 |
<button className="btn btn-submit" type="submit" value="Submit">Submit</button>
|
|
56 |
<button className="btn btn-submit" type="submit" value="Submit">Save</button>
|
|
66 | 57 |
</div> |
67 | 58 |
</form> |
68 | 59 |
</div> |
Také k dispozici: Unified diff
re #58 Rewrited client app to React #58 // yoso internal app // in progress #60 // fixed