commit f9699fde2bafed62bc8f7ced8c367387c1de455a
parent 5320da3a48b252d3faaf71c178aa01a38f53c7b3
Author: Yuukin256 <52195426+Yuukin256@users.noreply.github.com>
Date: Fri, 11 Nov 2022 23:09:48 +0900
Merge pull request #2 from Yuukin256/dev
時間割の表示順のバグ修正
Diffstat:
3 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/src/components/layouts/Layout.tsx b/src/components/layouts/Layout.tsx
@@ -32,7 +32,7 @@ const Layout: FC<Props> = ({ children, title }) => {
})}
>
<AppBar position='sticky'>
- <Toolbar variant='dense' sx={{ color: 'white' }}>
+ <Toolbar sx={{ color: '#fff' }}>
<IconButton
color='inherit'
title='ホームに戻る'
@@ -69,7 +69,6 @@ const Layout: FC<Props> = ({ children, title }) => {
>
<main>{children}</main>
</Box>
- <Box sx={{ px: 2, py: 1, fontSize: 14, fontFamily: 'serif' }}>大阪府立岸和田高等学校</Box>
</Container>
);
};
diff --git a/src/pages/[class].tsx b/src/pages/[class].tsx
@@ -1,3 +1,4 @@
+import { Temporal } from '@js-temporal/polyfill';
import Box from '@mui/material/Box';
import { format, isEqual } from 'date-fns';
import { Map } from 'immutable';
@@ -107,7 +108,9 @@ const Page: NextPage<PageProps> = (props) => {
<Head title={`${props.grade}-${props.class}`} />
<Layout title={`${props.grade}-${props.class}`}>
{Object.keys(props.calendar).length ? (
- <DailyView calendar={Map(props.calendar)} />
+ <DailyView
+ calendar={Map(props.calendar).sortBy((_, key) => Temporal.PlainDate.from(key), Temporal.PlainDate.compare)}
+ />
) : (
<Box px={2}>
<p>データがありません</p>
diff --git a/src/pages/console/timetable.tsx b/src/pages/console/timetable.tsx
@@ -114,7 +114,7 @@ const Page: NextPage = () => {
</Box>
<Stack direction='row' spacing={1} alignItems='flex-start'>
- <IconButton onClick={() => setDate((old) => old.subtract({ days: 1 }))}>
+ <IconButton disabled={loading} onClick={() => setDate((old) => old.subtract({ days: 1 }))}>
<ChevronLeftIcon />
</IconButton>
<Box width='12rem'>
@@ -123,12 +123,13 @@ const Page: NextPage = () => {
onChange={(newValue) => {
isValid(newValue) && setDate(dateToPlainDate(newValue as Date));
}}
+ disabled={loading}
inputFormat='yyyy/MM/dd (EEEEE)'
disableMaskedInput
renderInput={(params) => <TextField {...params} />}
/>
</Box>
- <IconButton onClick={() => setDate((old) => old.add({ days: 1 }))}>
+ <IconButton disabled={loading} onClick={() => setDate((old) => old.add({ days: 1 }))}>
<ChevronRightIcon />
</IconButton>
</Stack>