-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #252 from h8570rg/develop
Release v0.1.1
- Loading branch information
Showing
17 changed files
with
250 additions
and
100 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
app/(main)/(components)/ReleaseNotes/ReleaseNotesModal/versions/0_1_1.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,11 @@ | ||
export default function ReleaseNotes_0_1_0() { | ||
return ( | ||
<> | ||
<h2>Version 0.1.1</h2> | ||
<ol className="list-inside list-disc"> | ||
<li>ゲーム結果削除機能追加</li> | ||
<li>ゲーム入力において一部端末で画面が拡大してしまう問題の修正</li> | ||
</ol> | ||
</> | ||
); | ||
} |
2 changes: 2 additions & 0 deletions
2
app/(main)/(components)/ReleaseNotes/ReleaseNotesModal/versions/index.ts
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,5 +1,7 @@ | ||
import V0_1_0 from "./0_1_0"; | ||
import V0_1_1 from "./0_1_1"; | ||
|
||
export const versionComponents = { | ||
"0.1.0": V0_1_0, | ||
"0.1.1": V0_1_1, | ||
} as const; |
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
33 changes: 33 additions & 0 deletions
33
...routes)/matches/(routes)/[matchId]/(components)/MatchTable/(components)/GameRow/index.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,33 @@ | ||
"use client"; | ||
|
||
import { Card } from "@/components/Card"; | ||
import { GameUpdateModal, useGameUpdateModal } from "../GameUpdateModal"; | ||
|
||
export function GameRow({ | ||
index, | ||
className, | ||
children, | ||
matchId, | ||
gameId, | ||
}: { | ||
index: number; | ||
className?: string; | ||
children: React.ReactNode; | ||
matchId: string; | ||
gameId: string; | ||
}) { | ||
const gameUpdateModal = useGameUpdateModal(); | ||
return ( | ||
<> | ||
<Card isPressable className={className} onPress={gameUpdateModal.onOpen}> | ||
{children} | ||
</Card> | ||
<GameUpdateModal | ||
{...gameUpdateModal.bind} | ||
index={index} | ||
matchId={matchId} | ||
gameId={gameId} | ||
/> | ||
</> | ||
); | ||
} |
17 changes: 17 additions & 0 deletions
17
...)/MatchTable/(components)/GameUpdateModal/(components)/GameDeleteConfirmDialog/actions.ts
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,17 @@ | ||
"use server"; | ||
|
||
import { revalidatePath } from "next/cache"; | ||
import { serverServices } from "@/lib/services/server"; | ||
|
||
export async function deleteGame({ | ||
gameId, | ||
matchId, | ||
}: { | ||
gameId: string; | ||
matchId: string; | ||
}) { | ||
const { deleteGame } = await serverServices(); | ||
await deleteGame({ gameId }); | ||
|
||
revalidatePath(`/matches/${matchId}`); | ||
} |
54 changes: 54 additions & 0 deletions
54
...s)/MatchTable/(components)/GameUpdateModal/(components)/GameDeleteConfirmDialog/index.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,54 @@ | ||
"use client"; | ||
|
||
import { Button } from "@/components/Button"; | ||
import { | ||
Modal, | ||
ModalContent, | ||
ModalFooter, | ||
ModalHeader, | ||
ModalProps, | ||
useModal, | ||
} from "@/components/Modal"; | ||
import { deleteGame } from "./actions"; | ||
|
||
export function GameDeleteConfirmDialog({ | ||
matchId, | ||
gameId, | ||
...props | ||
}: Omit<ModalProps, "children"> & { | ||
matchId: string; | ||
gameId: string; | ||
}) { | ||
return ( | ||
<Modal {...props} hideCloseButton placement="center"> | ||
<ModalContent> | ||
{(onClose) => ( | ||
<> | ||
<ModalHeader>本当に削除しますか?</ModalHeader> | ||
<ModalFooter> | ||
<Button variant="light" onPress={onClose}> | ||
キャンセル | ||
</Button> | ||
<Button | ||
color="danger" | ||
variant="flat" | ||
onPress={() => { | ||
deleteGame({ | ||
gameId, | ||
matchId, | ||
}).catch((e) => { | ||
throw e; | ||
}); | ||
}} | ||
> | ||
削除 | ||
</Button> | ||
</ModalFooter> | ||
</> | ||
)} | ||
</ModalContent> | ||
</Modal> | ||
); | ||
} | ||
|
||
export { useModal as useGameDeleteConfirmDialog }; |
64 changes: 64 additions & 0 deletions
64
...matches/(routes)/[matchId]/(components)/MatchTable/(components)/GameUpdateModal/index.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,64 @@ | ||
"use client"; | ||
|
||
import { Button } from "@/components/Button"; | ||
import { | ||
Modal, | ||
ModalContent, | ||
ModalFooter, | ||
ModalHeader, | ||
ModalProps, | ||
useModal, | ||
} from "@/components/Modal"; | ||
import { | ||
GameDeleteConfirmDialog, | ||
useGameDeleteConfirmDialog, | ||
} from "./(components)/GameDeleteConfirmDialog"; | ||
|
||
export function GameUpdateModal({ | ||
matchId, | ||
gameId, | ||
index, | ||
...props | ||
}: Omit<ModalProps, "children"> & { | ||
matchId: string; | ||
gameId: string; | ||
index: number; | ||
}) { | ||
const gameDeleteConfirmDialog = useGameDeleteConfirmDialog(); | ||
return ( | ||
<> | ||
<Modal {...props} hideCloseButton> | ||
<ModalContent> | ||
{(onClose) => ( | ||
<> | ||
<ModalHeader>{index + 1}ゲーム目</ModalHeader> | ||
<ModalFooter> | ||
<Button | ||
className="mr-auto" | ||
color="danger" | ||
variant="flat" | ||
onPress={gameDeleteConfirmDialog.onOpen} | ||
> | ||
削除 | ||
</Button> | ||
<Button variant="light" onPress={onClose}> | ||
キャンセル | ||
</Button> | ||
<Button type="submit" color="primary" onPress={onClose}> | ||
OK | ||
</Button> | ||
</ModalFooter> | ||
</> | ||
)} | ||
</ModalContent> | ||
</Modal> | ||
<GameDeleteConfirmDialog | ||
{...gameDeleteConfirmDialog.bind} | ||
matchId={matchId} | ||
gameId={gameId} | ||
/> | ||
</> | ||
); | ||
} | ||
|
||
export { useModal as useGameUpdateModal }; |
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 |
---|---|---|
|
@@ -100,4 +100,11 @@ export default tseslint.config( | |
], | ||
}, | ||
}, | ||
{ | ||
settings: { | ||
tailwindcss: { | ||
callees: ["classNames"], | ||
}, | ||
}, | ||
}, | ||
); |
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,9 @@ | ||
import { Supabase } from "."; | ||
|
||
export const gameService = (supabase: Supabase) => { | ||
return { | ||
deleteGame: async ({ gameId }: { gameId: string }) => { | ||
await supabase.from("games").delete().match({ id: gameId }); | ||
}, | ||
}; | ||
}; |
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.