Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Commit

Permalink
Attempt at fix for controller tgui from j snow advice
Browse files Browse the repository at this point in the history
  • Loading branch information
Wayland-Smithy committed Dec 16, 2023
1 parent e3e2cbf commit 7fbc667
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions tgui/packages/tgui/interfaces/TournamentController.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ type TournamentControllerData = {
};

const ArenaInfo = (props, context) => {
const { act, data } = useBackend<TournamentControllerData>(context);
const { act, data } = useBackend<TournamentControllerData>();

const [selectedArena, setSelectedArea] = useLocalState<string | null>(
context,
'selectedArena',
null
null,
);

return (
Expand All @@ -25,10 +24,11 @@ const ArenaInfo = (props, context) => {
<Stack.Item
grow={1}
style={{
'overflow': 'hidden',
overflow: 'hidden',
'white-space': 'nowrap',
'text-overflow': 'ellipsis',
}}>
}}
>
{'Arena - ' + data.arena_id}
</Stack.Item>
<Stack.Item align="end" shrink={0}>
Expand All @@ -40,7 +40,8 @@ const ArenaInfo = (props, context) => {
/>
</Stack.Item>
</Stack>
}>
}
>
<Stack fill>
<Stack.Item grow>
<Dropdown
Expand All @@ -59,7 +60,8 @@ const ArenaInfo = (props, context) => {
act('load_arena', {
arena_template: selectedArena,
})
}>
}
>
Load
</Button>
</Stack.Item>
Expand All @@ -69,24 +71,21 @@ const ArenaInfo = (props, context) => {
};

const RoundInfo = (props, context) => {
const { act, data } = useBackend<TournamentControllerData>(context);
const { act, data } = useBackend<TournamentControllerData>();

const [selectedTeamA, setSelectedTeamA] = useLocalState(
context,
'selectedTeamA',
data.team_names[0]
data.team_names[0],
);

const [selectedTeamB, setSelectedTeamB] = useLocalState(
context,
'selectedTeamB',
data.team_names[1]
data.team_names[1],
);

const [respawnRemove, setRespawnRemove] = useLocalState(
context,
'respawnRemove',
true
true,
);

return (
Expand Down Expand Up @@ -120,7 +119,8 @@ const RoundInfo = (props, context) => {
icon="user-edit"
onClick={() => {
act('vv_teams');
}}>
}}
>
VV teams
</Button>
</Stack.Item>
Expand Down

0 comments on commit 7fbc667

Please sign in to comment.