## Major Features - Apple Watch companion app (6 phases complete) - WatchConnectivity iPhone ↔ Watch - HealthKit integration (HR, calories) - SwiftUI premium UI - 9 complication types - Always-On Display support - Paywall screen with RevenueCat integration - Privacy Policy screen - App rebranding: tabatago → TabataFit - Bundle ID: com.millianlmx.tabatafit ## Changes - New: ios/TabataFit Watch App/ (complete Watch app) - New: app/paywall.tsx (subscription UI) - New: app/privacy.tsx (privacy policy) - New: src/features/watch/ (Watch sync hooks) - New: admin-web/ (admin dashboard) - Updated: app.json, package.json (branding) - Updated: profile.tsx (paywall + privacy links) - Updated: i18n translations (EN/FR/DE/ES) - New: app icon 1024x1024 ## Watch App Files - TabataFitWatchApp.swift (entry point) - ContentView.swift (premium UI) - HealthKitManager.swift (HR + calories) - WatchSessionManager.swift (communication) - Complications/ (WidgetKit) - UserDefaults+Shared.swift (data sharing)
125 lines
2.7 KiB
TypeScript
125 lines
2.7 KiB
TypeScript
import { useState } from 'react'
|
|
import {
|
|
View,
|
|
Text,
|
|
TextInput,
|
|
TouchableOpacity,
|
|
StyleSheet,
|
|
ActivityIndicator,
|
|
} from 'react-native'
|
|
import { useAdminAuth } from '../../src/admin/components/AdminAuthProvider'
|
|
|
|
export default function AdminLoginScreen() {
|
|
const [email, setEmail] = useState('')
|
|
const [password, setPassword] = useState('')
|
|
const [error, setError] = useState('')
|
|
const { signIn, isLoading } = useAdminAuth()
|
|
|
|
const handleLogin = async () => {
|
|
if (!email || !password) {
|
|
setError('Please enter both email and password')
|
|
return
|
|
}
|
|
|
|
setError('')
|
|
try {
|
|
await signIn(email, password)
|
|
} catch (err) {
|
|
setError(err instanceof Error ? err.message : 'Login failed')
|
|
}
|
|
}
|
|
|
|
return (
|
|
<View style={styles.container}>
|
|
<View style={styles.card}>
|
|
<Text style={styles.title}>TabataFit Admin</Text>
|
|
<Text style={styles.subtitle}>Sign in to manage content</Text>
|
|
|
|
{error ? <Text style={styles.errorText}>{error}</Text> : null}
|
|
|
|
<TextInput
|
|
style={styles.input}
|
|
placeholder="Email"
|
|
placeholderTextColor="#666"
|
|
value={email}
|
|
onChangeText={setEmail}
|
|
autoCapitalize="none"
|
|
keyboardType="email-address"
|
|
/>
|
|
|
|
<TextInput
|
|
style={styles.input}
|
|
placeholder="Password"
|
|
placeholderTextColor="#666"
|
|
value={password}
|
|
onChangeText={setPassword}
|
|
secureTextEntry
|
|
/>
|
|
|
|
<TouchableOpacity
|
|
style={styles.button}
|
|
onPress={handleLogin}
|
|
disabled={isLoading}
|
|
>
|
|
{isLoading ? (
|
|
<ActivityIndicator color="#000" />
|
|
) : (
|
|
<Text style={styles.buttonText}>Sign In</Text>
|
|
)}
|
|
</TouchableOpacity>
|
|
</View>
|
|
</View>
|
|
)
|
|
}
|
|
|
|
const styles = StyleSheet.create({
|
|
container: {
|
|
flex: 1,
|
|
backgroundColor: '#000',
|
|
justifyContent: 'center',
|
|
alignItems: 'center',
|
|
padding: 20,
|
|
},
|
|
card: {
|
|
backgroundColor: '#1C1C1E',
|
|
borderRadius: 16,
|
|
padding: 32,
|
|
width: '100%',
|
|
maxWidth: 400,
|
|
},
|
|
title: {
|
|
fontSize: 28,
|
|
fontWeight: 'bold',
|
|
color: '#fff',
|
|
marginBottom: 8,
|
|
},
|
|
subtitle: {
|
|
fontSize: 16,
|
|
color: '#999',
|
|
marginBottom: 24,
|
|
},
|
|
errorText: {
|
|
color: '#FF3B30',
|
|
marginBottom: 16,
|
|
},
|
|
input: {
|
|
backgroundColor: '#2C2C2E',
|
|
borderRadius: 8,
|
|
padding: 16,
|
|
marginBottom: 16,
|
|
color: '#fff',
|
|
fontSize: 16,
|
|
},
|
|
button: {
|
|
backgroundColor: '#FF6B35',
|
|
borderRadius: 8,
|
|
padding: 16,
|
|
alignItems: 'center',
|
|
},
|
|
buttonText: {
|
|
color: '#000',
|
|
fontSize: 16,
|
|
fontWeight: 'bold',
|
|
},
|
|
})
|