diff --git a/src/components/Leaderboard/LeaderboardColumn.tsx b/src/components/Leaderboard/LeaderboardColumn.tsx index 7224c472..da49f53a 100644 --- a/src/components/Leaderboard/LeaderboardColumn.tsx +++ b/src/components/Leaderboard/LeaderboardColumn.tsx @@ -2,8 +2,8 @@ import React from 'react' import { LeaderboardEntry } from 'src/components' interface Props { - id: 'regular' | 'train' | 'turing' | 'hand' | 'brain' - name: 'Regular' | 'Train' | 'Bot/Not' | 'Hand' | 'Brain' + id: 'regular' | 'puzzles' | 'turing' | 'hand' | 'brain' + name: 'Regular' | 'Puzzles' | 'Bot/Not' | 'Hand' | 'Brain' icon: React.JSX.Element ranking: { display_name: string diff --git a/src/components/Leaderboard/LeaderboardEntry.tsx b/src/components/Leaderboard/LeaderboardEntry.tsx index e756c9eb..e101d04a 100644 --- a/src/components/Leaderboard/LeaderboardEntry.tsx +++ b/src/components/Leaderboard/LeaderboardEntry.tsx @@ -7,8 +7,8 @@ import { useLeaderboardContext } from './LeaderboardContext' interface Props { index: number - typeId: 'regular' | 'train' | 'turing' | 'hand' | 'brain' - type: 'Regular' | 'Train' | 'Bot/Not' | 'Hand' | 'Brain' + typeId: 'regular' | 'puzzles' | 'turing' | 'hand' | 'brain' + type: 'Regular' | 'Puzzles' | 'Bot/Not' | 'Hand' | 'Brain' display_name: string elo: number } @@ -63,7 +63,7 @@ export const LeaderboardEntry = ({ gamesKey = 'regularGames' gamesWonKey = 'regularWins' break - case 'train': + case 'puzzles': ratingKey = 'trainRating' highestRatingKey = 'trainMax' gamesKey = 'trainGames' diff --git a/src/components/Puzzles/Feedback.tsx b/src/components/Puzzles/Feedback.tsx index 367e8908..d8a73390 100644 --- a/src/components/Puzzles/Feedback.tsx +++ b/src/components/Puzzles/Feedback.tsx @@ -12,6 +12,8 @@ interface Props { getNewGame: () => Promise setStatus: Dispatch> controller: ReturnType + lastAttemptedMove: string | null + setLastAttemptedMove: Dispatch> } export const Feedback: React.FC = ({ @@ -21,6 +23,8 @@ export const Feedback: React.FC = ({ getNewGame, setAndGiveUp, controller: controller, + lastAttemptedMove, + setLastAttemptedMove, }: Props) => { const { targetIndex } = game @@ -37,12 +41,12 @@ export const Feedback: React.FC = ({ Find the best move for **${turn}**! ` const incorrectContent = ` - ##### ${controller.currentNode.san} is incorrect + ##### ${lastAttemptedMove || 'Move'} is incorrect Try again or give up to analyze the board and see the best move. ` const correctContent = ` - ##### Correct! ${controller.currentNode.san} is the best move. + ##### Correct! ${lastAttemptedMove || 'Move'} is the best move. You can now explore and analyze the position by making moves, or train on another position. ` @@ -93,6 +97,7 @@ export const Feedback: React.FC = ({