Training Module
The Training module provides all training-related UI screens and functionality.
Accessing the Module
import { AzeooUI } from '@azeoo/react-native-sdk';
const training = AzeooUI.instance.training;
Methods
showMainScreen
Shows the main training screen with an overview of all training features.
showMainScreen()
Example:
training.showMainScreen();
showWorkoutPlans
Shows the workout plans screen where users can browse available workout plans.
showWorkoutPlans()
Example:
training.showWorkoutPlans();
showWorkoutPlan
Shows a specific workout plan.
showWorkoutPlan(planId: string)
Parameters:
planId(string): The ID of the workout plan to display.
Example:
training.showWorkoutPlan('plan-123');
showExercises
Shows the exercises screen where users can browse the exercise library.
showExercises()
Example:
training.showExercises();
showExercise
Shows a specific exercise.
showExercise(exerciseId: string)
Parameters:
exerciseId(string): The ID of the exercise to display.
Example:
training.showExercise('exercise-456');
showProgress
Shows the progress screen where users can track their fitness progress.
showProgress()
Example:
training.showProgress();
showSchedule
Shows the schedule screen where users can manage their workout schedule.
showSchedule()
Example:
training.showSchedule();
Complete Example
import React from 'react';
import { View, TouchableOpacity, Text, StyleSheet } from 'react-native';
import { AzeooUI } from '@azeoo/react-native-sdk';
const TrainingScreen = () => {
const training = AzeooUI.instance.training;
const menuItems = [
{ label: 'Main Screen', action: () => training.showMainScreen() },
{ label: 'Workout Plans', action: () => training.showWorkoutPlans() },
{ label: 'Exercises', action: () => training.showExercises() },
{ label: 'Progress', action: () => training.showProgress() },
{ label: 'Schedule', action: () => training.showSchedule() },
];
return (
<View style={styles.container}>
{menuItems.map((item, index) => (
<TouchableOpacity
key={index}
style={styles.button}
onPress={item.action}
>
<Text style={styles.buttonText}>{item.label}</Text>
</TouchableOpacity>
))}
</View>
);
};
const styles = StyleSheet.create({
container: {
flex: 1,
padding: 20,
},
button: {
backgroundColor: '#0284C7',
padding: 15,
borderRadius: 8,
marginBottom: 10,
},
buttonText: {
color: 'white',
fontSize: 16,
textAlign: 'center',
},
});
export default TrainingScreen;
Next Steps
- Nutrition Module - Nutrition-related screens
- Configuration - Customize the UI
- Client API - Low-level API reference