aryanqq99's picture
πŸ“„ Detailed Instruction: Page Routing and Navigation Structure βœ… Requirement: You must build the following pages as independent components within the application: Dashboard Page Toss Page Wallet Page History Page Each of these pages should be fully functional on its own, and the user should be able to navigate between them seamlessly using buttons or links. πŸ› οΈ Functional Breakdown 1. πŸ” Routing Setup Use React Router (v6 or later) to define routes for each page. Ensure that when a user clicks on a navigation link (like from the sidebar or top navbar), the corresponding page component is displayed without reloading the site (Single Page Application behavior). js Copy Edit <Route path="/dashboard" element={<Dashboard />} /> <Route path="/toss" element={<TossGame />} /> <Route path="/wallet" element={<Wallet />} /> <Route path="/history" element={<TossHistory />} /> 2. πŸ“‹ Navigation UI Create a navigation menu (either sidebar or top bar) that appears after a user logs in. The menu should include buttons or links for: Dashboard Toss Wallet History Each button should use <Link to="/route"> from React Router, so that clicking it changes the page without a full reload. jsx Copy Edit <Link to="/dashboard">Dashboard</Link> <Link to="/toss">Toss</Link> <Link to="/wallet">Wallet</Link> <Link to="/history">History</Link> 3. πŸ“„ Page Requirements a. Dashboard Page Show user welcome message Display wallet balance Quick links to Toss or Wallet Optional: Graph of recent activity b. Toss Page Display animated coin Button to initiate toss Show toss result after 3-4 seconds Deduct coin fee from wallet Update history upon result c. Wallet Page Display current wallet balance Button to "Add Money" (connect Razorpay or payment mockup) List of wallet top-ups and deductions d. History Page Show list/table of all previous tosses Each item includes: Result (Heads/Tails) Time/Date Amount involved (optional) Pull data from database or mock storage (local state or Firebase) βœ… Expected Behavior: When a user clicks on "Wallet", the WalletPage component is loaded. When they click "Toss", it navigates to the TossPage, and the toss logic runs as expected. Similarly, "History" opens the HistoryPage, and "Dashboard" brings them back to the overview. The URL should reflect each page (/wallet, /toss, etc.). Navigation must be fast, seamless, and without a full page refresh. - Initial Deployment
b915f00 verified