How eduardocruzpalacios/tic-tac-toe-react works
This React tic-tac-toe app routes users from its home page to solo play, play against a computer, or game history. Solo mode tracks turns, editable tokens, elapsed time, and move count; computer mode records completed outcomes. The app also exposes a dark/light theme switch. The graph follows calls and routing shown in excerpts or the source index; several UI and theme relationships are documented only by imports, so unsampled behavior is not inferred.
Main entry points: App.tsx App routes · OneVersusComputerGame.tsx Computer game · ThemeContext.ts Theme context · HomePage.tsx Home page
Components 16
App and navigation
- App routes
src/App.tsx - Home page
src/components/pages/HomePage/HomePage.tsx - Navigation
src/components/organisms/Nav/Nav.tsx
Game modes
- Solo game
src/components/organisms/SoloGame/SoloGame.tsx - Move counter
src/components/organisms/SoloGame/movesCountReducer.tsx - Computer game
src/components/organisms/OneVersusComputerGame/OneVersusComputerGame.tsx
Game history
- History view
src/components/organisms/GamesHistoric/GamesHistoric.tsx - History reducer
src/reducer/gamesHistoricReducer.ts - Game factory
src/reducer/gamesHistoricReducerFactory.ts - Browser storage
Theme and UI
- Header
src/components/organisms/Header/Header.tsx - Theme switch
src/components/molecules/DarkModeSwitch/DarkModeSwitch.tsx - Theme context
src/context/ThemeContext.ts - UI atoms
src/components/atoms - Style utilities
src/common/styleUtils.ts
Other components
- Player
Connections 20
- Player → App routes: opens app
- App routes → Home page: routes to
src/App.tsx - App routes → Solo game: routes to
src/App.tsx - App routes → Computer game: routes to
src/App.tsx - App routes → History view: routes to
src/App.tsx - Home page → Header: renders
src/components/pages/HomePage/HomePage.tsx - Home page → Navigation: renders
src/components/pages/HomePage/HomePage.tsx - Solo game → Move counter: dispatches moves
src/components/organisms/SoloGame/SoloGame.tsx - Solo game → UI atoms: renders controls
src/components/organisms/SoloGame/SoloGame.tsx - Computer game → UI atoms: renders controls
src/components/organisms/OneVersusComputerGame/OneVersusComputerGame.tsx - Computer game → Game factory: creates result
src/components/organisms/OneVersusComputerGame/OneVersusComputerGame.tsx - Computer game → History reducer: records result
src/components/organisms/OneVersusComputerGame/OneVersusComputerGame.tsx - History view → History reducer: loads history
src/components/organisms/GamesHistoric/GamesHistoric.tsx - History reducer → Browser storage: reads and writes
src/reducer/gamesHistoricReducer.ts - Header → Theme switch: renders
src/components/organisms/Header/Header.tsx - Theme switch → Theme context: updates theme
src/components/molecules/DarkModeSwitch/DarkModeSwitch.tsx - App routes → Theme context: provides theme
src/App.tsx - Header → Theme context: reads theme
src/components/organisms/Header/Header.tsx - Navigation → Theme context: reads theme
src/components/organisms/Nav/Nav.tsx - UI atoms → Style utilities: uses style values
src/components/atoms/Tile/styled.ts