-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: move game tokens page under settings (#359)
Closes MIS-265
- Loading branch information
Showing
6 changed files
with
75 additions
and
39 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
37 changes: 37 additions & 0 deletions
37
apps/hub/src/routes/_authenticated/_layout/games/$gameId/settings/tokens.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,37 @@ | ||
import { Button, DocsCard, Grid, Text } from "@rivet-gg/components"; | ||
import { Link, createFileRoute } from "@tanstack/react-router"; | ||
|
||
function CloudTokenCard() { | ||
return ( | ||
<> | ||
<DocsCard | ||
title="Cloud token" | ||
href="https://rivet.gg/docs/general/concepts/token-types#cloud" | ||
footer={ | ||
<Button asChild> | ||
<Link search={{ modal: "cloud-token" }}>Generate</Link> | ||
</Button> | ||
} | ||
> | ||
<Text> | ||
Cloud tokens are used to access Rivet Cloud. They are used by the | ||
client to access Rivet Cloud. | ||
</Text> | ||
</DocsCard> | ||
</> | ||
); | ||
} | ||
|
||
function GameTokensRoute() { | ||
return ( | ||
<Grid columns={{ initial: "1", md: "2" }} gap="4" items="start"> | ||
<CloudTokenCard /> | ||
</Grid> | ||
); | ||
} | ||
|
||
export const Route = createFileRoute( | ||
"/_authenticated/_layout/games/$gameId/settings/tokens", | ||
)({ | ||
component: GameTokensRoute, | ||
}); |
39 changes: 7 additions & 32 deletions
39
apps/hub/src/routes/_authenticated/_layout/games/$gameId/tokens.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,37 +1,12 @@ | ||
import { Button, DocsCard, Grid, Text } from "@rivet-gg/components"; | ||
import { Link, createFileRoute } from "@tanstack/react-router"; | ||
|
||
function CloudTokenCard() { | ||
return ( | ||
<> | ||
<DocsCard | ||
title="Cloud token" | ||
href="https://rivet.gg/docs/general/concepts/token-types#cloud" | ||
footer={ | ||
<Button asChild> | ||
<Link search={{ modal: "cloud-token" }}>Generate</Link> | ||
</Button> | ||
} | ||
> | ||
<Text> | ||
Cloud tokens are used to access Rivet Cloud. They are used by the | ||
client to access Rivet Cloud. | ||
</Text> | ||
</DocsCard> | ||
</> | ||
); | ||
} | ||
|
||
function GameTokensRoute() { | ||
return ( | ||
<Grid columns={{ initial: "1", md: "2" }} gap="4" items="start"> | ||
<CloudTokenCard /> | ||
</Grid> | ||
); | ||
} | ||
import { createFileRoute, redirect } from "@tanstack/react-router"; | ||
|
||
export const Route = createFileRoute( | ||
"/_authenticated/_layout/games/$gameId/tokens", | ||
)({ | ||
component: GameTokensRoute, | ||
loader: ({ params }) => { | ||
throw redirect({ | ||
to: "/games/$gameId/settings/tokens", | ||
params, | ||
}); | ||
}, | ||
}); |
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