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 = ; - 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 = ( + + ); + if (helpOn || showHelp) { + newInner = ( <> - {inner} + {newInner}
{row.name}
> ); } - } + setInner(newInner); + }, [row.icon, row.name, helpOn, showHelp]); + return