Skip to content

refactor: use shared POLL_VOTES constant for vote badge styling#580

Merged
rickstaa merged 1 commit intomainfrom
refactor/improve-vote-against-badge-styling
Mar 5, 2026
Merged

refactor: use shared POLL_VOTES constant for vote badge styling#580
rickstaa merged 1 commit intomainfrom
refactor/improve-vote-against-badge-styling

Conversation

@rickstaa
Copy link
Member

@rickstaa rickstaa commented Mar 5, 2026

Description

Refactors the "Against" vote badge in the transactions list to use the shared POLL_VOTES constant instead of inline styles. This ensures consistent vote badge styling across the app (matching the Voting page) and fixes the "Against" badge appearance.

Type of Change

  • refactor: Code refactoring (no behavior change)

Related Issue(s)

N/A

Changes Made

  • Replaced inline backgroundColor/color styling for vote badges in TransactionsList with the shared POLL_VOTES constant from @lib/api/types/votes
  • Reuses POLL_VOTES[].style and POLL_VOTES[].text so "For" and "Against" badges render consistently with other vote displays
  • Simplified the ternary logic into a single vote lookup

Testing

  • Tested locally
  • All tests passing

How to test

  1. Navigate to the Explorer transactions list
  2. Find a Vote transaction with an "Against" choice
  3. Verify the badge now has proper styling consistent with vote badges elsewhere in the app

Impact / Risk

Risk level: Low

Impacted areas: UI

User impact: "Against" vote badges in the transactions list now render with consistent styling matching the rest of the app.

Rollback plan: Revert PR

Screenshots / Recordings

Before

image

After

image

Additional Notes

🤖 Generated with Claude Code

@rickstaa rickstaa requested a review from ECWireless as a code owner March 5, 2026 03:42
Copilot AI review requested due to automatic review settings March 5, 2026 03:42
@vercel
Copy link
Contributor

vercel bot commented Mar 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
explorer-arbitrum-one Ready Ready Preview, Comment Mar 5, 2026 3:58am

Request Review

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors the Transactions list “VoteEvent” badge rendering to use the shared POLL_VOTES vote metadata (text + styles), aligning poll vote badge styling with the rest of the app (notably the Voting page).

Changes:

  • Import and use POLL_VOTES for poll vote badge text/style instead of inline badge colors.
  • Replace inline ternary styling with a single POLL_VOTES lookup for “For” vs “Against”.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Replace inline badge styles in VoteEvent with the shared POLL_VOTES
constant to keep vote styling consistent across the app.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@rickstaa rickstaa force-pushed the refactor/improve-vote-against-badge-styling branch from cf6fd9c to c49d379 Compare March 5, 2026 03:55
@rickstaa rickstaa merged commit d379dd8 into main Mar 5, 2026
8 checks passed
@rickstaa rickstaa deleted the refactor/improve-vote-against-badge-styling branch March 5, 2026 08:26
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.

2 participants