eletrotupi / tcc/ commit / f60b377

frontend/settings: lint and make settings fonts more coherent

Pedro Lucas Porcellis porcellis@eletrotupi.com · 20 days ago f60b3774625eda020e210c7afb6523aff963d385 Browse files
Parents 1f2f0a1
Changed files
1
Additions
+17
Deletions
-45
frontend/app/(tabs)/settings.tsx
1 1
import {
2 2
  TouchableOpacity,
3 3
  StyleSheet,
4 4
  SectionList,
5 5
  View,
9 9
import { Text } from '@/components/ui/Text';
10 10
import { useState } from "react";
11 11
import { router } from "expo-router";
12 12
import { Card } from "@/components/ui/Cards";
13 13
import ScreenLayout from "@/components/ui/ScreenLayout";
14 -
import { BorderRadius, Colors, Fonts, Spacing } from "@/constants/theme";
14 +
import { BorderRadius, Colors, Spacing, Typography } from "@/constants/theme";
15 15
import { useThemeColor } from "@/hooks/use-theme-color";
16 16
import { useAuth } from "@/context/AuthContext";
17 17
import { Section, SectionHeader } from "@/components/ui/Sections";
18 18
import { Ionicons, MaterialIcons } from "@expo/vector-icons";
19 19
import { Button } from "@/components/ui/Button";
105 105
                flexDirection: "column",
106 106
                alignItems: "center",
107 107
                justifyContent: "space-between",
108 108
              }}
109 109
            >
110 -
              <Text style={styles.cardTitle}>Dados Pessoais</Text>
111 -
              <Text style={styles.cardSubtitle}>Nome, Email e senha</Text>
110 +
              <Text style={styles.rowLabel}>Dados Pessoais</Text>
111 +
              <Text style={styles.rowSubtitle}>Nome, Email e senha</Text>
112 112
            </View>
113 113

114 114
            <Ionicons name="chevron-forward" size={24} color={textColor} />
115 115
          </View>
116 116
        </Card>
147 147
                justifyContent: "space-between",
148 148
                marginLeft: 12,
149 149
                flex: 1,
150 150
              }}
151 151
            >
152 -
              <Text style={styles.cardTitle}>Lembrete diário de humor</Text>
153 -
              <Text>{notificationsEnabled ? `Diário às ${dailyReminderTime}` : "Desativado"}</Text>
152 +
              <Text style={styles.rowLabel}>Lembrete diário de humor</Text>
153 +
              <Text style={styles.rowSubtitle}>
154 +
                {notificationsEnabled ? `Diário às ${dailyReminderTime}` : "Desativado"}
155 +
              </Text>
154 156
            </View>
155 157

156 158
            <Switch
157 159
              onValueChange={handleNotificationToggle}
158 160
              thumbColor={Colors.light.tint}
202 204
                justifyContent: "space-between",
203 205
                marginLeft: 12,
204 206
                flex: 1,
205 207
              }}
206 208
            >
207 -
              <Text style={styles.cardTitle}>Indicadores semanais</Text>
208 -
              <Text>Relatórios de progressos</Text>
209 +
              <Text style={styles.rowLabel}>Indicadores semanais</Text>
210 +
              <Text style={styles.rowSubtitle}>Relatórios de progressos</Text>
209 211
            </View>
210 212

211 213
            <Switch
212 214
              onValueChange={setAllowWeeklyInsights}
213 215
              value={allowWeeklyInsights}
238 240
              <MaterialIcons
239 241
                name="picture-as-pdf"
240 242
                size={24}
241 243
                color={Colors.light.textSecondary}
242 244
              />
243 -
              <Text style={{ marginLeft: 8, ...styles.cardTitle }}>
245 +
              <Text style={[styles.rowLabel, { marginLeft: 8 }]}>
244 246
                Gerar Relatório
245 247
              </Text>
246 248
            </View>
247 249
            <Ionicons name="chevron-forward" size={24} color={textColor} />
248 250
          </View>
266 268
                name="lock"
267 269
                size={24}
268 270
                color={Colors.light.textSecondary}
269 271
              />
270 272

271 -
              <Text
272 -
                style={{
273 -
                  marginLeft: 8,
274 -
                  color: Colors.light.text,
275 -
                  fontSize: 14,
276 -
                  fontWeight: "500" as const,
277 -
                }}
278 -
              >
273 +
              <Text style={[styles.rowLabel, { marginLeft: 8 }]}>
279 274
                Privacidade
280 275
              </Text>
281 276
            </View>
282 277

283 278
            <Ionicons name="chevron-forward" size={24} color={textColor} />
298 293
                name="storage"
299 294
                size={24}
300 295
                color={Colors.light.textSecondary}
301 296
              />
302 297

303 -
              <Text
304 -
                style={{
305 -
                  marginLeft: 8,
306 -
                  color: Colors.light.text,
307 -
                  fontSize: 14,
308 -
                  fontWeight: "500" as const,
309 -
                }}
310 -
              >
298 +
              <Text style={[styles.rowLabel, { marginLeft: 8 }]}>
311 299
                Exportar Meus Dados
312 300
              </Text>
313 301
            </View>
314 302

315 303
            <MaterialIcons
363 351
    </ScreenLayout>
364 352
  );
365 353
}
366 354

367 355
const styles = StyleSheet.create({
368 -
  container: {
369 -
    flex: 1,
370 -
    marginHorizontal: 16,
371 -
    paddingTop: 10,
372 -
  },
373 -
  item: {
374 -
    paddingTop: 20,
375 -
    paddingBottom: 20,
376 -
  },
377 -
  header: {
378 -
    fontSize: 22,
379 -
    fontWeight: "bold",
380 -
  },
381 356
  cardIcon: {
382 357
    paddingVertical: 15,
383 358
    paddingHorizontal: 14,
384 359
    width: 48,
385 360
    borderRadius: BorderRadius.md,
386 361
  },
387 -
  cardTitle: {
388 -
    fontSize: 16,
389 -
    fontWeight: "bold",
362 +
  rowLabel: {
363 +
    ...Typography.bodyLg,
364 +
    color: Colors.light.text,
390 365
  },
391 -
  cardSubtitle: {
392 -
    fontSize: 12,
366 +
  rowSubtitle: {
367 +
    ...Typography.bodyMd,
393 368
    color: Colors.light.textSecondary,
394 -
  },
395 -
  logout: {
396 -
    color: "#FF2C2C",
397 369
  },
398 370
  divider: {
399 371
    height: StyleSheet.hairlineWidth,
400 372
    backgroundColor: "#D1D5DB",
401 373
    marginVertical: 16,
402 374
  },
403 375
});