From 4bda94eda7bdef0a1b0e0080df1579d2ddbf8592 Mon Sep 17 00:00:00 2001 From: "ITHQ1947\\saritha.pillai" Date: Fri, 29 Nov 2024 18:22:51 +0530 Subject: [PATCH] Trails B --- DotTouch/src/components/DotTouch/DotTouch.css | 1 + DotTouch/src/components/DotTouch/DotTouch.tsx | 31 ++++++------------- 2 files changed, 10 insertions(+), 22 deletions(-) diff --git a/DotTouch/src/components/DotTouch/DotTouch.css b/DotTouch/src/components/DotTouch/DotTouch.css index 7bd07f7a..d031069b 100644 --- a/DotTouch/src/components/DotTouch/DotTouch.css +++ b/DotTouch/src/components/DotTouch/DotTouch.css @@ -123,6 +123,7 @@ body{background: rgba(53,159,254,1);} .back-link{ position: absolute; left: 0; + top: 10px; } @-webkit-keyframes App-logo-spin { 0% { diff --git a/DotTouch/src/components/DotTouch/DotTouch.tsx b/DotTouch/src/components/DotTouch/DotTouch.tsx index ac13e499..ff3aa723 100644 --- a/DotTouch/src/components/DotTouch/DotTouch.tsx +++ b/DotTouch/src/components/DotTouch/DotTouch.tsx @@ -6,10 +6,10 @@ * @copyright (c) 2020, ZCO */ import * as React from 'react'; -import Button from '@material-ui/core/Button'; +// import Button from '@material-ui/core/Button'; import { Dot } from './Dot'; import { getRandomAlphaNumeric,getRandomNumbers , shuffle} from '../../functions'; -import UndoIcon from '@material-ui/icons/Undo'; +import RefreshRounded from '@material-ui/icons/RefreshRounded'; import ArrowBackIcon from '@material-ui/icons/ArrowBack'; import { Timer } from '../common/Timer'; import './DotTouch.css'; @@ -309,33 +309,20 @@ class DotTouch extends React.Component { return routeList; } - // Undo button action - undoAction = () => { - if(this.state.startGame) { - const item = this.state.lastWrongClick; - if(item !== null) { - item.className ='dot-style'; - } - const routeList = this.updateRouteList(); - this.setState({ - route:[], - stateRoutes:JSON.stringify(routeList) - }); - } - } - clickBack = () => { this.sendGameResult(true) } + // To refresh the game + clickHome = () => { + window.location.reload(); + }; + // Render the game board render() { const alertMsg = this.state.gameOver ? 'Congrats !!' : (this.state.timeout ? 'Timeout !' : this.state.tapCount === 0 ? (this.state.gameLevel === 1 ? "Tap '1' to start the test": "Tap '1' to begin") : - (this.state.tapCount === 1 ? "Pick the matching alphabet" : - )); + (this.state.tapCount === 1 ? "Pick the matching alphabet" : null)); return (
@@ -344,7 +331,7 @@ class DotTouch extends React.Component { {/* */}
Dot touch