feat: shared UI components — stats-card, course-progress-card, leaderboard-table, notification-bell - #392
Merged
DeFiVC merged 1 commit intoAug 29, 2026
Conversation
…otifications Closes ChainLearnOfficial#253 (stats-card), ChainLearnOfficial#254 (course-progress-card), ChainLearnOfficial#255 (leaderboard-table), ChainLearnOfficial#256 (notification-bell). - Add reusable StatsCard with icon, value, label, theme and trend indicator; use it in the dashboard stats grid - Add CourseProgressCard with animated progress, module count, completion status and continue action; use it in the dashboard My Courses section - Add LeaderboardTable with rank medallions, current-user highlight and a compact sidebar mode - Add notification system (types, API client, hook) and NotificationBell in the header with unread badge, read/unread states, empty and error states - Fix pre-existing syntax errors in loading-skeleton, module-list, quiz-interface and layout (broken imports / unclosed tags) that broke typecheck and tests
✅ Deploy Preview for chainlearn ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
@jajafwangshak86-ops Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #253
Closes #254
Closes #255
Closes #256
Summary
Reusable UI components that replace the ad-hoc markup currently duplicated across the dashboard and course pages.
#253 —
src/components/shared/stats-card.tsxprimary,success,warning,danger,purple,muted)aria-hidden, dark-mode aware#254 —
src/components/course/course-progress-card.tsx#255 —
src/components/shared/leaderboard-table.tsxui/tableprimitivescompactmode for sidebars (tighter cells, no avatars) and full mode for pages#256 — notification system
src/types/notification.ts,src/lib/api/notifications.ts,src/lib/hooks/use-notifications.tssrc/components/shared/notification-bell.tsxin the header: bell with unread-count badge, type-aware icons, relative timestamps, mark-read on click, mark-all-read, plus loading (skeleton), empty, and error/retry statesTests
New suites for all four components (34 tests) plus a fixed header suite. All new tests pass.
Notable: pre-existing fixes required for green CI
maindid not typecheck andnext buildwas broken. I fixed three minimal, unrelated syntax errors so the branch (and the repo) builds again:loading-skeleton.tsx— missingimport {on the skeleton importmodule-list.tsx— leftover duplicatedclassNameline from a botched mergequiz-interface.tsx— unclosed<p>taglayout.tsx— duplicatePageTransitionimportThese were confirmed broken on
main; the remaining failing tests (claim-button, credential-card date, legacy duplicate header test, loading-skeleton count assertions) also fail onmainand are outside these issues.Verification
npm run typecheck— cleannpm run lint— cleannpm run build— succeedsnpm test— 361 pass / 14 fail (the 14 are all pre-existing onmain; this branch fixes the previously-failing header suite)