Skip to content

Commit f967d80

Browse files
committed
Make donations table wider
1 parent 2853c7f commit f967d80

3 files changed

Lines changed: 33 additions & 11 deletions

File tree

artifacts/game-client/src/apps/adepts-game/pages/FuneralRoundPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ export default function FuneralRoundPage() {
185185
) : null}
186186
</div>
187187
</main>
188-
<aside className="flex min-h-0 min-w-0 flex-col items-end p-2 pt-3">
188+
<aside className="flex min-h-0 min-w-0 flex-col p-2 pt-3">
189189
<DonationsTable donationLog={state.donationLog} />
190190
</aside>
191191
</div>

artifacts/game-client/src/apps/adepts-game/pages/Home.tsx

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,16 @@ export default function Home({ boardId }: { boardId: AdeptsBoardId }) {
144144
setActiveQuizCard(null);
145145
};
146146

147+
const showDonationsTable =
148+
boardId === 3 && state.hideDonationsTableOnBoard3 !== true;
149+
/** Third column matches chat (15%) when donations visible; collapsed to 0 otherwise. */
150+
const threeColGridClass = showDonationsTable
151+
? "grid min-h-0 flex-1 grid-cols-[minmax(0,15%)_minmax(0,1fr)_minmax(0,15%)]"
152+
: "grid min-h-0 flex-1 grid-cols-[minmax(0,15%)_minmax(0,1fr)_minmax(0,0)]";
153+
const scoreboardGridClass = showDonationsTable
154+
? "grid shrink-0 grid-cols-[minmax(0,15%)_minmax(0,1fr)_minmax(0,15%)]"
155+
: "grid shrink-0 grid-cols-[minmax(0,15%)_minmax(0,1fr)_minmax(0,0)]";
156+
147157
return (
148158
<div className="adepts-quiz-theme h-screen flex flex-col text-foreground overflow-hidden">
149159
<div style={{ display: "none" }} aria-hidden="true">
@@ -168,7 +178,7 @@ export default function Home({ boardId }: { boardId: AdeptsBoardId }) {
168178
</div>
169179
</header>
170180

171-
<div className="grid min-h-0 flex-1 grid-cols-[minmax(0,15%)_minmax(0,1fr)_minmax(0,15%)]">
181+
<div className={threeColGridClass}>
172182
<aside className="flex min-h-0 min-w-0 flex-col p-2">
173183
<ChatPanel className="min-h-0 w-full flex-1" />
174184
</aside>
@@ -189,14 +199,21 @@ export default function Home({ boardId }: { boardId: AdeptsBoardId }) {
189199
/>
190200
</div>
191201
</main>
192-
<aside className="flex min-h-0 min-w-0 flex-col items-end p-2 pt-3">
193-
{boardId === 3 && !state.hideDonationsTableOnBoard3 ? (
202+
<aside
203+
className={
204+
showDonationsTable
205+
? "flex min-h-0 min-w-0 flex-col p-2 pt-3"
206+
: "pointer-events-none w-0 min-w-0 overflow-hidden p-0"
207+
}
208+
aria-hidden={!showDonationsTable}
209+
>
210+
{showDonationsTable ? (
194211
<DonationsTable donationLog={state.donationLog} />
195212
) : null}
196213
</aside>
197214
</div>
198215

199-
<div className="grid shrink-0 grid-cols-[minmax(0,15%)_minmax(0,1fr)_minmax(0,15%)]">
216+
<div className={scoreboardGridClass}>
200217
<div className="min-w-0" aria-hidden="true" />
201218
<div className="min-w-0">
202219
<Scoreboard
@@ -208,7 +225,12 @@ export default function Home({ boardId }: { boardId: AdeptsBoardId }) {
208225
currentTurnSeat={state.currentTurnSeat}
209226
/>
210227
</div>
211-
<div className="min-w-0" aria-hidden="true" />
228+
<div
229+
className={
230+
showDonationsTable ? "min-w-0" : "w-0 min-w-0 overflow-hidden p-0"
231+
}
232+
aria-hidden="true"
233+
/>
212234
</div>
213235

214236
{openCard && (

artifacts/game-client/src/components/DonationsTable.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ export function DonationsTable({ donationLog }: Props) {
1212

1313
return (
1414
<div
15-
className="w-full max-w-[min(100%,14rem)] rounded-lg border-2 border-amber-400/75 bg-gradient-to-b from-amber-950/35 to-black/50 px-2.5 py-2 shadow-[0_0_22px_rgba(250,204,21,0.45),0_0_8px_rgba(251,191,36,0.25)_inset] backdrop-blur-sm"
15+
className="w-full min-w-0 rounded-lg border-2 border-amber-400/75 bg-gradient-to-b from-amber-950/35 to-black/50 px-2.5 py-2 shadow-[0_0_22px_rgba(250,204,21,0.45),0_0_8px_rgba(251,191,36,0.25)_inset] backdrop-blur-sm"
1616
aria-label="Пожертвования игроков"
1717
>
18-
<table className="w-full border-collapse text-left font-display text-[11px] leading-tight sm:text-xs">
18+
<table className="w-full table-fixed border-collapse text-left font-display text-[11px] leading-tight sm:text-xs">
1919
<caption className="sr-only">Журнал пожертвований</caption>
2020
<thead>
2121
<tr className="border-b border-amber-500/50 text-amber-100/95">
22-
<th scope="col" className="pb-1.5 pr-2 font-semibold tracking-wide">
22+
<th scope="col" className="w-[58%] pb-1.5 pr-2 font-semibold tracking-wide">
2323
Игрок
2424
</th>
2525
<th scope="col" className="pb-1.5 font-semibold tracking-wide">
@@ -37,10 +37,10 @@ export function DonationsTable({ donationLog }: Props) {
3737
) : (
3838
rows.map((row) => (
3939
<tr key={row.id} className="border-b border-white/10 last:border-b-0">
40-
<td className="max-w-[5.5rem] truncate py-1 pr-2 text-foreground/95" title={row.name}>
40+
<td className="min-w-0 truncate py-1 pr-2 text-foreground/95" title={row.name}>
4141
{row.name}
4242
</td>
43-
<td className="py-1 tabular-nums text-amber-50/95">{row.amount}</td>
43+
<td className="whitespace-nowrap py-1 tabular-nums text-amber-50/95">{row.amount}</td>
4444
</tr>
4545
))
4646
)}

0 commit comments

Comments
 (0)