How cs-truong/caculator_ga works
This is a React handheld-calculator simulator. A user presses keypad controls; the keypad dispatches input through shared calculator state, the adapter applies state transitions and invokes arithmetic operations in the engine, and the display renders the formatted result. The same state layer maintains calculation history, while the interface exposes history and service metadata panels. The graph follows the supplied excerpts and README; unsampled styling details and undocumented runtime connections are omitted.
Main entry points: CalculatorContext.jsx Calculator state and history · CalculatorApp.jsx Calculator panels · App.jsx App provider wrapper · Keypad.jsx Input keypad
Components 10
Application entry
- React mount
src/main.jsx - App provider wrapper
src/App.jsx - Interface styles
src/index.css
Calculator interface
- Calculator panels
src/components/CalculatorApp.jsx - Input keypad
src/components/Keypad.jsx - Result display
src/components/Display.jsx
Calculation logic
- Calculator state and history
src/context/CalculatorContext.jsx - Input adapter
src/logic/calculatorAdapter.js - Calculation engine
src/logic/engine.js
Other components
- Calculator user
Connections 14
- React mount → App provider wrapper: renders
src/main.jsx - React mount → Interface styles: loads styles
src/main.jsx - App provider wrapper → Calculator state and history: provides state
src/App.jsx - App provider wrapper → Calculator panels: renders
src/App.jsx - Calculator panels → Calculator state and history: reads panel data
src/components/CalculatorApp.jsx - Calculator panels → Result display: renders
src/components/CalculatorApp.jsx - Calculator panels → Input keypad: renders
src/components/CalculatorApp.jsx - Calculator user → Input keypad: presses controls
- Input keypad → Calculator state and history: dispatches input
src/components/Keypad.jsx - Result display → Calculator state and history: reads display data
src/components/Display.jsx - Calculator state and history → Input adapter: processes input
src/context/CalculatorContext.jsx - Calculator state and history → Input adapter: gets service info
src/context/CalculatorContext.jsx - Calculator state and history → Calculation engine: formats display
src/context/CalculatorContext.jsx - Input adapter → Calculation engine: calculates operations
src/logic/calculatorAdapter.js