Skip to content

Commit

Permalink
Merge pull request #38 from Sports-day/feature/refactor-game-routing
Browse files Browse the repository at this point in the history
ゲーム配下のルーティングを一部修正
  • Loading branch information
testusuke authored May 19, 2024
2 parents 7ac2d75 + b02070e commit 65fe29f
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default async function LeaguePage({params}: { params: { id: string } }) {
return (
<Stack spacing={2} mx={2} my={3}>
<Breadcrumbs aria-label="breadcrumb" sx={{pl:2}}>
<Link underline="hover" color="inherit" href="/">
<Link underline="hover" color="inherit" href="/public">
管理者のダッシュボード
</Link>
<Link underline="hover" color="inherit" href={"/sports"}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default async function MatchPage({params}: { params: { matchId:string, ga
return(
<Stack spacing={1} mx={2} my={3}>
<Breadcrumbs aria-label="breadcrumb" sx={{pl:2}}>
<Link underline="hover" color="inherit" href="/">
<Link underline="hover" color="inherit" href="/public">
管理者のダッシュボード
</Link>
<Link underline="hover" color="inherit" href={"/sports"}>
Expand All @@ -24,7 +24,7 @@ export default async function MatchPage({params}: { params: { matchId:string, ga
<Link underline="hover" color="inherit" href={`/sports/${sport.id}`}>
{sport.name}
</Link>
<Link underline="hover" color="inherit" href={`/sports/${sport.id}/${gameId}`}>
<Link underline="hover" color="inherit" href={`/sports/${sport.id}/games/${gameId}`}>
{game.name}(ID:{gameId})
</Link>
<Typography color="text.primary">試合(ID:{match.id})</Typography>
Expand Down
6 changes: 3 additions & 3 deletions app/(authenticated)/sports/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@ export default async function SportPage({params}: { params: { id: string } }) {
<Link underline="hover" color="inherit" href="/">
管理者のダッシュボード
</Link>
<Link underline="hover" color="inherit" href="../../sports">
<Link underline="hover" color="inherit" href={"/sports"}>
競技管理
</Link>
<Typography color="text.primary">{sport.name}</Typography>
</Breadcrumbs>
{gameType === "league" && (
<CardBackground title={"リーグ一覧"} button={"リーグを作成・編集"} link={`/sports/${sport.id}/league`}>
<CardBackground title={"リーグ一覧"} button={"リーグを作成・編集"} link={`/sports/${sport.id}/create-league`}>
<Grid container spacing={1}>
<LeagueList games={filteredGames} sportId={sportId}/>
</Grid>
</CardBackground>
)}
{gameType === "tournament" && (
<CardBackground title={"トーナメントビュー"} button={"トーナメントを作成・編集"} link={`/sports/${sport.id}/tournament`}>
<CardBackground title={"トーナメントビュー"} button={"トーナメントを作成・編集"} link={`/sports/${sport.id}/create-tournament`}>
<Grid container spacing={1}>

</Grid>
Expand Down
2 changes: 1 addition & 1 deletion components/sports/leagueList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function LeagueList(props: LeagueListProps) {
<ButtonLarge
key={game.id}
img={"a"}
link={`/sports/${sportId}/${game.id}`}
link={`/sports/${sportId}/games/${game.id}`}
>
{game.name}
</ButtonLarge>
Expand Down
3 changes: 1 addition & 2 deletions middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ export function middleware(request: NextRequest) {
if (!accessToken) {
const protectedPaths: string[] = [
'/sports',
'/tournament',
'/league',
'/teams',
'/users',
'/roles',
'/locations',
]

// check if next path starts with any of the protected paths or root
Expand Down

0 comments on commit 65fe29f

Please sign in to comment.