Skip to content

feat: wire sidebar, toast notifications, and fix module completion state#7

Merged
DeFiVC merged 1 commit into
mainfrom
feature/sidebar-toast-module-fix
Jul 8, 2026
Merged

feat: wire sidebar, toast notifications, and fix module completion state#7
DeFiVC merged 1 commit into
mainfrom
feature/sidebar-toast-module-fix

Conversation

@DeFiVC

@DeFiVC DeFiVC commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Import Sidebar component into dashboard layout (hidden on mobile, visible on lg+ screens)
  • Add context-based ToastProvider for shared cross-component toast state
  • Add toast notifications on wallet connect, enrollment, module completion, and reward claiming
  • Fix ModuleList always showing modules as incomplete — now passes enrollment.completedModules instead of []

Closes #9, #10, #11

Test plan

  1. Open app on desktop (>1024px) — sidebar visible with nav links
  2. Resize to mobile — sidebar hidden, MobileNav appears
  3. Connect wallet → success toast appears
  4. Enroll in course → success toast appears
  5. Complete a module → success toast appears
  6. Return to course detail → completed modules show green checkmarks
  7. Claim a reward → success toast appears

@netlify

netlify Bot commented Jul 8, 2026

Copy link
Copy Markdown

Deploy Preview for chainlearn ready!

Name Link
🔨 Latest commit 138a1bd
🔍 Latest deploy log https://app.netlify.com/projects/chainlearn/deploys/6a4ead38f2d74700098e203d
😎 Deploy Preview https://deploy-preview-7--chainlearn.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

- Add ToastContextProvider for shared cross-component toast state
- Wrap layout with ToastProvider, remove per-page ToastContainer instances
- Fix ModuleList always showing modules as incomplete (pass enrollment.completedModules)
- Convert all pages from local useToast to context-based useToastContext
@DeFiVC DeFiVC force-pushed the feature/sidebar-toast-module-fix branch from 0ab70d2 to 138a1bd Compare July 8, 2026 20:04
@DeFiVC

DeFiVC commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

Review Summary

Retargeted to main and rebased — no more merge conflicts.

What's Good

  • ToastContextProvider uses createContext + useContext for shared state
  • useCallback on addToast/removeToast prevents unnecessary re-renders
  • Module completion fix: enrollment?.completedModules ?? [] from Zustand store
  • All pages converted from local useToast to shared useToastContext

Note

@DeFiVC DeFiVC merged commit 4c4b5d6 into main Jul 8, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant