Skip to content

Commit 46935a4

Browse files
committed
flatten remote page layout
1 parent b51aefd commit 46935a4

1 file changed

Lines changed: 31 additions & 57 deletions

File tree

src/pages/Competition/Remote/index.tsx

Lines changed: 31 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -88,41 +88,22 @@ export default function CompetitionRemote() {
8888
return (
8989
<Container className="px-4 py-8">
9090
<div className="space-y-6">
91-
<div className="space-y-2">
92-
<h1 className="type-display">Remote</h1>
93-
<p className="type-body-sm text-subtle">
94-
Control live activity status for {wcif.shortName || wcif.name}.
95-
</p>
96-
</div>
97-
9891
{remoteAuth.error && <NoteBox prefix="Remote sign in" text={remoteAuth.error} />}
9992

10093
{!remote.isAuthenticated ? (
101-
<div className="space-y-4 rounded border border-tertiary-weak bg-panel p-4 shadow-md shadow-tertiary-dark">
102-
<div className="space-y-2">
103-
<h2 className="type-heading">Remote authorization</h2>
104-
<p className="type-body-sm text-subtle">
105-
Authorize this competition with your WCA account to start, stop, reset, or
106-
auto-advance activities.
107-
</p>
108-
</div>
109-
<Button
110-
type="button"
111-
disabled={remoteAuth.authenticating}
112-
onClick={() => {
113-
void remoteAuth.signIn(competitionId);
114-
}}>
115-
{remoteAuth.authenticating ? 'Authorizing...' : 'Authorize remote control'}
116-
</Button>
117-
</div>
94+
<Button
95+
type="button"
96+
disabled={remoteAuth.authenticating}
97+
onClick={() => {
98+
void remoteAuth.signIn(competitionId);
99+
}}>
100+
{remoteAuth.authenticating ? 'Authorizing...' : 'Authorize remote control'}
101+
</Button>
118102
) : (
119103
<>
120-
<div className="flex flex-col gap-2 rounded border border-tertiary-weak bg-panel p-4 shadow-md shadow-tertiary-dark md:flex-row md:items-center">
121-
<div className="flex-1 space-y-1">
122-
<h2 className="type-heading">Remote session</h2>
123-
<p className="type-meta">
124-
{remoteAuth.userName ? `Signed in as ${remoteAuth.userName}` : 'Signed in'}
125-
</p>
104+
<div className="flex flex-col gap-2 md:flex-row md:items-center">
105+
<div className="flex-1 type-meta">
106+
{remoteAuth.userName ? `Signed in as ${remoteAuth.userName}` : 'Signed in'}
126107
</div>
127108
<Button type="button" variant="gray" onClick={remoteAuth.signOut}>
128109
Sign out
@@ -132,34 +113,27 @@ export default function CompetitionRemote() {
132113
{remote.isLoading && <BarLoader width="100%" />}
133114
{remote.error && <NoteBox prefix="Remote error" text={remote.error} />}
134115

135-
<div className="space-y-4 rounded border border-tertiary-weak bg-panel p-4 shadow-md shadow-tertiary-dark">
136-
<div className="flex flex-col gap-4 md:flex-row md:items-center">
137-
<div className="flex-1 space-y-1">
138-
<h2 className="type-heading">Controls</h2>
139-
<p className="type-meta">
140-
{selectedRoomId === 'all' ? 'All rooms' : 'Single room'} selected.
141-
</p>
116+
<div className="space-y-4">
117+
<div className="flex flex-col gap-4 md:flex-row md:items-end md:justify-between">
118+
<div className="flex flex-wrap gap-2">
119+
<label className="flex min-w-48 flex-col gap-1 type-label">
120+
Room
121+
<select
122+
className="select"
123+
value={selectedRoomId}
124+
onChange={(event) => {
125+
const value = event.target.value;
126+
setSelectedRoomId(value === 'all' ? 'all' : Number(value));
127+
}}>
128+
<option value="all">All rooms</option>
129+
{rooms.map((room) => (
130+
<option key={room.id} value={room.id}>
131+
{room.name}
132+
</option>
133+
))}
134+
</select>
135+
</label>
142136
</div>
143-
<label className="flex flex-col gap-1 type-label">
144-
Room
145-
<select
146-
className="select"
147-
value={selectedRoomId}
148-
onChange={(event) => {
149-
const value = event.target.value;
150-
setSelectedRoomId(value === 'all' ? 'all' : Number(value));
151-
}}>
152-
<option value="all">All rooms</option>
153-
{rooms.map((room) => (
154-
<option key={room.id} value={room.id}>
155-
{room.name}
156-
</option>
157-
))}
158-
</select>
159-
</label>
160-
</div>
161-
162-
<div className="flex flex-wrap gap-2">
163137
<Button
164138
type="button"
165139
variant={remote.autoAdvance ? 'green' : 'light'}

0 commit comments

Comments
 (0)