ExerciseCard Component
TheExerciseCard component is a specialized card that displays workout exercise information including tier classification, weight, reps, sets, and optional logged data for progress tracking. It features spring animations on press and automatic formatting for special values like bodyweight (BW) and max reps (AMRAP).
Import
Basic Usage
Props
The exercise data object containing:
tier: Exercise tier (“T1” | “T2” | “T3a” | “T3b”)exercise: Exercise name (e.g., “Bench Press”)weight: Target weight (number or “BW” for bodyweight)reps: Target reps (number or “Max” for AMRAP)sets: Target sets (number or string like “3+” for AMRAP sets)
Callback function invoked when the card is pressed
Optional logged workout data for progress tracking:
weight?: number | string- Logged weightreps?: number | string- Logged repscompletedSets?: number- Number of sets completed
TargetExercise Type
Visual Breakdown
The ExerciseCard has four main sections:1. Header Section
- TierBadge: Shows exercise tier with color coding
- Progress Badge: Displays completed/total sets (only when loggedData provided)
2. Exercise Name
- Large heading (h3) with exercise name
- Uses ThemedText for consistent styling
3. Details Row
- Three columns: Weight, Reps, Sets
- Labels in secondary text color
- Values in h4 heading size
Formatting Helpers
The component includes built-in formatters for special values:Weight Formatting
185→ “185 lbs”"BW"→ “BW”
Reps Formatting
5→ “5”"Max"→ “AMRAP” (As Many Reps As Possible)
Sets Formatting
3→ “3”"3+"→ “3+ AMRAP”
Progress Tracking
WhenloggedData is provided, the card displays a progress badge:
Progress Badge Colors
- Complete
- In Progress
- No Progress
Background:
theme.success (green)Shown when completedSets === totalSetsTotal Sets Calculation
For AMRAP-style sets (e.g., “3+”), the component extracts the base number:5→ 5 sets"3+"→ 3 sets (base value)
Animation Behavior
The ExerciseCard uses spring-based press animations:- Press In: Scales to 0.98
- Press Out: Springs back to 1.0
- Duration: ~150-200ms with natural spring physics
Styling
Default Styles
Theme Colors
- Card Background:
theme.backgroundDefault - Exercise Name:
theme.text(via ThemedText) - Detail Labels:
theme.textSecondary - Detail Values:
theme.text(via ThemedText h4) - Progress Text:
#FFFFFF(white on colored background)
Tier System
Exercises are classified into tiers using the TierBadge component:T1 - Main Lifts
Primary compound movements (Bench, Squat, Deadlift, OHP)Heavy weight, low reps (1-5)
T2 - Secondary Lifts
Supporting compound movementsModerate weight, medium reps (5-10)
T3a - Primary Accessories
Important isolation workModerate weight, higher reps (8-12)
T3b - Secondary Accessories
Additional isolation exercisesLight weight, high reps (12-15+)
Complete Example
Here’s a complete example showing all features:Best Practices
Use onPress for navigation
Use onPress for navigation
Update logged data in real-time
Update logged data in real-time
Keep loggedData in sync with user actions:
Handle edge cases
Handle edge cases
Consider special values in your data:
Accessibility
- Animated press feedback provides clear visual response
- High contrast tier badges for quick identification
- Progress badge uses color + text for accessibility
- Adequate touch target size (card padding + content)
Dependencies
ThemedText- For all text renderingTierBadge- For tier classification displayuseTheme- For theme integrationreact-native-reanimated- For press animations@/types/workout- For TypeScript interfaces
Source Code
Location:client/components/ExerciseCard.tsx:1-166
The ExerciseCard is a self-contained component that handles its own animations and formatting logic while remaining flexible through props.