Skip to content

Commit

Permalink
feat: add Provider to GameResultPage #190
Browse files Browse the repository at this point in the history
  • Loading branch information
Храмыцких Антон committed Aug 23, 2023
1 parent a4eb562 commit 73c154e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 5 additions & 3 deletions components/GameResult/GameResult.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ import { useEffect, useState } from 'react';
import { FinishedGameState } from 'gameApi';
import {IGameStateContext, useGameStateContext} from "../../contexts/GameStateContext";
export const GameResult= () => {
const gameStateContext: IGameStateContext = useGameStateContext();
const {finishResult, setFinishResult } = gameStateContext
console.log('COMPONENT GameResult', gameStateContext);
const gameStateContext = useGameStateContext();
console.log('Контекст в компоненте GameResult:', gameStateContext);

const { finishResult } = gameStateContext;
console.log('Данные из контекста в GameResult:', finishResult);

// const player1 = {
// playerName: '0xh20...7260',
Expand Down
2 changes: 2 additions & 0 deletions pages/game-result/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ const GameResultPage = () => {
return (
<div className={styles.wrapper}>
<div className={styles.container}>
<GameStateContextProvider>
<GameResult />
</GameStateContextProvider>
</div>
</div>
);
Expand Down

0 comments on commit 73c154e

Please sign in to comment.