-
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 #178 from h8570rg/develop
Prd
- Loading branch information
Showing
25 changed files
with
393 additions
and
297 deletions.
There are no files selected for viewing
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
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
44 changes: 44 additions & 0 deletions
44
app/(main)/(routes)/matches/(routes)/[matchId]/(components)/DataModal/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,44 @@ | ||
"use client"; | ||
|
||
import { forwardRef } from "react"; | ||
import { | ||
Modal, | ||
ModalBody, | ||
ModalContent, | ||
ModalFooter, | ||
ModalHeader, | ||
} from "@/components/Modal"; | ||
import { useMatchContext } from "../../context"; | ||
|
||
export function DataModal() { | ||
const { dataModal } = useMatchContext(); | ||
|
||
return ( | ||
<Modal size="full" {...dataModal.bind}> | ||
<ModalContent> | ||
<ModalHeader>データ</ModalHeader> | ||
<ModalBody>todo</ModalBody> | ||
{/* スペーサーとして */} | ||
<ModalFooter /> | ||
</ModalContent> | ||
</Modal> | ||
); | ||
} | ||
|
||
export const DataModalTrigger = forwardRef< | ||
HTMLButtonElement, | ||
React.ComponentPropsWithoutRef<"button"> | ||
>(function DataModalTrigger({ onClick, ...props }, ref) { | ||
const { onOpen } = useMatchContext().dataModal; | ||
|
||
return ( | ||
<button | ||
ref={ref} | ||
onClick={(e) => { | ||
onOpen(); | ||
onClick?.(e); | ||
}} | ||
{...props} | ||
/> | ||
); | ||
}); |
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
23 changes: 13 additions & 10 deletions
23
app/(main)/(routes)/matches/(routes)/[matchId]/(components)/MatchContextProvider/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
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
21 changes: 18 additions & 3 deletions
21
...utes)/[matchId]/(components)/MatchPlayerInputModal/(components)/ModalController/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
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
4 changes: 2 additions & 2 deletions
4
.../(routes)/[matchId]/(components)/MatchTable/(components)/MatchPlayerInputButton/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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
"use client"; | ||
|
||
import { useDisclosure } from "@/components/Modal"; | ||
import { useModal } from "@/components/Modal"; | ||
|
||
export function MatchPlayerInputButton( | ||
props: React.ComponentPropsWithoutRef<"button">, | ||
) { | ||
const gameInputModal = useDisclosure(); | ||
const gameInputModal = useModal(); | ||
|
||
return <button onClick={gameInputModal.onOpen} {...props}></button>; | ||
} |
65 changes: 65 additions & 0 deletions
65
...(routes)/matches/(routes)/[matchId]/(components)/RuleModal/(components)/Content/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,65 @@ | ||
"use client"; | ||
|
||
import { | ||
ModalBody, | ||
ModalContent, | ||
ModalFooter, | ||
ModalHeader, | ||
} from "@/components/Modal"; | ||
import { calcMethodLabel, chipRateLabel, rateLabel } from "@/lib/config"; | ||
import { Rule } from "@/lib/type"; | ||
|
||
export function RuleModalContent({ rule }: { rule: Rule }) { | ||
return ( | ||
<ModalContent> | ||
<ModalHeader>ルール</ModalHeader> | ||
<ModalBody> | ||
<table className="table-fixed border-separate border-spacing-y-1"> | ||
<tbody className="[&_td]:text-center"> | ||
<tr> | ||
<th>プレイ人数</th> | ||
<td>{rule.playersCount}人</td> | ||
</tr> | ||
<tr> | ||
<th>レート</th> | ||
<td>{rateLabel[rule.rate]}</td> | ||
</tr> | ||
<tr> | ||
<th>チップ</th> | ||
<td>{chipRateLabel[rule.chipRate]}</td> | ||
</tr> | ||
<tr> | ||
<th>ウマ</th> | ||
<td className="space-x-4"> | ||
<span>{rule.incline.incline1}</span> | ||
<span>{rule.incline.incline2}</span> | ||
<span>{rule.incline.incline3}</span> | ||
{rule.playersCount === 4 && ( | ||
<span>{rule.incline.incline4}</span> | ||
)} | ||
</td> | ||
</tr> | ||
<tr> | ||
<th>飛び賞</th> | ||
<td>{rule.crackBoxBonus}点</td> | ||
</tr> | ||
<tr> | ||
<th>持ち点</th> | ||
<td>{rule.defaultPoints}点</td> | ||
</tr> | ||
<tr> | ||
<th>オカ</th> | ||
<td>{rule.defaultCalcPoints}点</td> | ||
</tr> | ||
<tr> | ||
<th>計算</th> | ||
<td>{calcMethodLabel[rule.calcMethod]}</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</ModalBody> | ||
{/* スペーサーとして */} | ||
<ModalFooter /> | ||
</ModalContent> | ||
); | ||
} |
14 changes: 14 additions & 0 deletions
14
.../matches/(routes)/[matchId]/(components)/RuleModal/(components)/ModalController/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,14 @@ | ||
"use client"; | ||
|
||
import { Modal } from "@/components/Modal"; | ||
import { useMatchContext } from "../../../../context"; | ||
|
||
export function ModalController({ children }: { children: React.ReactNode }) { | ||
const { ruleModal } = useMatchContext(); | ||
|
||
return ( | ||
<Modal {...ruleModal.bind} hideCloseButton> | ||
{children} | ||
</Modal> | ||
); | ||
} |
Oops, something went wrong.