Overview Tab initial

This commit is contained in:
Kalle (Sendou)
2021-11-11 20:37:51 +02:00
parent 57683a1d38
commit a8e347c331
5 changed files with 18 additions and 6 deletions

View File

@@ -0,0 +1,11 @@
import { useTournamentData } from "hooks/data/useTournamentData";
export function OverviewTab() {
const { data } = useTournamentData();
// TODO: handle loading
// TODO: handle error in parent
if (!data?.tournamentByIdentifier) return null;
return <div>{data.tournamentByIdentifier.description}</div>;
}

View File

@@ -1577,7 +1577,7 @@ export type Tournament = Node & {
bannerTextHslArgs: Scalars['String'];
checkInTime?: Maybe<Scalars['Datetime']>;
createdAt?: Maybe<Scalars['Datetime']>;
description?: Maybe<Scalars['String']>;
description: Scalars['String'];
identifier: Scalars['String'];
/** Reads and enables pagination through a set of `MapPool`. */
mapPoolsByTournamentIdentifier: MapPoolsConnection;
@@ -1649,7 +1649,7 @@ export type TournamentInput = {
bannerTextHslArgs: Scalars['String'];
checkInTime?: Maybe<Scalars['Datetime']>;
createdAt?: Maybe<Scalars['Datetime']>;
description?: Maybe<Scalars['String']>;
description: Scalars['String'];
identifier: Scalars['String'];
name: Scalars['String'];
organizationIdentifier: Scalars['String'];
@@ -2253,7 +2253,7 @@ export type TournamentByIdentifierQueryVariables = Exact<{
}>;
export type TournamentByIdentifierQuery = { __typename?: 'Query', tournamentByIdentifier?: { __typename?: 'Tournament', name: string, startTime: Date, checkInTime?: Date | null | undefined, bannerBackground: string, description?: string | null | undefined, textColor?: string | null | undefined, organizationByOrganizationIdentifier: { __typename?: 'Organization', name: string, discordInviteUrl?: string | null | undefined, twitterUrl?: string | null | undefined }, tournamentTeamsByTournamentIdentifier: { __typename?: 'TournamentTeamsConnection', nodes: Array<{ __typename?: 'TournamentTeam', name: string, tournamentTeamRostersByTournamentTeamId: { __typename?: 'TournamentTeamRostersConnection', nodes: Array<{ __typename?: 'TournamentTeamRoster', captain: boolean, accountByMemberId: { __typename?: 'Account', discordFullUsername?: string | null | undefined } }> } }> }, mapPoolsByTournamentIdentifier: { __typename?: 'MapPoolsConnection', nodes: Array<{ __typename?: 'MapPool', mapModeByMapModeId: { __typename?: 'MapMode', stage: string, gameMode: ModeEnum } }> } } | null | undefined };
export type TournamentByIdentifierQuery = { __typename?: 'Query', tournamentByIdentifier?: { __typename?: 'Tournament', name: string, startTime: Date, checkInTime?: Date | null | undefined, bannerBackground: string, description: string, textColor?: string | null | undefined, organizationByOrganizationIdentifier: { __typename?: 'Organization', name: string, discordInviteUrl?: string | null | undefined, twitterUrl?: string | null | undefined }, tournamentTeamsByTournamentIdentifier: { __typename?: 'TournamentTeamsConnection', nodes: Array<{ __typename?: 'TournamentTeam', name: string, tournamentTeamRostersByTournamentTeamId: { __typename?: 'TournamentTeamRostersConnection', nodes: Array<{ __typename?: 'TournamentTeamRoster', captain: boolean, accountByMemberId: { __typename?: 'Account', discordFullUsername?: string | null | undefined } }> } }> }, mapPoolsByTournamentIdentifier: { __typename?: 'MapPoolsConnection', nodes: Array<{ __typename?: 'MapPool', mapModeByMapModeId: { __typename?: 'MapMode', stage: string, gameMode: ModeEnum } }> } } | null | undefined };
export const TournamentByIdentifierDocument = gql`

File diff suppressed because one or more lines are too long

View File

@@ -2,11 +2,12 @@ import { InfoBanner } from "components/tournament/InfoBanner";
import { Tab } from "components/common/Tab";
import { styled } from "stitches.config";
import { MapPoolTab } from "components/tournament/MapPoolTab";
import { OverviewTab } from "components/tournament/OverviewTab";
import { Select } from "components/common/Select";
import { useState } from "react";
const tabs = [
{ name: "Overview", id: "info", component: null },
{ name: "Overview", id: "info", component: <OverviewTab /> },
{ name: "Map Pool", id: "map-pool", component: <MapPoolTab /> },
{ name: "Bracket", id: "bracket", component: null },
{ name: "Teams (23)", id: "teams", component: null },

View File

@@ -78,7 +78,7 @@ create table sendou_ink.tournament (
check (identifier ~ '^[a-z0-9-]{2,50}$'),
name text not null
check (char_length(name) < 51),
description text
description text not null
check (char_length(description) < 5000),
start_time timestamp not null
check (start_time > now()),