Skip to content

Conversation

@vansh2408
Copy link

🌱 Carbon Footprint Tracker - Pull Request

Description

Problem

Badge tooltips were hardcoded for total_reduction badges only, breaking for other requirement types.

  • Added a getBadgeRequirementDescription() helper to dynamically generate tooltip text.
  • Updated BadgeDisplay.tsx to use the new helper instead of static text.
  • Supports all 6 requirement types (total_reduction, streak_days, activity_limit, tips_applied, consistency, milestone).

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ 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
  • 🎨 Style/UI update
  • ♻️ Code refactoring
  • ⚡ Performance improvement
  • 🧪 Test addition or update

Related Issue

Fixes #47

Testing

  • I have tested this change locally
  • I have tested on mobile devices
  • I have tested on different browsers
  • All existing tests pass
  • I have added new tests (if applicable)

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • 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

For Maintainers

  • Code review completed
  • Tests passing
  • Documentation updated
  • Ready to merge

Thank you for contributing to making digital sustainability more accessible! 🌍

This repository participates in Hacktoberfest 2025! 🎃

@vansh2408
Copy link
Author

Please review

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.

Fix badge tooltip content to support all requirement types

1 participant