diff --git a/teams.pokemonshowdown.com/src/teams-search.tsx b/teams.pokemonshowdown.com/src/teams-search.tsx index e9c9d095f..e024efdb7 100644 --- a/teams.pokemonshowdown.com/src/teams-search.tsx +++ b/teams.pokemonshowdown.com/src/teams-search.tsx @@ -1,7 +1,7 @@ /** @jsx preact.h */ /** @jsxFrag preact.Fragment */ import preact from '../../play.pokemonshowdown.com/js/lib/preact'; -import { Net, type ServerTeam, MiniTeam, query } from './utils'; +import { type ServerTeam, MiniTeam, query } from './utils'; import type { PageProps } from './teams'; import { Config } from '../../play.pokemonshowdown.com/src/client-main'; diff --git a/teams.pokemonshowdown.com/src/teams-view.tsx b/teams.pokemonshowdown.com/src/teams-view.tsx index 1809373de..e2d97f59e 100644 --- a/teams.pokemonshowdown.com/src/teams-view.tsx +++ b/teams.pokemonshowdown.com/src/teams-view.tsx @@ -11,6 +11,12 @@ import { Config } from '../../play.pokemonshowdown.com/src/client-main'; declare const toID: (str: any) => string; declare const BattleAliases: Record; +const MODES: Record = { + '1col': { width: 100, colGap: '' }, + '2col': { width: 50, colGap: '2rem' }, + '3col': { width: 33, colGap: '2rem' }, +}; + interface Team { team: string; title: string; @@ -221,6 +227,10 @@ export class TeamViewer extends preact.Component { this.id = props.args.id; this.checkTeamID(); + if (this.state.displayMode === 'default') { + this.state.displayMode = '1col'; + localStorage.setItem('teamdisplaymode', this.state.displayMode); + } } render() { if (this.state.error) { @@ -238,7 +248,9 @@ export class TeamViewer extends preact.Component { } const { team, title, ownerid, format, views } = this.state.team; const teamData = unpackTeam(team); - const is2Col = this.state.displayMode === '2col'; + const modeName = (this.state.displayMode?.charAt(0) || '1') + '-column'; + const mode = MODES[this.state.displayMode || '1col']; + const isDark = document.querySelector('html')?.classList[0] === 'dark'; const link = this.id + (this.state.team.private ? `-${this.state.team.private}` : ''); const loggedin = toID(getShowdownUsername()); @@ -262,7 +274,7 @@ export class TeamViewer extends preact.Component { disabled={!this.state.team || this.state.copyButtonMsg} onClick={() => this.copyTeam()} >{this.state.copyButtonMsg ? 'Copied!' : 'Copy team'} - +