You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🌱 Carbon Footprint Tracker - Pull Request
Description
This Pull Request implements the "Create Impact by Numbers" feature (Issue #21, assuming the issue number from the screenshot). It introduces a new section on the dashboard to display motivational statistics on collective user impact, including a count-up animation effect.
Type of Change
[ ] 🐛 Bug fix (non-breaking change which fixes an issue)
[x] ✨ New feature (non-breaking change which adds functionality)
[ ] 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] 📚 Documentation update
[x] 🎨 Style/UI update
[x] ♻️ Code refactoring (for count-up hook)
[ ] ⚡ Performance improvement
[ ] 🧪 Test addition or update
Related Issue Fixes#21 (Create 'Impact by Numbers' Section)
Changes Made
Created the ImpactStats.tsx component for displaying impact metrics.
Added mock data and the inspirational tagline to src/constants/impactStats.ts.
Implemented the useCountUp.ts custom hook to animate numbers on render.
Integrated the component into src/components/dashboard/dashboard.tsx, placing it below the "Today's Impact in Context" section.
Applied the requested light theme styling (bg-white container, bg-green-50 cards, and green accents) for a cohesive UI.
Updated the logic to correctly handle counting and formatting of all stats (10,000+, 2.5 tons, 500+).
Screenshots
Testing
[x] I have tested this change locally (verified static numbers and animation)
[ ] I have tested on mobile devices
[ ] I have tested on different browsers
[ ] All existing tests pass
[ ] I have added new tests (if applicable)
Checklist
[x] My code follows the project's style guidelines (Tailwind CSS, TypeScript/TSX)
[x] I have performed a self-review of my code
[ ] I have commented my code, particularly in hard-to-understand areas (All unnecessary comments were removed per request)
[ ] I have made corresponding changes to the documentation
[x] My changes generate no new warnings
[ ] I have added tests that prove my fix is effective or that my feature works
[ ] New and existing unit tests pass locally with my changes
Additional Notes
The count-up animation is designed to start on mount. If the animation is missed on the initial page load, the intended fix is to ensure the impactStats component is given a unique key in dashboard.tsx to force a re-render when the data finishes loading. This is currently implemented in the parent component logic.
Thank you for contributing to making digital sustainability more accessible! 🌍
This repository participates in Hacktoberfest 2025! 🎃
Hey @shriyaagg! Thanks for this great contribution! 🎉
The feature looks awesome and perfectly matches what was requested in #21. The animations are smooth and the code is well-structured!
However, there are a few things that need to be fixed before we can merge:
🔴 Must Fix:
Merge Conflicts - Please pull the latest main branch and resolve conflicts in Dashboard.tsx
Decimal Value Bug (src/constants/impactStats.ts:16)
// Current:value: 2500,// ❌ Wrong - animates to 2500.0 tons// Should be:value: 2.5,// ✓ Correct - animates to 2.5 tons
File Naming - Rename impactStats.tsx → ImpactStats.tsx (PascalCase for React components)
Import Path (Dashboard.tsx:14)
// Current:
import ImpactStats from '../impactStats';
// Should be:
import ImpactStats from '@/components/ImpactStats';
Add proper spacing in Dashboard.tsx:
)}
{/* Impact Statistics Section */}
{/* Recent Activities */}
🟡 Nice to Have (optional but recommended):
Remove hardcoded if (stat.id === 2) check - use a type field in the stat object instead
Fix the + sign logic - it should show during animation, not just at the end
Add a newline at the end of ImpactStats.tsx file
Testing
Once you fix these, please test that:
The 2.5 tons animation works correctly (not 2500 tons!)
All three stats animate smoothly
No console errors
Let me know if you need help with any of these fixes! 🚀
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
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.
🌱 Carbon Footprint Tracker - Pull Request
Description
This Pull Request implements the "Create Impact by Numbers" feature (Issue #21, assuming the issue number from the screenshot). It introduces a new section on the dashboard to display motivational statistics on collective user impact, including a count-up animation effect.
Type of Change
[ ] 🐛 Bug fix (non-breaking change which fixes an issue)
[x] ✨ New feature (non-breaking change which adds functionality)
[ ] 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] 📚 Documentation update
[x] 🎨 Style/UI update
[x] ♻️ Code refactoring (for count-up hook)
[ ] ⚡ Performance improvement
[ ] 🧪 Test addition or update
Related Issue
Fixes #21 (Create 'Impact by Numbers' Section)
Changes Made
Created the ImpactStats.tsx component for displaying impact metrics.
Added mock data and the inspirational tagline to src/constants/impactStats.ts.
Implemented the useCountUp.ts custom hook to animate numbers on render.
Integrated the component into src/components/dashboard/dashboard.tsx, placing it below the "Today's Impact in Context" section.
Applied the requested light theme styling (bg-white container, bg-green-50 cards, and green accents) for a cohesive UI.
Updated the logic to correctly handle counting and formatting of all stats (10,000+, 2.5 tons, 500+).
Screenshots

Testing
[x] I have tested this change locally (verified static numbers and animation)
[ ] I have tested on mobile devices
[ ] I have tested on different browsers
[ ] All existing tests pass
[ ] I have added new tests (if applicable)
Checklist
[x] My code follows the project's style guidelines (Tailwind CSS, TypeScript/TSX)
[x] I have performed a self-review of my code
[ ] I have commented my code, particularly in hard-to-understand areas (All unnecessary comments were removed per request)
[ ] I have made corresponding changes to the documentation
[x] My changes generate no new warnings
[ ] I have added tests that prove my fix is effective or that my feature works
[ ] New and existing unit tests pass locally with my changes
Additional Notes
The count-up animation is designed to start on mount. If the animation is missed on the initial page load, the intended fix is to ensure the impactStats component is given a unique key in dashboard.tsx to force a re-render when the data finishes loading. This is currently implemented in the parent component logic.
Thank you for contributing to making digital sustainability more accessible! 🌍
This repository participates in Hacktoberfest 2025! 🎃