Skip to content

Commit 9305553

Browse files
committed
chore: Slight styles update
1 parent 2a564fc commit 9305553

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

src/web/react/components/othello/index.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { type ReactElement, memo, useCallback, useMemo, useState, useEffect } from 'react';
1+
import { type ReactElement, memo, useCallback, useEffect, useMemo, useState } from 'react';
22

33
import { Table } from '@/web/react/components/board';
44

@@ -15,8 +15,11 @@ type Board = (null | 'W' | 'B')[][];
1515
type GameState = { board: Board; sinceLast: number | null; at: Date; score: { W: number; B: number } };
1616

1717
const Cell: CellRenderer<'W' | 'B' | null> = ({ cell }) => (
18-
<td className="h-8 w-8 bg-green-600 border-collapse border border-primary leading-0">
19-
{cell ? <span className={`${cell === 'W' ? 'bg-white' : 'bg-black'} h-7 w-7 inline-block rounded-full m-0.5`} /> : null}
18+
<td className="bg-green-600 border-collapse border border-primary leading-0">
19+
<span
20+
className="h-7 w-7 inline-block rounded-full m-0.5"
21+
style={{ backgroundColor: cell ? (cell === 'W' ? 'white' : 'black') : undefined }}
22+
/>
2023
</td>
2124
);
2225
const Board = memo(({ state }: { state: GameState }) => (
@@ -71,7 +74,7 @@ const BoardWrapper = memo(({ states, game }: { states: GameState[]; game: GameMo
7174
Start
7275
</button>
7376
<button onClick={previous} disabled={!canPrevious}>
74-
Previous
77+
Prev
7578
</button>
7679
<button onClick={next} disabled={!canNext}>
7780
Next
@@ -83,7 +86,7 @@ const BoardWrapper = memo(({ states, game }: { states: GameState[]; game: GameMo
8386
);
8487

8588
return (
86-
<div className="flex flex-col items-center max-w-3xl m-10">
89+
<div className="flex flex-col items-center m-10">
8790
<h1>
8891
{game.players.B.name} (Black) vs {game.players.W.name} (White) <small className="text-secondary">in {game.room}</small>
8992
</h1>

0 commit comments

Comments
 (0)