Skip to content

Commit a0154b4

Browse files
authored
Merge pull request #720 from Black-Dot-2024/staging
release(main)
2 parents 225604b + f1b52e9 commit a0154b4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+3847
-1778
lines changed

src/App.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@
2020
filter: drop-shadow(0 0 2em #61dafbaa);
2121
}
2222

23+
.login-bg {
24+
background-image: url('assets/images/bg-mobile.png');
25+
}
26+
27+
@media (min-width: 600px) {
28+
.login-bg {
29+
background-image: url('assets/images/login-image.png');
30+
}
31+
}
32+
2333
@keyframes logo-spin {
2434
from {
2535
transform: rotate(0deg);

src/App.tsx

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { configDayjs } from './lib/dayjs/dayjs';
1414
import Auth from './pages/Auth';
1515
import Clients from './pages/Clients';
1616
import Employees from './pages/Employees';
17+
import Expenses from './pages/Expenses';
1718
import Home from './pages/Home';
1819
import Projects from './pages/Projects';
1920
import Tasks from './pages/Tasks';
@@ -39,7 +40,7 @@ function App() {
3940
setState(s => {
4041
return { ...s, open: false };
4142
}),
42-
2000
43+
3000
4344
);
4445
}
4546
}, [state]);
@@ -51,7 +52,7 @@ function App() {
5152
<OfflineModal />
5253
<Router>
5354
<Routes>
54-
{<Route path={RoutesPath.ROOT} element={<Auth />} />}
55+
<Route path={RoutesPath.ROOT} element={<Auth />} />
5556
<Route element={<Layout children={<Outlet />} />}>
5657
<Route
5758
path={RoutesPath.HOME}
@@ -93,11 +94,24 @@ function App() {
9394
</ProtectedRoute>
9495
}
9596
/>
97+
<Route
98+
path={`${RoutesPath.EXPENSES}/*`}
99+
element={
100+
<ProtectedRoute>
101+
<Expenses />
102+
</ProtectedRoute>
103+
}
104+
/>
96105
</Route>
97106
<Route path='*' element={<NotFoundPage />} />
98107
</Routes>
99108
</Router>
100-
<Snackbar open={state.open} color={state.type ?? 'neutral'} variant='solid'>
109+
<Snackbar
110+
open={state.open}
111+
color={state.type ?? 'neutral'}
112+
variant='solid'
113+
sx={{ marginLeft: '10px' }}
114+
>
101115
{state.message}
102116
</Snackbar>
103117
</SnackbarContext.Provider>

src/assets/images/bg-mobile.png

434 KB
Loading

src/components/common/AddButton.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const AddButton: React.FC<AddButtonProps> = ({ onClick }: AddButtonProps) => {
1414
size='sm'
1515
sx={{
1616
backgroundColor: colors.darkGold,
17+
1718
'&:hover': {
1819
backgroundColor: colors.darkerGold,
1920
},

src/components/common/ArchiveModal.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export default function ArchiveModal({
4949
<Modal
5050
open={open}
5151
onClose={() => setOpen(false)}
52-
sx={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}
52+
sx={{ display: 'flex', justifyContent: 'center', alignItems: 'center', padding: '0 20px' }}
5353
>
5454
<Sheet
5555
variant='outlined'
@@ -73,13 +73,7 @@ export default function ArchiveModal({
7373
<Typography id='modal-desc' textColor='text.tertiary' sx={{ py: 1 }}>
7474
{description}
7575
</Typography>
76-
<Alert
77-
size='lg'
78-
sx={{ mt: 2, pr: 8, border: '#333333' }}
79-
startDecorator={<InfoIcon />}
80-
variant='soft'
81-
color='primary'
82-
>
76+
<Alert size='lg' startDecorator={<InfoIcon />} variant='soft' color='primary'>
8377
Don't worry, this action can be undone.
8478
</Alert>
8579
<Box mt={3} display='flex' alignItems='center' justifyContent='end' gap={2} sx={{}}>

src/components/common/CardContainer.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export default function CardContainer({ children }: CardContainerProps) {
2020
sx={{
2121
bgcolor: '#EFEFEF',
2222
maxWidth: '100%',
23+
padding: '16px',
2324
transition: 'background-color 0.3s',
2425
'&:hover': {
2526
bgcolor: '#DEDEDE',

src/components/common/ClientCard.tsx

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,17 @@ interface ClientCardProps {
1818
totalProjects: number;
1919
}
2020

21+
const styles = {
22+
fontSize: '13px',
23+
overflow: 'hidden',
24+
textOverflow: 'ellipsis',
25+
whiteSpace: 'nowrap',
26+
minWidth: '70%',
27+
'@media (min-width: 400px)': {
28+
minWidth: 'fit-content',
29+
},
30+
};
31+
2132
const ClientCard = ({
2233
name,
2334
accountingHours,
@@ -33,33 +44,27 @@ const ClientCard = ({
3344
{name}
3445
</span>
3546
</header>
36-
<div className='grid grid-cols-2 gap-2'>
47+
<div className='flex flex-wrap gap-2'>
3748
<Chip
3849
sx={{
3950
bgcolor: colors.orangeChip,
40-
fontSize: '13px',
51+
...styles,
4152
}}
4253
>
4354
Accounting Hours: {accountingHours}
4455
</Chip>
4556
<Chip
4657
sx={{
4758
bgcolor: colors.orangeChip,
48-
fontSize: '13px',
49-
overflow: 'hidden',
50-
textOverflow: 'ellipsis',
51-
whiteSpace: 'nowrap',
59+
...styles,
5260
}}
5361
>
5462
Legal Hours: {legalHours}
5563
</Chip>
5664
<Chip
5765
sx={{
5866
bgcolor: colors.brownChip,
59-
fontSize: '13px',
60-
overflow: 'hidden',
61-
textOverflow: 'ellipsis',
62-
whiteSpace: 'nowrap',
67+
...styles,
6368
}}
6469
>
6570
Chargeable Hours: {chargeableHours}
@@ -69,10 +74,7 @@ const ClientCard = ({
6974
bgcolor: colors.blueChip,
7075
color: '#0B6BCB',
7176
border: '1px solid #97C3F0',
72-
fontSize: '13px',
73-
overflow: 'hidden',
74-
textOverflow: 'ellipsis',
75-
whiteSpace: 'nowrap',
77+
...styles,
7678
}}
7779
>
7880
Total Projects: {totalProjects}

src/components/common/ComponentPlaceholder.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ import animation from '../../assets/data-not-found.json';
1212
*/
1313
const ComponentPlaceholder = ({
1414
text = 'Content is on the way...',
15-
height = '25vh',
16-
width = '35vh',
15+
height = '20vh',
16+
width = '25vh',
1717
}) => {
1818
return (
1919
<div
2020
style={{
2121
width: '100%',
22-
height: '100%',
22+
height: 'fit-content',
2323
display: 'flex',
2424
flexDirection: 'column',
2525
justifyContent: 'center',
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
import WarningIcon from '@mui/icons-material/Warning';
2+
import Alert from '@mui/joy/Alert';
3+
import Box from '@mui/joy/Box';
4+
import Button from '@mui/joy/Button';
5+
import Modal from '@mui/joy/Modal';
6+
import ModalClose from '@mui/joy/ModalClose';
7+
import Sheet from '@mui/joy/Sheet';
8+
import Typography from '@mui/joy/Typography';
9+
import * as React from 'react';
10+
import { Link } from 'react-router-dom';
11+
import Colors from '../../colors';
12+
13+
interface ModalInterface {
14+
open: boolean;
15+
url: string | undefined | null;
16+
setOpen: React.Dispatch<React.SetStateAction<boolean>>;
17+
toggleModal?: () => void;
18+
handleOnClick: () => void;
19+
alertColor?: string;
20+
}
21+
22+
export default function CreateConfirmationModal({
23+
open,
24+
setOpen,
25+
url,
26+
handleOnClick,
27+
}: ModalInterface) {
28+
const handleOnConfirm = () => {
29+
setOpen(false);
30+
handleOnClick();
31+
};
32+
33+
return (
34+
<>
35+
<Modal
36+
open={open}
37+
onClose={() => setOpen(false)}
38+
sx={{ display: 'flex', justifyContent: 'center', alignItems: 'center', padding: '0 20px' }}
39+
>
40+
<Sheet
41+
variant='outlined'
42+
sx={{
43+
borderRadius: 'md',
44+
p: 4,
45+
boxShadow: 'lg',
46+
}}
47+
>
48+
<ModalClose variant='plain' sx={{ m: 1 }} />
49+
<Typography
50+
component='h2'
51+
id='modal-title'
52+
level='h3'
53+
textColor='inherit'
54+
fontWeight='lg'
55+
mb={1}
56+
>
57+
Confirm before submitting
58+
</Typography>
59+
<Typography id='modal-desc' textColor='text.tertiary' sx={{ py: 1 }}>
60+
Verify that the URL is correct{' '}
61+
<Link
62+
to={url as string}
63+
target={'_blank'}
64+
className='underline whitespace-break-spaces break-all'
65+
>
66+
{url}
67+
</Link>
68+
</Typography>
69+
<Alert
70+
size='lg'
71+
startDecorator={<WarningIcon />}
72+
variant='soft'
73+
color={'danger'}
74+
sx={{ marginTop: '10px' }}
75+
>
76+
This action cannot be undone.
77+
</Alert>
78+
<Box mt={3} display='flex' alignItems='center' justifyContent='end' gap={2} sx={{}}>
79+
<Button
80+
onClick={() => setOpen(false)}
81+
variant='outlined'
82+
size='lg'
83+
sx={{
84+
color: Colors.darkGold,
85+
borderColor: Colors.darkGold,
86+
'&:hover': {
87+
backgroundColor: Colors.lightGold,
88+
},
89+
}}
90+
>
91+
Cancel
92+
</Button>
93+
<Button
94+
size='lg'
95+
sx={{
96+
backgroundColor: Colors.darkGold,
97+
'&:hover': {
98+
backgroundColor: Colors.darkerGold,
99+
},
100+
}}
101+
onClick={() => handleOnConfirm()}
102+
>
103+
Submit
104+
</Button>
105+
</Box>
106+
</Sheet>
107+
</Modal>
108+
</>
109+
);
110+
}

src/components/common/DatePicker.tsx

Lines changed: 0 additions & 65 deletions
This file was deleted.

0 commit comments

Comments
 (0)