-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
36942a6
commit 33b7744
Showing
15 changed files
with
361 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
'use client' | ||
|
||
import Box from '@mui/joy/Box' | ||
|
||
import Divider from '@mui/joy/Divider' | ||
import { Skeleton } from '@mui/joy' | ||
|
||
import { CreateTask } from '../components/CreateTask' | ||
import { CreateTaskFormProvider } from '../providers/CreateTaskFormProvider' | ||
|
||
export default function Loading() { | ||
return ( | ||
<Box | ||
sx={{ | ||
display: 'grid', | ||
gridTemplateAreas: { | ||
xs: "'divider-1 divider-1''select-template start-timer''divider-2 divider-2''create-task-form create-task-form''task-list task-list'", | ||
sm: "'divider-1 divider-1''select-template start-timer''divider-2 divider-2''create-task-form task-list'" | ||
}, | ||
gridTemplateColumns: { | ||
xs: '1fr', | ||
sm: '558px 558px' | ||
}, | ||
columnGap: '30px', | ||
rowGap: '16px', | ||
margin: '0 auto' | ||
}} | ||
> | ||
<Divider sx={{ gridArea: 'divider-1' }} /> | ||
|
||
<CreateTaskFormProvider> | ||
<CreateTask projects={[]} taskTypes={[]} templates={[]} /> | ||
|
||
<Divider sx={{ gridArea: 'divider-2' }} /> | ||
|
||
<Box sx={{ gridArea: 'task-list', position: 'relative' }}> | ||
<Skeleton width="100%" height="96px" /> | ||
</Box> | ||
</CreateTaskFormProvider> | ||
</Box> | ||
) | ||
} |
2 changes: 1 addition & 1 deletion
2
frontend/src/app/tasks/page.tsx → frontend/src/app/tasks/[[...date]]/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import { useSearchParams } from 'next/navigation' | ||
import { useParams } from 'next/navigation' | ||
import { getDateFromParam } from '../utils/time' | ||
import { useMemo } from 'react' | ||
|
||
export const useDateParam = () => { | ||
const searchParams = useSearchParams() | ||
const params = useParams() | ||
|
||
return useMemo(() => { | ||
const dateParam = searchParams.get('date') | ||
const dateParam = params.date ? params.date[0] : '' | ||
const date = getDateFromParam(dateParam) | ||
return { date, dateParam } | ||
}, [searchParams]) | ||
}, [params.date]) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
frontend/src/app/tasks/month/[[...date]]/components/WeekDays.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { Typography } from '@mui/joy' | ||
|
||
const WEEK_DAYS = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'] | ||
|
||
export const WeekDays = () => { | ||
return WEEK_DAYS.map((day) => { | ||
return ( | ||
<Typography | ||
sx={{ | ||
textAlign: 'center', | ||
padding: { xs: '8px', sm: '22px 16px' }, | ||
borderBottom: '1px solid #C4C6D0', | ||
borderTop: '1px solid #C4C6D0', | ||
borderRight: '1px solid #C4C6D0', | ||
':first-of-type': { borderLeft: '1px solid #C4C6D0' }, | ||
':nth-of-type(7n)': { borderRight: { sm: 'none' }, borderLeft: { sm: 'none' } }, | ||
fontWeight: '600', | ||
backgroundColor: '#fff', | ||
fontSize: { xs: '0px', sm: '1rem' }, | ||
':first-letter': { fontSize: '1rem' } | ||
}} | ||
component="div" | ||
key={day} | ||
> | ||
{day} | ||
</Typography> | ||
) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
'use client' | ||
|
||
import { Box, Skeleton, Typography } from '@mui/joy' | ||
import { WeekDays } from './components/WeekDays' | ||
import { useDateParam } from '../../hooks/useDateParam' | ||
import { format } from 'date-fns' | ||
|
||
export default function Loading() { | ||
const { date } = useDateParam() | ||
|
||
return ( | ||
<> | ||
<Typography | ||
sx={{ | ||
fontSize: { xs: 'lg', sm: 'xl4' } | ||
}} | ||
level="h1" | ||
textAlign="center" | ||
> | ||
{format(date, 'MMMM yyy')} | ||
</Typography> | ||
<Box | ||
sx={{ | ||
display: 'grid', | ||
gridTemplateColumns: 'repeat(7,minmax(0,1fr))' | ||
}} | ||
alignItems="stretch" | ||
height="100%" | ||
> | ||
<WeekDays /> | ||
{Array.from(Array(35).keys()).map((_, index) => { | ||
return ( | ||
<Box | ||
sx={{ | ||
backgroundColor: '#fff', | ||
padding: { xs: '4px', sm: '22px 16px' }, | ||
height: { xs: '77px', sm: '185px' }, | ||
borderBottom: '1px solid #C4C6D0', | ||
borderRight: '1px solid #C4C6D0', | ||
':nth-of-type(7n + 1)': { borderLeft: { xs: '1px solid #C4C6D0', sm: 'none' } }, | ||
':nth-of-type(7n)': { borderRight: { sm: 'none' }, borderLeft: { sm: 'none' } }, | ||
display: 'flex', | ||
flexDirection: 'column', | ||
gap: '4px', | ||
overflow: 'auto' | ||
}} | ||
key={index} | ||
> | ||
<Box | ||
sx={{ | ||
width: '100%', | ||
position: 'relative', | ||
height: '27px' | ||
}} | ||
> | ||
<Skeleton /> | ||
</Box> | ||
<Box | ||
sx={{ | ||
display: 'flex', | ||
flexDirection: { xs: 'column', sm: 'row' }, | ||
gap: { xs: '4px ', sm: '8px' } | ||
}} | ||
> | ||
<Box sx={{ position: 'relative', width: '100%', height: '74px' }}> | ||
<Skeleton /> | ||
</Box> | ||
</Box> | ||
</Box> | ||
) | ||
})} | ||
</Box> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.