Skip to content

Commit

Permalink
feat: 試合生成ボタンを予選選択時にしか押せないように
Browse files Browse the repository at this point in the history
  • Loading branch information
tufusa committed Oct 24, 2024
1 parent d8ac225 commit 17ab1b0
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions packages/kcmsf/src/pages/matchList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
Flex,
List,
Loader,
Stack,
Table,
Text,
Title,
Expand Down Expand Up @@ -111,17 +112,8 @@ export const MatchList = () => {
}, []); // eslint-disable-line react-hooks/exhaustive-deps

return (
<Flex
direction="column"
justify="center"
align="center"
gap="md"
w="fit-content"
mx="auto"
>
<Title order={1} m="1rem">
試合表
</Title>
<Stack justify="center" align="center" gap="md" w="fit-content">
<Title m="1rem">試合表</Title>
<MatchSegmentedControl
matchType={matchType}
setMatchType={setMatchType}
Expand Down Expand Up @@ -165,29 +157,30 @@ export const MatchList = () => {
generate={async () => {
await Promise.all(
config.departmentTypes.map((departmentType) =>
generateMatch("pre", departmentType)
generateMatch(matchType, departmentType)
)
);
fetchMatches();
}}
modalTitle="予選試合表生成確認"
modalTitle={`${config.match[matchType].name}試合表生成確認`}
modalDetail={
<>
以下の試合表を生成します:
<List withPadding>
{config.departmentTypes.map((departmentType) => (
<List.Item key={departmentType}>
{config.match.pre.name}&emsp;
{config.match[matchType].name}&emsp;
{config.department[departmentType].name}
</List.Item>
))}
</List>
</>
}
disabled={matchType != "pre"} // TODO: 本戦試合も生成できるように
/>
</>
)}
</Flex>
</Stack>
);
};

Expand Down

0 comments on commit 17ab1b0

Please sign in to comment.