BirthdayBanner
Animated banner that displays a birthday celebration message with a discount badge.Location
/src/components/ui/BirthdayBanner.tsx
Props
The discount amount as a decimal (e.g.,
0.15 for 15% off). Automatically converted to a percentage for display.Usage
Animation
The banner usesreact-native-reanimated for smooth entrance animations:
- Slide in: Translates from -80px with a spring animation
- Fade in: Opacity animates from 0 to 1 over 400ms
Visual structure
The banner includes:- Cake icon (from
lucide-react-native) - Title: “Mesa de celebracion”
- Subtitle: “Tienes un descuento especial aplicado”
- Discount badge with tag icon showing percentage
Styling
- Background: Dark gold (
#2A2200) - Border: Gold accent color (
Brand.birthday) - Border radius: 14px
- Padding: 16px horizontal, 12px vertical
- Gap between elements: 12px
ErrorState
Full-screen error state component for unrecoverable flows like permission denials or network errors.Location
/src/components/ui/ErrorState.tsx
Props
Icon element to display at the top of the error state (typically from
lucide-react-native)Bold heading text that describes the error
Secondary message text explaining the error in detail
Primary action button configuration
Secondary action button configuration (same structure as
primaryAction)Usage
Visual hierarchy
- Icon (60px size)
- Title (22px, bold, primary text color)
- Message (15px, secondary text color, centered)
- Primary button (filled, brand color)
- Secondary button (text only, secondary color)
Button styling
Primary button:- Background:
Brand.primary - Text color: White
- Padding: 32px horizontal, 14px vertical
- Border radius: 14px
- Optional icon on the left
- No background (text only)
- Text color:
Brand.textSecondary - Padding: 10px vertical
ToastMessage
Animated toast notification that slides in from the top for non-blocking feedback.Location
/src/components/ui/ToastMessage.tsx
Props
Controls whether the toast is visible. When set to
true, triggers the entrance animation.The message text to display in the toast. Limited to 2 lines with
numberOfLines={2}.Callback function invoked when the exit animation completes. Use this to reset parent component state.
Auto-dismiss delay in milliseconds. The toast will remain visible for this duration before fading out.
Usage
Animation sequence
The toast usesreact-native-reanimated with a three-phase sequence:
- Enter (250ms): Fade in and slide down from -20px to 0px
- Hold (duration): Remain visible at full opacity
- Exit (300ms): Fade out and slide back up to -20px, then call
onHide
Visual styling
- Position: Absolute, 20px from top and sides
- Background: Dark semi-transparent (
rgba(30, 30, 30, 0.95)) - Border radius: 14px
- Border: 1px,
Brand.bordercolor - Shadow: Elevated with 8px elevation
- Icon: Alert circle, 18px, white
- Text: White, 14px, 2 lines max
- Layout: Horizontal row with 10px gap
- Z-index: 999 (top layer)
- Pointer events: None (non-interactive)
Lifecycle integration
TheonHide callback allows parent components to clean up state after the toast exits:
Dependencies
All UI components use:react-native: Core mobile componentsreact-native-reanimated: Smooth animationslucide-react-native: Icon library@/constants/Colors: Brand color constants