import React, { useState, createContext, useContext } from 'react'; import { View, Text, Pressable } from 'react-native'; import { ThemeProvider, useT, T, Screen, Scroll, Header, NavBar, Card, Group, Row, Button, Chip, Pill, Stat, Ring, Bars, Progress, Avatar, TabBar, Tabs, Stack, Icon, Spacer, SectionTitle, Gradient, alpha } from './ui/kit'; const ACCENT = '#22C55E'; const THEME = { dark: { bg: '#07110A', card: '#0F1D13', card2: '#182A1D', line: '#1B2F20', text2: '#93B09A', text3: '#58715E' }, light: { bg: '#EEF7F0', card: '#FFFFFF', card2: '#DCEBDF' } }; const UNITS = [ { id: 1, name: 'Greetings', icon: 'Hand', c: '#22C55E', done: 5, total: 5 }, { id: 2, name: 'Café orders', icon: 'Coffee', c: '#F59E42', done: 3, total: 5 }, { id: 3, name: 'Directions', icon: 'Navigation', c: '#38BDF8', done: 1, total: 5 }, { id: 4, name: 'Numbers', icon: 'Hash', c: '#A78BFA', done: 0, total: 5 }, { id: 5, name: 'At the market', icon: 'ShoppingBag', c: '#FF6B9D', done: 0, total: 5 }, ]; const QUIZ = [ { q: 'How do you say "a coffee, please"?', a: ['Un café, por favor', 'Una mesa, por favor', 'La cuenta, por favor', 'Buenos días'], ok: 0 }, { q: 'What does "la cuenta" mean?', a: ['The table', 'The bill', 'The menu', 'The water'], ok: 1 }, { q: 'Pick the translation of "to the left"', a: ['A la derecha', 'Todo recto', 'A la izquierda', 'Aquí'], ok: 2 }, ]; const Store = createContext(null); function LearnScreen({ nav }) { const t = useT(); const { xp } = useContext(Store); return (
} /> {Math.min(50, xp)} {xp >= 50 ? 'Daily goal reached' : (50 - xp) + ' XP to your daily goal'} One short lesson keeps the 14 day streak alive. {UNITS.map((u, i) => { const locked = i > 0 && UNITS[i - 1].done < UNITS[i - 1].total; const current = !locked && u.done < u.total; return ( nav.push('lesson', { id: u.id })} style={({ pressed }) => [{ alignItems: 'center', marginLeft: (i % 2 ? 90 : -90) }, pressed && { transform: [{ scale: 0.95 }] }]}> = u.total ? 'Check' : u.icon} size={28} color={locked ? t.text3 : '#fff'} strokeWidth={2.4} /> {u.name} {current ? : null} ); })} ); } function PracticeScreen({ nav }) { const t = useT(); return (