Add Discord URL to tournament page

This commit is contained in:
Kalle 2024-04-14 14:24:13 +03:00
parent f5a83b0032
commit df950c6033
4 changed files with 20 additions and 0 deletions

View File

@ -2269,6 +2269,7 @@ export const PADDLING_POOL_257 = () =>
isRanked: true,
},
showMapListGenerator: 0,
discordUrl: null,
castTwitchAccounts: ["dappleproductions"],
castedMatchesInfo: {
castedMatches: [
@ -8083,6 +8084,7 @@ export const PADDLING_POOL_255 = () =>
teamsPerGroup: 4,
},
showMapListGenerator: 0,
discordUrl: null,
castTwitchAccounts: ["dappleproductions"],
castedMatchesInfo: {
castedMatches: [
@ -14224,6 +14226,7 @@ export const IN_THE_ZONE_32 = () =>
],
},
showMapListGenerator: 0,
discordUrl: null,
castTwitchAccounts: ["dappleproductions", "kyochandxd"],
castedMatchesInfo: null,
mapPickingStyle: "AUTO_SZ",

View File

@ -42,6 +42,7 @@ export const testTournament = (
id: 1,
description: null,
rules: null,
discordUrl: null,
startTime: 1705858842,
isFinalized: 0,
name: "test",

View File

@ -18,6 +18,7 @@ export async function findById(id: number) {
.select(({ eb, exists, selectFrom }) => [
"Tournament.id",
"CalendarEvent.id as eventId",
"CalendarEvent.discordUrl",
"Tournament.settings",
"Tournament.showMapListGenerator",
"Tournament.castTwitchAccounts",

View File

@ -78,6 +78,7 @@ import { NewTabs } from "~/components/NewTabs";
import { useSearchParamState } from "~/hooks/useSearchParamState";
import * as TeamRepository from "~/features/team/TeamRepository.server";
import { Toggle } from "~/components/Toggle";
import { DiscordIcon } from "~/components/icons/Discord";
export const action: ActionFunction = async ({ request, params }) => {
const user = await requireUser(request);
@ -385,6 +386,20 @@ function TournamentRegisterInfoTabs() {
key: "description",
element: (
<div className="stack lg">
{tournament.ctx.discordUrl ? (
<div className="w-max">
<LinkButton
to={tournament.ctx.discordUrl}
variant="outlined"
size="tiny"
isExternal
icon={<DiscordIcon />}
>
Join the Discord
</LinkButton>
</div>
) : null}
<div className="tournament__info__description">
<Markdown options={{ wrapper: React.Fragment }}>
{tournament.ctx.description ?? ""}