Skip to content

Commit

Permalink
Fix subject picker modal layout
Browse files Browse the repository at this point in the history
  • Loading branch information
P-man2976 committed Jan 11, 2024
1 parent 9f668b2 commit 88b4d6a
Showing 1 changed file with 32 additions and 31 deletions.
63 changes: 32 additions & 31 deletions src/components/timetable/editor/UserSubjectPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,39 +179,40 @@ const UserSubjectPicker = React.memo(
)}
{/* eslint-enable no-nested-ternary */}
</VStack>
{createMode ? (
<Button
w="full"
rounded="lg"
colorScheme="blue"
isDisabled={!subject.name}
isLoading={isPending}
onClick={() =>
mutate(subject as UserSubject, {
onSuccess: (res) => {
onSelect(res._id);
},
})
}
>
追加
</Button>
) : (
<Button
w="full"
rounded="lg"
leftIcon={<Icon as={TbPlus} />}
onClick={() => {
setCreateMode(true);
setSubject((val) => ({ ...val, name: searchQuery }));
}}
>
作成する
</Button>
)}
</VStack>
</ModalBody>
<ModalFooter />
<ModalFooter>
{createMode ? (
<Button
w="full"
rounded="lg"
colorScheme="blue"
isDisabled={!subject.name}
isLoading={isPending}
onClick={() =>
mutate(subject as UserSubject, {
onSuccess: (res) => {
onSelect(res._id);
},
})
}
>
追加
</Button>
) : (
<Button
w="full"
rounded="lg"
leftIcon={<Icon as={TbPlus} />}
onClick={() => {
setCreateMode(true);
setSubject((val) => ({ ...val, name: searchQuery }));
}}
>
作成する
</Button>
)}
</ModalFooter>
</ModalContent>
</Modal>
);
Expand Down

0 comments on commit 88b4d6a

Please sign in to comment.