Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/Board/GameBoard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export const GameBoard: React.FC<Props> = ({
fen,
lastMove,
check: currentNode.check
? (currentNode.turn === 'w' ? 'white' : 'black')
? ((currentNode.turn === 'w' ? 'white' : 'black') as 'white' | 'black')
: false,
orientation: orientation as 'white' | 'black',
}
Expand Down
8 changes: 2 additions & 6 deletions src/components/Board/GameClock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ export const GameClock: React.FC<Props> = (
const showTenths = minutes < 1 && seconds <= 20

return (
<div
className="flex flex-row items-center justify-between bg-glass-strong md:flex-col md:items-start md:justify-start"
>
<div className="flex flex-row items-center justify-between bg-glass-strong md:flex-col md:items-start md:justify-start">
<div className="flex w-full items-center justify-between gap-3 px-4 py-2">
<span
className={`flex items-center gap-2 transition-colors ${
Expand Down Expand Up @@ -96,9 +94,7 @@ export const GameClock: React.FC<Props> = (
</div>
<div
className={`inline-flex self-start px-4 py-2 transition-all duration-200 md:text-3xl ${
active
? 'font-semibold text-primary'
: 'text-white/55'
active ? 'font-semibold text-primary' : 'text-white/55'
}`}
>
{minutes}:{('00' + seconds).slice(-2)}
Expand Down
15 changes: 13 additions & 2 deletions src/components/Common/MaterialBalance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@ import { useMemo } from 'react'
import type { Color } from 'src/types'
import { Chess } from 'chess.ts'

declare module 'react' {
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace JSX {
interface IntrinsicElements {
piece: React.DetailedHTMLProps<
React.HTMLAttributes<HTMLElement>,
HTMLElement
>
}
}
}

type PieceType = 'p' | 'n' | 'b' | 'r' | 'q' | 'k'
type MaterialCount = Record<PieceType, number>

Expand Down Expand Up @@ -170,8 +182,7 @@ export const MaterialBalance = ({

const capturedPieceColor = color === 'white' ? 'black' : 'white'
const capturedPieceFilter =
pieceFilter ??
capturedPieceColor === 'black'
(pieceFilter ?? capturedPieceColor === 'black')
? 'drop-shadow(0 0 0.8px rgba(255,255,255,0.82)) drop-shadow(0 0 1.5px rgba(255,255,255,0.28))'
: 'drop-shadow(0 0 0.8px rgba(0,0,0,0.82)) drop-shadow(0 0 1.5px rgba(0,0,0,0.22))'

Expand Down
Loading