diff options
-rw-r--r-- | package-lock.json | 15 | ||||
-rw-r--r-- | package.json | 2 | ||||
-rw-r--r-- | src/App.jsx | 23 | ||||
-rw-r--r-- | src/Entry.jsx | 4 | ||||
-rw-r--r-- | src/Result.jsx | 10 |
5 files changed, 45 insertions, 9 deletions
diff --git a/package-lock.json b/package-lock.json index f745901..ad0ae57 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,6 +11,8 @@ "@emotion/react": "^11.11.1", "@emotion/styled": "^11.11.0", "@fontsource/roboto": "^5.0.8", + "@mdi/js": "^7.2.96", + "@mdi/react": "^1.6.1", "@mui/icons-material": "^5.14.11", "@mui/material": "^5.14.11", "@mui/x-date-pickers": "^6.16.0", @@ -1076,6 +1078,19 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@mdi/js": { + "version": "7.2.96", + "resolved": "https://registry.npmjs.org/@mdi/js/-/js-7.2.96.tgz", + "integrity": "sha512-paR9M9ZT7rKbh2boksNUynuSZMHhqRYnEZOm/KrZTjQ4/FzyhjLHuvw/8XYzP+E7fS4+/Ms/82EN1pl/OFsiIA==" + }, + "node_modules/@mdi/react": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@mdi/react/-/react-1.6.1.tgz", + "integrity": "sha512-4qZeDcluDFGFTWkHs86VOlHkm6gnKaMql13/gpIcUQ8kzxHgpj31NuCkD8abECVfbULJ3shc7Yt4HJ6Wu6SN4w==", + "dependencies": { + "prop-types": "^15.7.2" + } + }, "node_modules/@mui/base": { "version": "5.0.0-beta.17", "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-beta.17.tgz", diff --git a/package.json b/package.json index a6425d8..851d322 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,8 @@ "@emotion/react": "^11.11.1", "@emotion/styled": "^11.11.0", "@fontsource/roboto": "^5.0.8", + "@mdi/js": "^7.2.96", + "@mdi/react": "^1.6.1", "@mui/icons-material": "^5.14.11", "@mui/material": "^5.14.11", "@mui/x-date-pickers": "^6.16.0", diff --git a/src/App.jsx b/src/App.jsx index a53e59b..db340da 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -7,13 +7,15 @@ import SalaryInput from "./SalaryInput.jsx"; import Result from "./Result.jsx"; import RemoveCircleIcon from '@mui/icons-material/RemoveCircle'; import AddCircleIcon from '@mui/icons-material/AddCircle'; +import Icon from '@mdi/react'; +import { mdiGitlab } from '@mdi/js'; function App() { const [baseSalary, setBaseSalary] = useState(0); const [listEntry, setListEntry] = useState( [ - {id: 0, date: dayjs(), start: dayjs(), finish: dayjs()}, + {id: 0, date: dayjs(), start: dayjs().set('hour', 17).set('minute', 30), finish: dayjs().set('hour', 18).set('minute', 30)}, ] ); const [removeDisabled, setRemoveDisabled] = useState(false); @@ -125,12 +127,19 @@ function App() { <li><Typography>Belum termasuk versi 6 hari kerja (todo)</Typography></li> <li><Typography>UI belum responsive (todo)</Typography></li> </ul> - <Typography paragraph={true} padding={'10px'} marginTop={'5px'}> - <a href='https://gitlab.com/rosyidharyadi/overreact' target='_blank'>Source</a> - </Typography> - <Typography variant='overline' display='block' align='center' padding={'10px'} marginTop={'5px'}> - Rosyid - </Typography> + <div style={{textAlign: 'center'}}> + <a href='https://gitlab.com/rosyidharyadi/overreact' target='_blank'> + <Icon path={mdiGitlab} + title="Repository" + size={2} + // horizontal + // vertical + // rotate={90} + color="blue" + spin + /> + </a> + </div> </Paper> </Grid> </Grid> diff --git a/src/Entry.jsx b/src/Entry.jsx index c486680..6c57903 100644 --- a/src/Entry.jsx +++ b/src/Entry.jsx @@ -22,7 +22,7 @@ function Entry({propId, propDate, propStart, propFinish, handleEntryChange}) { <TimePicker label="Mulai" ampm={false} value={start} - maxTime={finish} + // maxTime={finish} onAccept={(newStart) => { setStart(newStart); handleEntryChange({id: propId, start: newStart}, 'start') @@ -31,7 +31,7 @@ function Entry({propId, propDate, propStart, propFinish, handleEntryChange}) { <TimePicker label="Selesai" ampm={false} value={finish} - minTime={start} + // minTime={start} onAccept={(newFinish) => { setFinish(newFinish); handleEntryChange({id: propId, finish: newFinish}, 'finish') diff --git a/src/Result.jsx b/src/Result.jsx index dd977c5..3ba9a4e 100644 --- a/src/Result.jsx +++ b/src/Result.jsx @@ -9,6 +9,16 @@ function Result({listEntry, baseSalary}) { setTotalOvertimePay(getOvertimePayTotal(listEntry, baseSalary)); }, [listEntry, baseSalary]); + if (totalOvertimePay < 0) { + return ( + <Container> + <Typography variant='h5'> + Waktu selesai mendahului waktu mulai. Mohon diperbaiki input. + </Typography> + </Container> + ) + } + return ( <Container> <Typography variant='h5'> |