1
0
mirror of https://github.com/danbee/chess synced 2025-03-04 08:39:06 +00:00
chess/assets/js/components/game-state.js
Dan Barber bedd6605ef
Redesign whole site in B&W
* Forms and board tweaks for small screen sizes
* Re-style game status indicators
* Re-style viewing/offline indicator
* Better eyecons 👁
* Re-organise CSS according to ITCSS principles
* Pick new font from Google Fonts
* Fix up tests
* Move some things into partials
2018-09-16 14:02:52 -04:00

30 lines
607 B
JavaScript

import React from "react";
import classNames from "classnames";
import i18n from "gettext.js";
const i = i18n();
const GAME_STATES = {
"checkmate": i.gettext("Checkmate!"),
"stalemate": i.gettext("Stalemate"),
"check": i.gettext("Check"),
};
const friendlyGameState = (state) => {
return GAME_STATES[state];
};
const gameStateClass = (state) => {
return classNames("game-state", `game-state--${state}`);
};
const GameState = (props) => {
return (
<div className={gameStateClass(props.gameState)}>
{friendlyGameState(props.gameState)}
</div>
);
};
export default GameState;