Files
ltbxd-actorle/assets/react/controllers/GameGrid.jsx
thibaud-leclere 8942e7f608 fix: integrate hint buttons into table for perfect row alignment and sticky scroll
Move hint buttons from a separate flex column into the table as the
first <td> of each row, ensuring pixel-perfect alignment with grid rows.
Use position:sticky with box-shadow to keep hints fixed on the left
while scrolling horizontally.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 19:36:32 +02:00

45 lines
1.8 KiB
JavaScript

import React from 'react';
import GameRow from './GameRow';
import ActorPopover from './ActorPopover';
export default function GameGrid({ grid, width, middle }) {
return (
<div className="game-grid-scroll">
<table id="actors">
<tbody>
{grid.map((row, rowIndex) => {
if (row.separator !== undefined) {
return (
<tr key={rowIndex} className="separator-row">
<td className="hint-cell" />
{Array.from({ length: middle }, (_, i) => (
<td key={i} />
))}
<td className="letter-static separator-char">
{row.separator === ' ' ? '' : row.separator}
</td>
{Array.from({ length: width - middle }, (_, i) => (
<td key={middle + 1 + i} />
))}
</tr>
);
}
return (
<GameRow
key={rowIndex}
actorName={row.actorName}
pos={row.pos}
colStart={middle - row.pos}
totalWidth={width}
hintType={row.hintType}
hintText={row.hintText}
/>
);
})}
</tbody>
</table>
</div>
);
}