diff --git a/src/api/BoardScoreTable/BoardScoreTable.tsx b/src/api/BoardScoreTable/BoardScoreTable.tsx index 9251ba5..a38f252 100644 --- a/src/api/BoardScoreTable/BoardScoreTable.tsx +++ b/src/api/BoardScoreTable/BoardScoreTable.tsx @@ -221,18 +221,42 @@ type FirstRowCellProps = { }; function FirstRowCell({ row, helpOn }: FirstRowCellProps) { - let inner = row.name; - if (row.icon) { - inner = {row.name}; - if (helpOn) { - inner = ( + const [showHelp, setShowHelp] = useState(helpOn); + const [inner, setInner] = useState(row.name); + + const onIconClick = () => { + if (helpOn || showHelp) { + return; + } + setShowHelp(true); + setTimeout(() => { + setShowHelp(false); + }, 2000); + }; + + useEffect(() => { + if (!row.icon) { + return; + } + let newInner = ( + {row.name} + ); + if (helpOn || showHelp) { + newInner = ( <> - {inner} + {newInner}

{row.name}

); } - } + setInner(newInner); + }, [row.icon, row.name, helpOn, showHelp]); + return {inner}; } diff --git a/src/games/forest-shuffle/definition.ts b/src/games/forest-shuffle/definition.ts index 0eca840..0a5a514 100644 --- a/src/games/forest-shuffle/definition.ts +++ b/src/games/forest-shuffle/definition.ts @@ -20,11 +20,11 @@ export default function getDefinition() { icon: cardIcon, }, { - name: 'Cards on top', + name: 'Cards top', icon: topIcon, }, { - name: 'Cards on right', + name: 'Cards right', icon: rightIcon, }, { @@ -32,7 +32,7 @@ export default function getDefinition() { icon: downIcon, }, { - name: 'Cards on left', + name: 'Cards left', icon: leftIcon, }, {