perennialAutodidact / memory-snap

0 stars 0 forks source link

87 create game stage controller #88

Closed russfraze closed 8 months ago

russfraze commented 9 months ago

## Description of changes Now a useEffect at App level automatically navigates to the path that corresponds to the current game stage.

Test steps

In the game context, change the stage value from 'PLAYING' to 'SETUP' to 'GAME_OVER' and save after each. Check that the correct game component is displayed at each path.

perennialAutodidact commented 9 months ago

We'll also need tests for switching between paths when the app is used. For instance, when the setup form is submitted, it should change the path to render the game, when the game is over it should change the path to render game over, etc. This can be on another ticket.

russfraze commented 9 months ago

@perennialAutodidact changes made!

russfraze commented 9 months ago

I have the routes index file setup like that. But I'm getting an error in the game context. Screen Shot 2024-02-16 at 11 26 04 AM

It looks like the error is coming from line 5 but I cant understand why its not importing the right way. Am I having a brain malfunction?

Screen Shot 2024-02-16 at 11 28 25 AM

perennialAutodidact commented 8 months ago

Could be a problem with the absolute import configuration. What's the import error say?

russfraze commented 8 months ago

@perennialAutodidact now that that GAME_STAGES object is being imported from its own file like we talked about, this PR should be up to date.