feat: add empty state to StreakTracker when no contribution data#277
feat: add empty state to StreakTracker when no contribution data#277srinidhi-2006-bit wants to merge 8 commits into
Conversation
|
@srinidhi-2006-bit is attempting to deploy a commit to the PRIYANSHU DOSHI's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Good empty state! One small fix — the CTA button text uses className="mt-4 rounded-md bg-[var(--accent)] px-4 py-2 text-sm font-medium text-[var(--accent-foreground)] transition-opacity hover:opacity-90"Fix and push — will merge. |
|
Updated the CTA button text color to use Pushed the requested fix. Thank you for the review! |
Priyanshu-byte-coder
left a comment
There was a problem hiding this comment.
CSS vars are now correct. One formatting fix needed:
Indentation of the new if block
The block uses 4-space indentation for the outer if, inconsistent with the rest of the file which uses 2 spaces:
// current (wrong indentation)
if (
!contributionData ||
// should be
if (
!contributionData ||Also remove the blank line that was deleted before the block (the diff removes a \n that should stay). After fixing indentation this is ready to merge.
Priyanshu-byte-coder
left a comment
There was a problem hiding this comment.
1. Add blank line before const MILESTONES — closing } of the empty-state block and the constant declaration are jammed together.
2. Edge case — the check Object.keys(contributionData.data).length === 0 misses users who have data keys but all values are 0. Consider also guarding on contributions.total === 0, or document why you don't.
3. Checklist incomplete — confirm npm run lint and npm run type-check pass locally before resubmitting.
|
Fixed the requested changes:
Thanks for the detailed review! |
Summary
Added a friendly empty state to StreakTracker when contribution data is unavailable to improve user experience and avoid displaying misleading empty statistics.
Closes #204
Type of Change
Changes Made
How to Test
Screenshots (if UI change)
N/A
Checklist
npm run lintpasses locallynpm run type-check)