| 1 | import { View, StyleSheet } from "react-native";
|
| 2 | import { Text } from "@/components/ui/Text";
|
| 3 | import { ScreenLayout } from "@/components/ui/ScreenLayout";
|
| 4 | import { useAuth } from "@/context/AuthContext";
|
| 5 | import { Section, SectionHeader } from "@/components/ui/Sections";
|
| 6 | import { Card } from "@/components/ui/Cards";
|
| 7 | import { Grid } from "@/components/ui/LayoutHelpers";
|
| 8 | import { Button } from "@/components/ui/Button";
|
| 9 | import {
|
| 10 | Shadows,
|
| 11 | Colors,
|
| 12 | Typography,
|
| 13 | Spacing,
|
| 14 | BorderRadius,
|
| 15 | } from "@/constants/theme";
|
| 16 | import { Ionicons, Octicons } from "@expo/vector-icons";
|
| 17 | import { Link, router } from "expo-router";
|
| 18 |
|
| 19 | export default function Actions() {
|
| 20 | const { user } = useAuth();
|
| 21 |
|
| 22 | const onPressSleep = () => {
|
| 23 | router.push("/sleep/new");
|
| 24 | };
|
| 25 |
|
| 26 | const onPressTrigger = () => {
|
| 27 | router.push("/triggers/new");
|
| 28 | };
|
| 29 |
|
| 30 | return (
|
| 31 | <ScreenLayout
|
| 32 | userName={user?.firstName}
|
| 33 | userAvatar={user?.avatarURL}
|
| 34 | showNotificationBadge={true}
|
| 35 | >
|
| 36 | <Section>
|
| 37 | <SectionHeader
|
| 38 | title="Ações de Cuidado"
|
| 39 | subtitle="Registre atividades, acompanhe medicamentos e mantenha sua rotina organizada"
|
| 40 | ></SectionHeader>
|
| 41 |
|
| 42 | <Button
|
| 43 | title="Registrar ação de cuidado"
|
| 44 | size="large"
|
| 45 | onPress={() => router.push('/care-actions/new')}
|
| 46 | style={{ ...Shadows.lg }}
|
| 47 | />
|
| 48 | </Section>
|
| 49 |
|
| 50 | <Card style={{ padding: Spacing.cardGap, height: 150 }} onPress={() => router.push('/medicine-regimens')}>
|
| 51 | <View style={[styles.cardIcon, { backgroundColor: "#E7FDEF" }]}>
|
| 52 | <Ionicons name="bandage-outline" size={20} color="#13EC5B" />
|
| 53 | </View>
|
| 54 |
|
| 55 | <Text style={styles.cardTitleHeadline}>Gerenciar Medicamentos</Text>
|
| 56 |
|
| 57 | <Text style={styles.cardDescriptionHeadline}>
|
| 58 | Organize seus medicamentos, horários e doses
|
| 59 | </Text>
|
| 60 | </Card>
|
| 61 |
|
| 62 | <Grid gap={4}>
|
| 63 | <Card onPress={onPressSleep} style={{ padding: Spacing.cardGap }}>
|
| 64 | <View style={[styles.cardIcon, { backgroundColor: "#EFF6FF" }]}>
|
| 65 | <Ionicons name="moon-outline" size={20} color="#2563EB" />
|
| 66 | </View>
|
| 67 |
|
| 68 | <Text style={styles.cardTitle}>Registrar Sono</Text>
|
| 69 |
|
| 70 | <Text style={styles.cardDescription}>
|
| 71 | Registre a duração e a qualidade do sono
|
| 72 | </Text>
|
| 73 | </Card>
|
| 74 |
|
| 75 | <Card style={{ padding: Spacing.cardGap }} onPress={onPressTrigger}>
|
| 76 | <View style={[styles.cardIcon, { backgroundColor: "#FFF7ED" }]}>
|
| 77 | <Ionicons name="flash-outline" size={20} color="#EA580C" />
|
| 78 | </View>
|
| 79 |
|
| 80 | <Text style={styles.cardTitle}>Registrar Gatilho</Text>
|
| 81 |
|
| 82 | <Text style={styles.cardDescription}>
|
| 83 | Registre eventos que aferatam seu humor
|
| 84 | </Text>
|
| 85 | </Card>
|
| 86 | </Grid>
|
| 87 |
|
| 88 | <Card style={styles.disclaimerCard}>
|
| 89 | <View style={styles.disclaimerTitleContainer}>
|
| 90 | <Ionicons
|
| 91 | name="information-circle-outline"
|
| 92 | size={20}
|
| 93 | color={Colors.light.tint}
|
| 94 | />
|
| 95 | <Text style={styles.disclaimerTitleText}>Nota de Apoio</Text>
|
| 96 | </View>
|
| 97 |
|
| 98 | <Text style={styles.disclaimerText}>
|
| 99 | Este aplicativo é um assistente digital para auxiliar no seu
|
| 100 | monitoramento diário. Em caso de emergência ou sintomas graves, entre
|
| 101 | em contato imediatamente com seu médico ou serviços de saúde locais.
|
| 102 | </Text>
|
| 103 |
|
| 104 | <View style={styles.disclaimerHelp}>
|
| 105 | <Link href="https://expo.dev" style={styles.disclaimerHelpText}>
|
| 106 | Ver canais de ajuda{" "}
|
| 107 | <Octicons name="link-external" size={12} color="black" />
|
| 108 | </Link>
|
| 109 | </View>
|
| 110 | </Card>
|
| 111 | </ScreenLayout>
|
| 112 | );
|
| 113 | }
|
| 114 |
|
| 115 | const styles = StyleSheet.create({
|
| 116 | cardIcon: {
|
| 117 | paddingVertical: 15,
|
| 118 | paddingHorizontal: 14,
|
| 119 | width: 48,
|
| 120 | borderRadius: BorderRadius.md,
|
| 121 | },
|
| 122 | cardTitleHeadline: {
|
| 123 | ...Typography.headlineMd,
|
| 124 | lineHeight: 20,
|
| 125 | marginTop: 4,
|
| 126 | },
|
| 127 | cardTitle: {
|
| 128 | ...Typography.bodyLg,
|
| 129 | lineHeight: 20,
|
| 130 | marginTop: 4,
|
| 131 | },
|
| 132 | cardDescriptionHeadline: {
|
| 133 | ...Typography.bodyLg,
|
| 134 | color: Colors.light.textSecondary,
|
| 135 | marginTop: 4,
|
| 136 | },
|
| 137 | cardDescription: {
|
| 138 | ...Typography.labelSm,
|
| 139 | color: Colors.light.textSecondary,
|
| 140 | marginTop: 4,
|
| 141 | },
|
| 142 | disclaimerCard: {
|
| 143 | padding: Spacing.cardGap,
|
| 144 | marginTop: 20,
|
| 145 | },
|
| 146 | disclaimerTitleContainer: {
|
| 147 | flex: 1,
|
| 148 | flexDirection: "row",
|
| 149 | gap: 5,
|
| 150 | marginBottom: 10,
|
| 151 | },
|
| 152 | disclaimerTitleText: {
|
| 153 | fontWeight: 600,
|
| 154 | fontSize: 16,
|
| 155 | lineHeight: 20,
|
| 156 | },
|
| 157 | disclaimerText: {
|
| 158 | fontSize: 12,
|
| 159 | lineHeight: 18,
|
| 160 | color: Colors.light.textSecondary,
|
| 161 | },
|
| 162 | disclaimerHelp: {
|
| 163 | marginTop: 10,
|
| 164 | borderTopWidth: 1,
|
| 165 | borderTopColor: Colors.light.divider,
|
| 166 | paddingTop: 5,
|
| 167 | },
|
| 168 | disclaimerHelpText: {
|
| 169 | color: "#0f172a",
|
| 170 | fontWeight: 500,
|
| 171 | fontSize: 12,
|
| 172 | lineHeight: 16,
|
| 173 | alignItems: "center",
|
| 174 | },
|
| 175 | });
|