Skip to content

fix(ui): event Cancel button invisible in light mode + button-style consistency sweep#523

Merged
KishParikh13 merged 1 commit into
v2from
fix/destructive-button-light-mode
Jun 17, 2026
Merged

fix(ui): event Cancel button invisible in light mode + button-style consistency sweep#523
KishParikh13 merged 1 commit into
v2from
fix/destructive-button-light-mode

Conversation

@KishParikh13

Copy link
Copy Markdown
Collaborator

Problem

The event page's Cancel Registration button was invisible in light mode (white text on no background — see screenshot).

Root cause

NativeWind 4's CssInterop silently drops the style={({ pressed }) => ...} function form on Pressable (already documented in PrimaryButton.native.tsx). The background/padding/border live in that callback, so they never apply. When the label is light/white, the result is white-on-transparent = invisible.

Fixed

Component Was Now
DestructiveButton (event + settings cancel) white text, dropped red bg → invisible className + active: (arbitrary hex #DC2626/#B91C1C)
EmptyPanel accent CTA textInverse on dropped accent bg → invisible static style + state press
SecondaryButton / GhostButton / IconButton dropped border/padding/press (dark text/icons stayed visible) array style + state-driven press

All keep their exact visuals and regain press feedback. tsc --noEmit clean.

Audit — remaining function-style Pressables (NOT broken, lower priority)

These use the same anti-pattern but their content stays visible today (icon or dark/theme text), so they only lose press-state chrome — safe to harden in a follow-up:

  • components/ui/TabHeader.tsx (icon buttons)
  • components/ui/AuthPromptModal.tsx (× close — colors.text)
  • components/invite/InviteCodeField.tsx
  • app/(tabs)/profile.web.tsx (web)
  • components/events/EventDetailPanel.web.tsx (web cancel — dark-red text, visible)

Verify

  • Light + dark mode: event "Cancel Registration" is a solid red button.
  • Board/feed empty-state CTA (EmptyPanel) shows its orange button.
  • Secondary/Ghost/Icon buttons render with padding/border + press feedback.

…tgun)

NativeWind 4's CssInterop silently drops the `style={({ pressed }) => ...}`
function form on Pressable, stripping background/padding/border/radius. Where
the label is light/white this left white-on-transparent — invisible in light
mode. Reported on the event page's "Cancel Registration" button; the same
failure also hit EmptyPanel's accent CTA.

Convert off the function form:
- DestructiveButton → className + active: (matches PrimaryButton.native), exact
  red via arbitrary hex so it's theme-config-independent
- SecondaryButton / GhostButton / IconButton → array style + state-driven press
- EmptyPanel accent CTA → static style + state-driven press

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 17, 2026

Copy link
Copy Markdown

Deploying chinmaya-janata with  Cloudflare Pages  Cloudflare Pages

Latest commit: 28e2032
Status: ✅  Deploy successful!
Preview URL: https://9abc4a3b.project-janatha.pages.dev
Branch Preview URL: https://fix-destructive-button-light.project-janatha.pages.dev

View logs

@KishParikh13 KishParikh13 merged commit 3bc1ec3 into v2 Jun 17, 2026
3 checks passed
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.

1 participant