Skip to content
This repository has been archived by the owner on Dec 5, 2023. It is now read-only.

Commit

Permalink
Removes skip round logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Yauheni committed Jul 27, 2023
1 parent 6493a85 commit f75c6a9
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions frontend/src/features/Game/component/Layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { Road } from '../Road';
import { Button } from '@/ui';
import accelerateSVG from '@/assets/icons/accelerate-icon.svg';
import shootSVG from '@/assets/icons/shoot-icon.svg';
import crossSVG from '@/assets/icons/cross-icon.svg';
import { CONFIG, CURRENT_GAME } from '@/atoms';
import { usePlayerMoveMessage, useStartGameMessage } from '../../hooks';
import { YourRewards } from '../YourRewards';
Expand All @@ -26,21 +25,17 @@ function Layout() {
const sendPlayerMoveMessage = usePlayerMoveMessage();
const { meta, message } = useStartGameMessage();

const defineStrategyAction = (type: 'accelerate' | 'shoot' | 'none') => {
const defineStrategyAction = (type: 'accelerate' | 'shoot') => {
if (type === 'accelerate') {
return 'BuyAcceleration';
}

if (type === 'shoot') {
return 'BuyShell';
}

if (type === 'none') {
return 'Skip';
}
};

const handleActionChoose = (type: 'accelerate' | 'shoot' | 'none') => {
const handleActionChoose = (type: 'accelerate' | 'shoot') => {
setIsPlayerAction(false);
const payload = {
PlayerMove: {
Expand Down Expand Up @@ -142,15 +137,6 @@ function Layout() {
className={cx(styles['control-button'], styles['control-button-red'])}
onClick={() => handleActionChoose('shoot')}
/>
<Button
label="Skip"
variant="primary"
size="large"
icon={crossSVG}
disabled={!isPlayerAction}
className={cx(styles['control-button'], styles['control-button-gray'])}
onClick={() => handleActionChoose('none')}
/>
</div>
)}
{currentGame.state === 'Finished' && (
Expand Down

0 comments on commit f75c6a9

Please sign in to comment.