Overview
The cryptocurrency detail view provides comprehensive information about a specific cryptocurrency, including price data, market statistics, supply information, and percentage changes over different time periods.Navigation to Detail View
Users navigate to the detail screen by tapping on any cryptocurrency card in the list view. The navigation is implemented using Expo Router:CryptoCard.tsx
The detail screen uses dynamic routing with the cryptocurrency ID as a URL parameter (
/crypto/[id]).CryptoDetailScreen Component
The detail screen fetches and displays comprehensive cryptocurrency data:Component Structure
CryptoDetailScreen.tsx
Dynamic Title
The screen title dynamically updates to show the cryptocurrency name and symbol:Data Fields Displayed
The detail view shows 12 key data fields organized in a responsive grid layout:Information Grid
CryptoDetailScreen.tsx
Field Breakdown
Basic Information
Basic Information
Unidad monetaria (Name ID)Shows the unique identifier for the cryptocurrency.RankingMarket cap ranking position.
Price Information
Price Information
Precio (BTC)Current price in Bitcoin.Precio (USD)Current price in US Dollars, formatted as currency.
Percentage Changes
Percentage Changes
Cambio 1hPrice change over the last hour.Cambio 24hPrice change over the last 24 hours.Cambio 7dPrice change over the last 7 days.
Market Statistics
Market Statistics
Capitalización de mercadoTotal market capitalization in USD.Cambio de volumen24-hour volume change calculation.
Supply Information
Supply Information
Suministro circulanteCurrent circulating supply.Suministro totalTotal supply currently in existence.Suministro máximoMaximum possible supply (if applicable).
Grid Layout
The detail view uses a responsive 2-column grid layout:Loading and Error States
The component handles three states during the data fetching lifecycle:Volume Change Calculation
The screen calculates the 24-hour volume change percentage:- volume24: Current 24-hour trading volume
- volume24a: Previous 24-hour trading volume
- Result: Percentage change formatted to 2 decimal places
Styling Details
Container Styles
Key Features
- Comprehensive Data: 12 different data points about each cryptocurrency
- Dynamic Title: Navigation header updates with cryptocurrency name
- Responsive Grid: 2-column layout optimized for mobile viewing
- Loading States: Clear visual feedback during data fetching
- Error Handling: Graceful handling of missing or failed data
- Formatted Values: Currency and percentage formatting using utility functions
- Calculated Metrics: Volume change computed from API data
- Scrollable Content: ScrollView ensures all data is accessible on smaller screens
- Visual Hierarchy: Styled grid items with shadows and consistent spacing