eletrotupi / tcc/ frontend/app/care-actions/post-appointment.tsx252758fae561de1d43e23deea4bfe302e84f2e78
5.2 KB | 188 lines Raw
1
import { View, Text, StyleSheet, TouchableOpacity, ScrollView } from "react-native";
2
import { router } from "expo-router";
3
import { Ionicons } from "@expo/vector-icons";
4
import { SafeAreaView } from "react-native-safe-area-context";
5

6
import { Button } from "@/components/ui/Button";
7
import { Card } from "@/components/ui/Cards";
8
import { Colors, Spacing, Typography, BorderRadius, Shadows } from "@/constants/theme";
9
import { useCareActionLinkStore } from "@/stores";
10

11
export default function PostAppointment() {
12
  return (
13
    <SafeAreaView style={styles.safe}>
14
      <ScrollView
15
        contentContainerStyle={styles.scrollContent}
16
        scrollEventThrottle={16}
17
        showsVerticalScrollIndicator={false}
18
      >
19
        {/* Confirmation block */}
20
        <View style={styles.confirmationBlock}>
21
          <View style={styles.outerRing}>
22
            <View style={styles.innerCircle}>
23
              <Ionicons name="checkmark" size={32} color="#fff" />
24
            </View>
25
          </View>
26
          <Text style={styles.confirmTitle}>Consulta Salva!</Text>
27
          <Text style={styles.confirmSubtitle}>
28
            Sua consulta foi registrada com sucesso.
29
          </Text>
30
        </View>
31

32
        {/* Follow-up card */}
33
        <Card style={styles.followUpCard}>
34
          <Text style={styles.followUpTitle}>Algo surgiu na sessão?</Text>
35
          <Text style={styles.followUpSubtitle}>
36
            Aproveite para registrar enquanto está fresco
37
          </Text>
38

39
          <TouchableOpacity
40
            style={styles.optionRow}
41
            activeOpacity={0.7}
42
            onPress={() => router.replace("/triggers/new?category=THERAPY")}
43
          >
44
            <View style={[styles.optionIcon, { backgroundColor: "#ede9fe" }]}>
45
              <Ionicons name="flash-outline" size={22} color="#7c3aed" />
46
            </View>
47
            <View style={styles.optionText}>
48
              <Text style={styles.optionTitle}>Criar um gatilho</Text>
49
              <Text style={styles.optionDesc}>
50
                Registre algo que emergiu na sessão
51
              </Text>
52
            </View>
53
            <Ionicons
54
              name="chevron-forward"
55
              size={18}
56
              color={Colors.light.disabled}
57
            />
58
          </TouchableOpacity>
59

60
          <TouchableOpacity
61
            style={styles.optionRow}
62
            activeOpacity={0.7}
63
            onPress={() => router.replace("/new/entry?initialMood=neutral")}
64
          >
65
            <View style={[styles.optionIcon, { backgroundColor: "#fef9c3" }]}>
66
              <Ionicons name="heart-outline" size={22} color="#ca8a04" />
67
            </View>
68
            <View style={styles.optionText}>
69
              <Text style={styles.optionTitle}>Registrar humor</Text>
70
              <Text style={styles.optionDesc}>
71
                Como você está se sentindo agora?
72
              </Text>
73
            </View>
74
            <Ionicons
75
              name="chevron-forward"
76
              size={18}
77
              color={Colors.light.disabled}
78
            />
79
          </TouchableOpacity>
80
        </Card>
81

82
        <Button
83
          title="Concluir"
84
          variant="ghost"
85
          onPress={() => {
86
            useCareActionLinkStore.getState().clear();
87
            router.replace("/(tabs)/actions");
88
          }}
89
          style={styles.concludeButton}
90
        />
91
      </ScrollView>
92
    </SafeAreaView>
93
  );
94
}
95

96
const styles = StyleSheet.create({
97
  safe: {
98
    flex: 1,
99
    backgroundColor: Colors.light.background,
100
  },
101
  scrollContent: {
102
    paddingHorizontal: Spacing.containerPadding,
103
    paddingTop: 48,
104
    paddingBottom: 36,
105
  },
106
  confirmationBlock: {
107
    alignItems: "center",
108
    marginBottom: Spacing.sectionGap,
109
    gap: 12,
110
  },
111
  outerRing: {
112
    width: 88,
113
    height: 88,
114
    borderRadius: 44,
115
    backgroundColor: "#E7FDEF",
116
    alignItems: "center",
117
    justifyContent: "center",
118
  },
119
  innerCircle: {
120
    width: 64,
121
    height: 64,
122
    borderRadius: 32,
123
    backgroundColor: Colors.light.tint,
124
    alignItems: "center",
125
    justifyContent: "center",
126
  },
127
  confirmTitle: {
128
    ...Typography.headlineMd,
129
    fontWeight: "700",
130
    color: Colors.light.text,
131
    textAlign: "center",
132
  },
133
  confirmSubtitle: {
134
    ...Typography.bodyMd,
135
    color: Colors.light.textSecondary,
136
    textAlign: "center",
137
  },
138
  followUpCard: {
139
    padding: Spacing.cardGap,
140
    marginBottom: Spacing.sectionGap,
141
    gap: 12,
142
  },
143
  followUpTitle: {
144
    ...Typography.headlineMd,
145
    fontWeight: "700",
146
    color: Colors.light.text,
147
    marginBottom: 2,
148
  },
149
  followUpSubtitle: {
150
    ...Typography.bodyMd,
151
    color: Colors.light.textSecondary,
152
    marginBottom: 8,
153
  },
154
  optionRow: {
155
    flexDirection: "row",
156
    alignItems: "center",
157
    padding: Spacing.cardGap,
158
    backgroundColor: "#fff",
159
    borderRadius: BorderRadius.lg,
160
    borderWidth: 1,
161
    borderColor: Colors.light.divider,
162
    gap: 12,
163
    ...Shadows.sm,
164
  },
165
  optionIcon: {
166
    width: 44,
167
    height: 44,
168
    borderRadius: BorderRadius.md,
169
    alignItems: "center",
170
    justifyContent: "center",
171
  },
172
  optionText: {
173
    flex: 1,
174
    gap: 2,
175
  },
176
  optionTitle: {
177
    ...Typography.bodyMd,
178
    fontWeight: "600",
179
    color: Colors.light.text,
180
  },
181
  optionDesc: {
182
    ...Typography.labelSm,
183
    color: Colors.light.textSecondary,
184
  },
185
  concludeButton: {
186
    marginTop: 8,
187
  },
188
});