Skip to content

Commit

Permalink
Chore (#4)
Browse files Browse the repository at this point in the history
* fix: add madamis button z index

* fix: played player remove algorithm

* fix: calender format
  • Loading branch information
Simirall authored Aug 21, 2024
1 parent 769d155 commit 979f215
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 31 deletions.
10 changes: 9 additions & 1 deletion src/pages/components/AddMadamisButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@ export const AddMadamisButton = () => {
const { createOpen } = useMadamisModalStore();
return (
<>
<Box pos="fixed" bottom="0" right="0" p="sm">
<Box
pos="fixed"
bottom="0"
right="0"
p="sm"
style={{
zIndex: 1,
}}
>
<ActionIcon
variant="filled"
color="orange"
Expand Down
46 changes: 16 additions & 30 deletions src/pages/components/GameModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,7 @@ export const GameModal = () => {
() =>
madamis?.games
.filter((g) => (gameId ? g.id !== gameId : true))
.flatMap((g) =>
g.gameUsers
.filter((u) => (madamis.gmRequired ? !u.gm : true))
.map((u) => u.id.toString())
),
.flatMap((g) => g.gameUsers.map((u) => u.id.toString())),
[madamis]
);

Expand Down Expand Up @@ -168,31 +164,17 @@ export const GameModal = () => {
}}
>
<Group gap="sm" justify="center">
{madamis.gmRequired
? users
.filter(
(u) =>
u.id.toString() !== watch("gm") &&
!playersToRemove?.includes(u.id.toString())
)
.map((u) => (
<Chip
value={u.id.toString()}
key={u.id}
color="teal"
>
{u.name}
</Chip>
))
: users.map((u) => (
<Chip
value={u.id.toString()}
key={u.id}
color="teal"
>
{u.name}
</Chip>
))}
{users
.filter(
(u) =>
u.id.toString() !== watch("gm") &&
!playersToRemove?.includes(u.id.toString())
)
.map((u) => (
<Chip value={u.id.toString()} key={u.id} color="teal">
{u.name}
</Chip>
))}
</Group>
</Chip.Group>
{errors.players && (
Expand All @@ -211,6 +193,10 @@ export const GameModal = () => {
}
}}
label="開催日"
weekdayFormat="ddd"
monthsListFormat="MM"
decadeLabelFormat="YYYY"
monthLabelFormat="YYYY/MM"
valueFormat="YYYY/MM/DD"
firstDayOfWeek={0}
error={errors.date?.message}
Expand Down

0 comments on commit 979f215

Please sign in to comment.