MWalletCard
A card component that displays wallet information including balance, fiat value, and latest transaction time.Props
The name of the wallet
Wallet balance in satoshis
The fiat currency to display (e.g., ‘USD’, ‘EUR’)
The fiat equivalent of the wallet balance
Unix timestamp of the latest transaction
Gradient color configuration for the card background
Callback function when the card is pressed
Usage
Features
- Gradient background with customizable colors
- Displays balance in user’s preferred Bitcoin unit (sats/BTC)
- Shows fiat equivalent with currency symbol
- Relative time display for latest transaction
- Watermark Medusa logo
- Touch feedback with highlight effect
Detailed Implementation
Detailed Implementation
The component uses:
LinearGradientfromexpo-linear-gradientfor backgrounduseFormatBitcoinUnithook for balance formattingMTimeAgoTextfor relative time displayTouchableHighlightfor press interactions- Fixed width of 240px for consistent card sizing
MNewWalletButton
A button component for creating new wallets with a dashed border style.Props
Callback function when the button is pressed
Usage
Features
- Dashed border with bitcoin-colored outline
- Plus circle icon centered
- Matches MWalletCard dimensions (240px width)
- Internationalized “New Wallet” text
- Full height fill for consistent layout
Visual Style
Visual Style
The component features:
- Dashed border style for distinction from regular cards
Colors.bitcoinborder color- Centered content layout
- Icon and text vertical stack
MSettingsCard
A compound component for creating settings sections with items and labels.Main Component Props
The title of the settings section
Child components (typically
MSettingsCard.Item)MSettingsCard.Item Props
Reverse the layout order of children
Callback function when the item is pressed
Content to display in the item (typically
MSettingsCard.Label)MSettingsCard.Label Props
The label title
The label value
Whether to display the value in muted color
Usage
Features
- Compound component pattern for flexible composition
- Automatic rounded corners on first/last items
- Border separators between items
- Support for reverse layouts
- Consistent padding and spacing
Component Architecture
Component Architecture
The component uses Object.assign to create a compound component:This allows for clean, hierarchical JSX while maintaining type safety.