From e930411c0df1ba0c77c5957264b76321732a36fd Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 4 Nov 2021 21:37:12 +0100 Subject: [PATCH] review tip --- .../components/FindParker/FindParker.tsx | 25 ++++++++++++++++--- .../components/FindParker/IFindParkerState.ts | 1 + .../src/webparts/findParker/loc/en-us.js | 1 + .../webparts/findParker/loc/mystrings.d.ts | 1 + 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/samples/react-find-parker/src/webparts/findParker/components/FindParker/FindParker.tsx b/samples/react-find-parker/src/webparts/findParker/components/FindParker/FindParker.tsx index 96052ec1c..ccb4997c3 100644 --- a/samples/react-find-parker/src/webparts/findParker/components/FindParker/FindParker.tsx +++ b/samples/react-find-parker/src/webparts/findParker/components/FindParker/FindParker.tsx @@ -17,6 +17,7 @@ export default class FindParker extends React.Component { @@ -35,6 +44,7 @@ export default class FindParker extends React.Component

{strings.GameTitle}

-

{strings.GameDescription}

+ {foundPlaceForParkers ? +

{strings.GameDescription}

+ : +

{strings.CouldNotFindPlaceForParkersDescription}

+ }
{!gameStarted ?
- this.startGame()}>{strings.StartGameButton} + {foundPlaceForParkers ? + this.startGame()}>{strings.StartGameButton} + : '' + }
: diff --git a/samples/react-find-parker/src/webparts/findParker/components/FindParker/IFindParkerState.ts b/samples/react-find-parker/src/webparts/findParker/components/FindParker/IFindParkerState.ts index 848ba1813..df0bbf0a3 100644 --- a/samples/react-find-parker/src/webparts/findParker/components/FindParker/IFindParkerState.ts +++ b/samples/react-find-parker/src/webparts/findParker/components/FindParker/IFindParkerState.ts @@ -6,4 +6,5 @@ export interface IFindParkerState { elements: Array; gameStarted: boolean; gameFinsihed: boolean; + foundPlaceForParkers: boolean; } diff --git a/samples/react-find-parker/src/webparts/findParker/loc/en-us.js b/samples/react-find-parker/src/webparts/findParker/loc/en-us.js index 6174d528d..45dcf6e43 100644 --- a/samples/react-find-parker/src/webparts/findParker/loc/en-us.js +++ b/samples/react-find-parker/src/webparts/findParker/loc/en-us.js @@ -5,6 +5,7 @@ define([], function() { "PropertyPaneNumberOfElementsFieldLabel": "number of elements to find", "GameTitle": "Find Parker", "GameDescription": "🎯 The goal of the game is to find all elements on the page.", + "CouldNotFindPlaceForParkersDescription": "🙄 Your page seems strange, I don't see any playground to play here 😉", "StartGameButton": "🎮 Start the game !", "RestartGameButton": "🎮 It was fun, lets try again", "EndGameMessage": "Congrats! You are awasome 👍👍👍", diff --git a/samples/react-find-parker/src/webparts/findParker/loc/mystrings.d.ts b/samples/react-find-parker/src/webparts/findParker/loc/mystrings.d.ts index 22ae6ec43..7b5100ff3 100644 --- a/samples/react-find-parker/src/webparts/findParker/loc/mystrings.d.ts +++ b/samples/react-find-parker/src/webparts/findParker/loc/mystrings.d.ts @@ -4,6 +4,7 @@ declare interface IFindParkerWebPartStrings { PropertyPaneNumberOfElementsFieldLabel: string; GameTitle: string; GameDescription: string; + CouldNotFindPlaceForParkersDescription: string; StartGameButton: string; RestartGameButton: string; EndGameMessage: string;