Skip to content

Commit

Permalink
Merge pull request #37 from Sports-day/feature/#32-match-result
Browse files Browse the repository at this point in the history
試合結果入力画面 Feature/#32 match result
  • Loading branch information
1nayu authored May 18, 2024
2 parents fabda3c + 0bafce9 commit 7ac2d75
Show file tree
Hide file tree
Showing 14 changed files with 625 additions and 141 deletions.
24 changes: 0 additions & 24 deletions app/(authenticated)/league/page.tsx

This file was deleted.

3 changes: 1 addition & 2 deletions app/(authenticated)/locations/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {Breadcrumbs, Link, Stack, Typography} from "@mui/material";
import CardBackground from "@/components/layout/cardBackground";
import TeamsAgGrid from "@/components/teams/teamsTable";

export default function LocationPage() {
return (
Expand All @@ -12,7 +11,7 @@ export default function LocationPage() {
<Typography color="text.primary">場所管理</Typography>
</Breadcrumbs>
<CardBackground title={"すべての場所"} button={"場所を新規作成"}>
none
この機能は開発中です。
</CardBackground>
</Stack>
)
Expand Down
12 changes: 6 additions & 6 deletions app/(authenticated)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ export default async function Home() {
<Breadcrumbs aria-label="breadcrumb" sx={{pl:2}}>
<Typography color="text.primary">管理者のダッシュボード</Typography>
</Breadcrumbs>
<CardBackground title={"競技を選ぶ"} button={"競技を作成・編集する"} link={"/sports"}>
<Grid container spacing={1}>
<SportsList sports={sports}/>
</Grid>
</CardBackground>
<CardBackground title={"配信中のお知らせ"} button={"お知らせを作成・編集"}>
<CardLarge>
この機能は開発中です
</CardLarge>
</CardBackground>
<CardBackground title={"現在進行中の試合"}>
<CardBackground title={"競技から選ぶ"} button={"競技を作成・編集する"} link={"/sports"}>
<Grid container spacing={1}>
<SportsList sports={sports}/>
</Grid>
</CardBackground>
<CardBackground title={"進行中の全ての試合から選ぶ"}>
<Grid container spacing={1}>
<CardList
sport={"バスケットボール"}
Expand Down
37 changes: 37 additions & 0 deletions app/(authenticated)/sports/[id]/[gameId]/[matchId]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import {Stack, Link, Typography, Breadcrumbs} from "@mui/material";
import {sportFactory} from "@/src/models/SportModel";
import {gameFactory} from "@/src/models/GameModel";
import {matchFactory} from "@/src/models/MatchModel";
import MatchEditor from "@/components/match/matchEditor";

export default async function MatchPage({params}: { params: { matchId:string, gameId:string, id: string } }) {
const matchId = parseInt(params.matchId, 10)
const match = await matchFactory().show(matchId)
const gameId = parseInt(params.gameId, 10)
const game = await gameFactory().show(gameId)
const sportId = parseInt(params.id, 10)
const sport = await sportFactory().show(sportId)

return(
<Stack spacing={1} mx={2} my={3}>
<Breadcrumbs aria-label="breadcrumb" sx={{pl:2}}>
<Link underline="hover" color="inherit" href="/">
管理者のダッシュボード
</Link>
<Link underline="hover" color="inherit" href={"/sports"}>
競技管理
</Link>
<Link underline="hover" color="inherit" href={`/sports/${sport.id}`}>
{sport.name}
</Link>
<Link underline="hover" color="inherit" href={`/sports/${sport.id}/${gameId}`}>
{game.name}(ID:{gameId})
</Link>
<Typography color="text.primary">試合(ID:{match.id})</Typography>
</Breadcrumbs>

<MatchEditor sport={sport} match={match} game={game}/>

</Stack>
)
}
36 changes: 36 additions & 0 deletions app/(authenticated)/sports/[id]/[gameId]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import CardBackground from "@/components/layout/cardBackground";
import {Stack, Grid, Link, Typography, Breadcrumbs} from "@mui/material";
import CardList from "@/components/layout/cardList";
import {sportFactory} from "@/src/models/SportModel";
import {gameFactory} from "@/src/models/GameModel";

export default async function GamePage({params}: { params: { gameId:string, id: string } }) {
const gameId = parseInt(params.gameId, 10)
const game = await gameFactory().show(gameId)
const sportId = parseInt(params.id, 10)
const sport = await sportFactory().show(sportId)

return(
<Stack spacing={1} mx={2} my={3}>
<Breadcrumbs aria-label="breadcrumb" sx={{pl:2}}>
<Link underline="hover" color="inherit" href="/">
管理者のダッシュボード
</Link>
<Link underline="hover" color="inherit" href={"/sports"}>
競技管理
</Link>
<Link underline="hover" color="inherit" href={`/sports/${sport.id}`}>
{sport.name}
</Link>
<Typography color="text.primary">{game.name}(ID:{gameId})</Typography>
</Breadcrumbs>
<CardBackground title={`${game.name}のリーグ表`}>
</CardBackground>
<CardBackground title={`${game.name}の進行中の試合`}>
<Grid container>
<CardList sport={"a"} league={"a"} judge={"a"} left={"a"} right={"a"} time={"11:11"} location={"a"}/>
</Grid>
</CardBackground>
</Stack>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,23 @@ import CardBackground from "@/components/layout/cardBackground";
import LeagueDnd from "@/components/league/leagueDnd";
import {sportFactory} from "@/src/models/SportModel";

export default async function LeagueTestPage({params}: { params: { id: string } }) {
export default async function LeaguePage({params}: { params: { id: string } }) {
const sportId = parseInt(params.id, 10)
const sport = await sportFactory().show(sportId)
const sportLink = `/sports/${sportId}`
return (
<Stack spacing={2} mx={2} my={3}>
<Breadcrumbs aria-label="breadcrumb" sx={{pl:2}}>
<Link underline="hover" color="inherit" href="/">
管理者のダッシュボード
</Link>
<Link underline="hover" color="inherit" href="../../league">
リーグ管理
<Link underline="hover" color="inherit" href={"/sports"}>
競技管理
</Link>
<Typography color="text.primary">{sport.name}</Typography>
<Link underline="hover" color="inherit" href={sportLink}>
{sport.name}
</Link>
<Typography color="text.primary">リーグを作成・編集</Typography>
</Breadcrumbs>
<CardBackground title={`${sport.name}のリーグ`}>
<LeagueDnd sport={sport} sportId={sportId}/>
Expand Down
23 changes: 16 additions & 7 deletions app/(authenticated)/sports/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import CardBackground from "@/components/layout/cardBackground";
import {Stack, Grid, Link, Typography, Breadcrumbs} from "@mui/material";
import {ButtonLarge} from "@/components/layout/buttonLarge";
import CardList from "@/components/layout/cardList";
import {sportFactory} from "@/src/models/SportModel";
import SportEditor from "@/components/sports/sportEditor";
Expand All @@ -12,6 +11,7 @@ export default async function SportPage({params}: { params: { id: string } }) {
const sport = await sportFactory().show(sportId)
const games = await gameFactory().index()
const filteredGames = games.filter((game) => game.sportId == sportId)
const gameType = filteredGames.find(game => game)?.type;

return(
<Stack spacing={1} mx={2} my={3}>
Expand All @@ -24,15 +24,24 @@ export default async function SportPage({params}: { params: { id: string } }) {
</Link>
<Typography color="text.primary">{sport.name}</Typography>
</Breadcrumbs>
{gameType === "league" && (
<CardBackground title={"リーグ一覧"} button={"リーグを作成・編集"} link={`/sports/${sport.id}/league`}>
<Grid container spacing={1}>
<LeagueList games={filteredGames} sportId={sportId}/>
</Grid>
</CardBackground>
)}
{gameType === "tournament" && (
<CardBackground title={"トーナメントビュー"} button={"トーナメントを作成・編集"} link={`/sports/${sport.id}/tournament`}>
<Grid container spacing={1}>

</Grid>
</CardBackground>
)}
<CardBackground title={`${sport.name}`}>
<SportEditor sport={sport}/>
</CardBackground>
<CardBackground title={"リーグ一覧"} button={"編集"}>
<Grid container spacing={1}>
<LeagueList games={filteredGames}/>
</Grid>
</CardBackground>
<CardBackground title={"競技名の現在進行中の試合"}>
<CardBackground title={`${sport.name}の進行中の試合`}>
<Grid container>
<CardList sport={"a"} league={"a"} judge={"a"} left={"a"} right={"a"} time={"11:11"} location={"a"}/>
</Grid>
Expand Down
24 changes: 0 additions & 24 deletions app/(authenticated)/tournament/page.tsx

This file was deleted.

67 changes: 18 additions & 49 deletions components/layout/navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import {
HiMiniNewspaper,
HiUser,
HiUserGroup,
HiTableCells,
HiRectangleGroup,
HiTrophy,
HiMapPin, HiIdentification
} from "react-icons/hi2";
Expand Down Expand Up @@ -101,107 +99,78 @@ export const Navigation = () => {
</Stack>

<Stack spacing={1} pb={3}>
<Typography sx={{pl:2.5}}>ユーザー</Typography>
<Typography sx={{pl:2.5}}>スポーツ</Typography>
<Button
variant={"contained"}
sx={{py:buttonPadding, width:"100%", fontWeight: "600"}}
component={Link}
href={"/users"}
>
<Stack spacing={1} mx={1} width={"100%"} direction={"row"} justifyContent={"flex-start"} alignItems="center">
<SvgIcon fontSize={"small"}>
<HiUser/>
</SvgIcon>
<Typography>ユーザー</Typography>
</Stack>
</Button>
<Button
variant={"contained"}
sx={{py:buttonPadding, width:"100%", fontWeight: "600"}}
component={Link}
href={"/teams"}
href={"/sports"}
>
<Stack spacing={1} mx={1} width={"100%"} direction={"row"} justifyContent={"flex-start"} alignItems="center">
<SvgIcon fontSize={"small"}>
<HiUserGroup/>
<HiTrophy/>
</SvgIcon>
<Typography>チーム</Typography>
<Typography>競技</Typography>
</Stack>
</Button>
<Button
variant={"contained"}
sx={{py:buttonPadding, width:"100%", fontWeight: "600"}}
component={Link}
href={"/roles"}
href={"/locations"}
>
<Stack spacing={1} mx={1} width={"100%"} direction={"row"} justifyContent={"flex-start"} alignItems="center">
<SvgIcon fontSize={"small"}>
<HiIdentification/>
<HiMapPin/>
</SvgIcon>
<Typography>権限</Typography>
<Typography>場所</Typography>
</Stack>
</Button>
</Stack>

<Stack spacing={1} pb={3}>
<Typography sx={{pl:2.5}}>競技</Typography>
<Typography sx={{pl:2.5}}>情報</Typography>
<Button
variant={"contained"}
sx={{py:buttonPadding, width:"100%", fontWeight: "600"}}
component={Link}
href={"/sports"}
>
<Stack spacing={1} mx={1} width={"100%"} direction={"row"} justifyContent={"flex-start"} alignItems="center">
<SvgIcon fontSize={"small"}>
<HiTrophy/>
</SvgIcon>
<Typography>競技</Typography>
</Stack>
</Button>
<Button
variant={"contained"}
sx={{py:buttonPadding, width:"100%", fontWeight: "600"}}
component={Link}
href={"/locations"}
href={"/users"}
>
<Stack spacing={1} mx={1} width={"100%"} direction={"row"} justifyContent={"flex-start"} alignItems="center">
<SvgIcon fontSize={"small"}>
<HiMapPin/>
<HiUser/>
</SvgIcon>
<Typography>場所</Typography>
<Typography>ユーザー</Typography>
</Stack>
</Button>
</Stack>

<Stack spacing={1} pb={3}>
<Typography sx={{pl:2.5}}>編成</Typography>
<Button
variant={"contained"}
sx={{py:buttonPadding, width:"100%", fontWeight: "600"}}
component={Link}
href={"/league"}
href={"/teams"}
>
<Stack spacing={1} mx={1} width={"100%"} direction={"row"} justifyContent={"flex-start"} alignItems="center">
<SvgIcon fontSize={"small"}>
<HiTableCells/>
<HiUserGroup/>
</SvgIcon>
<Typography>リーグ</Typography>
<Typography>チーム</Typography>
</Stack>
</Button>
<Button
variant={"contained"}
sx={{py:buttonPadding, width:"100%", fontWeight: "600"}}
component={Link}
href={"/tournament"}
href={"/roles"}
>
<Stack spacing={1} mx={1} width={"100%"} direction={"row"} justifyContent={"flex-start"} alignItems="center">
<SvgIcon fontSize={"small"}>
<HiRectangleGroup/>
<HiIdentification/>
</SvgIcon>
<Typography>トーナメント</Typography>
<Typography>権限</Typography>
</Stack>
</Button>
</Stack>

<Stack spacing={1} width={"100%"} direction={"row"} justifyContent={"space-around"} alignItems="center">
<LogoutButton/>
<Tooltip title={"GitHub"} arrow>
Expand Down
Loading

0 comments on commit 7ac2d75

Please sign in to comment.