import React, { useState, useEffect } from 'react'; import { View, Text, Pressable } from 'react-native'; import { ThemeProvider, useT, T, Screen, Scroll, Header, NavBar, Card, Group, Row, Button, Segmented, Chip, Pill, Stat, Bars, Spark, Progress, TabBar, Tabs, Stack, Icon, Spacer, SectionTitle, Gradient, alpha } from './ui/kit'; const ACCENT = '#FB923C'; const THEME = { dark: { bg: '#0F0A06', card: '#1B140E', card2: '#291E15', line: '#2E231A', text2: '#B4A090', text3: '#75655A' }, light: { bg: '#FBF3EC', card: '#FFFFFF', card2: '#F3E2D4' } }; const RUNS = [ { id: 1, name: 'Morning intervals', when: 'Today', km: 5.2, time: '26:32', pace: '5:06', kcal: 312, splits: [5.2, 5.07, 4.97, 5.14, 4.86], elev: 42 }, { id: 2, name: 'Easy river loop', when: 'Sun', km: 8.1, time: '44:50', pace: '5:32', kcal: 480, splits: [5.6, 5.5, 5.5, 5.4, 5.6, 5.5, 5.4, 5.3], elev: 18 }, { id: 3, name: 'Long run', when: 'Fri', km: 15.0, time: '1:22:10', pace: '5:28', kcal: 890, splits: [5.5, 5.4, 5.5, 5.4, 5.3, 5.5, 5.4, 5.6, 5.4, 5.3, 5.5, 5.4, 5.3, 5.2, 5.1], elev: 120 }, { id: 4, name: 'Tempo', when: 'Wed', km: 6.0, time: '28:48', pace: '4:48', kcal: 360, splits: [5.1, 4.8, 4.7, 4.7, 4.8, 4.7], elev: 30 }, ]; const WEEKKM = [6, 0, 8.1, 0, 15, 8.1, 5.2]; const DAYS = ['M', 'T', 'W', 'T', 'F', 'S', 'S']; const paceOf = (m) => Math.floor(m) + ':' + (Math.round((m % 1) * 60) < 10 ? '0' : '') + Math.round((m % 1) * 60); function RunScreen({ nav }) { const t = useT(); const [state, setState] = useState('ready'); const [sec, setSec] = useState(0); useEffect(() => { if (state !== 'running') return; const id = setInterval(() => setSec((s) => s + 1), 1000); return () => clearInterval(id); }, [state]); const km = sec * 0.0032; const mm = Math.floor(sec / 60), ss = sec % 60; return (
} /> {[[60, 70], [140, 40], [250, 62], [300, 130], [120, 150]].map((p, i) => )} {km.toFixed(2)} kilometres {mm}:{ss < 10 ? '0' + ss : ss}time {km > 0.05 ? paceOf(sec / 60 / km) : '--:--'}pace /km {state === 'running' ? 152 : 68}bpm {state === 'ready' ?