eletrotupi / tcc/ commit / ea14755

frontend: drop unused imports and dead code in the screens

Pedro Lucas Porcellis porcellis@eletrotupi.com · 12 days ago ea1475564abe0f26ea6bb9c6c840b714261aad91 Browse files
Parents 16a7e33
Changed files
11
Additions
+12
Deletions
-125
frontend/app/(tabs)/actions.tsx
1 1
import { View, StyleSheet } from "react-native";
2 2
import { Text } from "@/components/ui/Text";
3 -
import { ThemedView } from "@/components/misc/themed-view";
4 3
import { ScreenLayout } from "@/components/ui/ScreenLayout";
5 4
import { useAuth } from "@/context/AuthContext";
6 5
import { Section, SectionHeader } from "@/components/ui/Sections";
7 -
import { Card, SubtleInfoCard } from "@/components/ui/Cards";
8 -
import { Grid, Col, Row, Between } from "@/components/ui/LayoutHelpers";
6 +
import { Card } from "@/components/ui/Cards";
7 +
import { Grid } from "@/components/ui/LayoutHelpers";
9 8
import { Button } from "@/components/ui/Button";
10 9
import {
11 10
  Shadows,
12 11
  Colors,
13 12
  Typography,
172 171
    fontSize: 12,
173 172
    lineHeight: 16,
174 173
    alignItems: "center",
175 174
  },
176 175
});
frontend/app/(tabs)/insights.tsx
1 -
import { View, ScrollView, StyleSheet } from "react-native";
2 -

3 -
import { ThemedView } from "@/components/misc/themed-view";
4 1
import { ScreenLayout } from "@/components/ui/ScreenLayout";
5 2
import { useAuth } from "@/context/AuthContext";
6 -
import { Card } from "@/components/ui/Cards";
7 3
import { Section, SectionHeader } from "@/components/ui/Sections";
8 -
import { useThemeColor } from "@/hooks/use-theme-color";
9 -
import { Spacing, BorderRadius, Colors, Typography } from "@/constants/theme";
10 4
import { WeeklyResume } from "@/components/insights/WeeklyResume";
11 -
import { InsightCard, Highlight } from "@/components/insights/InsightCard";
12 5
import { MoodTrendWidget } from "@/components/insights/MoodTrendWidget";
13 6
import { EnergySleepWidget } from "@/components/insights/EnergySleepWidget";
14 7
import { TriggerPatternWidget } from "@/components/insights/TriggerPatternWidget";
15 8

16 9
export default function Insights() {
40 33
        <TriggerPatternWidget />
41 34
      </Section>
42 35
    </ScreenLayout>
43 36
  );
44 37
}
45 -

46 -
const styles = StyleSheet.create({
47 -
  scrollView: {
48 -
    flex: 1,
49 -
    backgroundColor: Colors.light.background,
50 -
  },
51 -
  contentContainer: {
52 -
    padding: Spacing.containerPadding,
53 -
    paddingBottom: 40,
54 -
  },
55 -

56 -
  // Hero card
57 -
  heroCard: {
58 -
    backgroundColor: Colors.light.textBlack,
59 -
    borderRadius: BorderRadius.lg,
60 -
    padding: 20,
61 -
    marginBottom: Spacing.sectionGap,
62 -
  },
63 -
  heroLabel: {
64 -
    fontSize: 11,
65 -
    fontWeight: "600",
66 -
    letterSpacing: 0.8,
67 -
    textTransform: "uppercase",
68 -
    color: Colors.light.tint,
69 -
    marginBottom: 8,
70 -
  },
71 -
  heroScoreRow: {
72 -
    flexDirection: "row",
73 -
    alignItems: "center",
74 -
    gap: 10,
75 -
  },
76 -
  heroScore: {
77 -
    ...Typography.headlineXg,
78 -
    fontSize: 52,
79 -
    color: "#ffffff",
80 -
  },
81 -
  heroTrendIcon: {
82 -
    marginTop: 6,
83 -
  },
84 -
  heroDivider: {
85 -
    height: StyleSheet.hairlineWidth,
86 -
    backgroundColor: "rgba(255,255,255,0.12)",
87 -
    marginVertical: 16,
88 -
  },
89 -
  heroStats: {
90 -
    flexDirection: "row",
91 -
    gap: Spacing.sectionGap,
92 -
  },
93 -
  heroStatItem: {
94 -
    flex: 1,
95 -
  },
96 -
  heroStatLabel: {
97 -
    fontSize: 12,
98 -
    color: "rgba(255,255,255,0.45)",
99 -
    fontWeight: "500",
100 -
    marginBottom: 4,
101 -
  },
102 -
  heroStatValue: {
103 -
    ...Typography.bodyLg,
104 -
    fontSize: 20,
105 -
    color: "#ffffff",
106 -
  },
107 -

108 -
  // Insight cards
109 -
  insightCardInner: {
110 -
    flexDirection: "row",
111 -
    alignItems: "center",
112 -
    justifyContent: "space-between",
113 -
    gap: 12,
114 -
  },
115 -
  insightCardLeft: {
116 -
    flex: 1,
117 -
    gap: 6,
118 -
  },
119 -
  insightCategory: {
120 -
    fontSize: 11,
121 -
    fontWeight: "600",
122 -
    letterSpacing: 0.8,
123 -
    textTransform: "uppercase",
124 -
    color: Colors.light.textSecondary,
125 -
  },
126 -
  insightBody: {
127 -
    ...Typography.bodyMd,
128 -
    color: Colors.light.text,
129 -
  },
130 -
  insightMetric: {
131 -
    ...Typography.headlineLg,
132 -
    fontSize: 22,
133 -
  },
134 -
});
frontend/app/(tabs)/new/index.tsx
1 -
import { useEffect, useState } from "react";
1 +
import { useState } from "react";
2 2
import { StyleSheet, View, ActivityIndicator } from "react-native";
3 3

4 4
import { Text } from "@/components/ui/Text";
5 -
import { ThemedView } from "@/components/misc/themed-view";
6 5
import { ScreenLayout } from "@/components/ui/ScreenLayout";
7 6
import { useAuth } from "@/context/AuthContext";
8 -
import { Grid, Col, Row, Between } from "@/components/ui/LayoutHelpers";
7 +
import { Col, Between } from "@/components/ui/LayoutHelpers";
9 8
import { Card } from "@/components/ui/Cards";
10 -
import { Badge } from "@/components/ui/Badge";
11 9
import { Button } from "@/components/ui/Button";
12 10
import { Section, SectionHeader } from "@/components/ui/Sections";
13 11
import { MoodSelector } from "@/components/ui/EmojiSelectors";
14 12
import {
15 13
  Typography,
16 -
  Spacing,
17 14
  Shadows,
18 15
  Colors,
19 16
  BorderRadius,
20 17
} from "@/constants/theme";
21 -
import { Ionicons } from "@expo/vector-icons";
22 18
import { router } from "expo-router";
23 -
import { MoodDefinition, MOODS } from "@/constants/moods";
19 +
import { MOODS } from "@/constants/moods";
24 20

25 -
import { useThemeColor, useMoodEntries } from "@/hooks";
21 +
import { useMoodEntries } from "@/hooks";
26 22

27 23
import MoodEntryLog from "@/components/ui/MoodEntryLog";
28 24
import { DailyEnergyWidget } from "@/components/ui/DailyEnergyWidget";
29 25
import { DailySleepWidget } from "@/components/ui/DailySleepWidget";
30 26
import { EmptyState } from "@/components/ui/EmptyState";
161 157
    fontSize: 11,
162 158
    fontWeight: 600,
163 159
    lineHeight: 16.5,
164 160
  },
165 161
});
frontend/app/(tabs)/new/post-mood.tsx
1 1
import { useState } from "react";
2 2
import {
3 3
  View,
4 4
  StyleSheet,
5 5
  TouchableOpacity,
6 6
  Pressable,
7 7
  ActivityIndicator,
8 8
} from "react-native";
9 9
import { Text } from '@/components/ui/Text';
10 -
import { router, useLocalSearchParams, Link } from "expo-router";
10 +
import { router, useLocalSearchParams } from "expo-router";
11 11
import { Ionicons, MaterialIcons } from "@expo/vector-icons";
12 12

13 13
import { ScreenLayout } from "@/components/ui/ScreenLayout";
14 14
import { Card } from "@/components/ui/Cards";
15 -
import { Section } from '@/components/ui/Sections';
16 15
import { Button } from "@/components/ui/Button";
17 16
import { useAuth } from "@/context/AuthContext";
18 17
import { Colors, Spacing, Typography, BorderRadius, Shadows } from "@/constants/theme";
19 18
import { getTriggerCategory } from "@/constants/trigger-categories";
20 19
import { useTriggers, useLinkMoodToTrigger } from "@/hooks";
370 369
  },
371 370
  concludeButton: {
372 371
    marginTop: 8,
373 372
  },
374 373
});
frontend/app/(tabs)/settings.tsx
1 1
import {
2 2
  TouchableOpacity,
3 3
  StyleSheet,
4 -
  SectionList,
5 4
  View,
6 5
  Switch,
7 -
  Pressable,
8 6
} from "react-native";
9 7
import { Text } from '@/components/ui/Text';
10 8
import { useState } from "react";
11 9
import { router } from "expo-router";
12 10
import { Card } from "@/components/ui/Cards";
13 -
import ScreenLayout from "@/components/ui/ScreenLayout";
11 +
import { ScreenLayout } from "@/components/ui/ScreenLayout";
14 12
import { BorderRadius, Colors, Spacing, Typography } from "@/constants/theme";
15 13
import { useThemeColor } from "@/hooks/use-theme-color";
16 14
import { useAuth } from "@/context/AuthContext";
17 15
import { Section, SectionHeader } from "@/components/ui/Sections";
18 16
import { Ionicons, MaterialIcons } from "@expo/vector-icons";
371 369
    height: StyleSheet.hairlineWidth,
372 370
    backgroundColor: "#D1D5DB",
373 371
    marginVertical: 16,
374 372
  },
375 373
});
frontend/app/care-actions/medicine-new.tsx
1 1
import {
2 2
  View,
3 3
  StyleSheet,
4 4
  KeyboardAvoidingView,
5 5
  ScrollView,
11 11

12 12
import { Card } from "@/components/ui/Cards";
13 13
import { Input } from "@/components/ui/Input";
14 14
import { Button } from "@/components/ui/Button";
15 15
import { Section, SectionHeader } from "@/components/ui/Sections";
16 -
import { Spacing, Typography, Colors, BorderRadius, Shadows } from "@/constants/theme";
16 +
import { Spacing, Typography, Colors, BorderRadius } from "@/constants/theme";
17 17
import { TimePicker } from "@/components/ui/TimePicker";
18 18
import { useCreateMedicineRegimen } from "@/hooks";
19 19
import { MedicinePeriodicity } from "@/lib/api";
20 20

21 21
const PERIODICITY_OPTIONS: { label: string; value: MedicinePeriodicity }[] = [
199 199
  periodicityChipLabelActive: {
200 200
    fontWeight: '600',
201 201
    color: Colors.light.text,
202 202
  },
203 203
});
frontend/app/entry/mood-components.tsx
1 1
import React from "react";
2 2
import { View, ScrollView, Pressable, StyleSheet } from "react-native";
3 3
import { Text } from "@/components/ui/Text";
4 4
import { router } from "expo-router";
5 5
import { Ionicons } from "@expo/vector-icons";
11 11
import { Card } from "@/components/ui/Cards";
12 12
import { Theme } from "@/constants/theme";
13 13
import {
14 14
  MOOD_COMPONENTS,
15 15
  getMoodComponent,
16 -
  intensityLabel,
17 16
} from "@/constants/mood-components";
18 17

19 18
import { useMoodEntryStore } from "@/stores/moodEntry";
20 19

21 20
export default function MoodComponentsScreen() {
242 241
    fontSize: Theme.typography.bodyMd.fontSize,
243 242
    fontWeight: "500",
244 243
    color: Theme.colors.light.text,
245 244
  },
246 245
});
frontend/app/entry/post-mood-links.tsx
1 1
import { View, TouchableOpacity, ScrollView, StyleSheet, ActivityIndicator } from 'react-native';
2 2
import { Text } from '@/components/ui/Text';
3 3
import { useState } from 'react';
4 4
import { router, useLocalSearchParams } from 'expo-router';
5 5
import { Ionicons, MaterialIcons } from '@expo/vector-icons';
6 6
import { Button } from '@/components/ui/Button';
7 -
import { Section, SectionHeader } from '@/components/ui/Sections';
8 7
import { Spacing, Typography, Colors, BorderRadius } from '@/constants/theme';
9 8
import { useTriggers, useLinkMoodToTrigger } from '@/hooks';
10 9
import { getTriggerCategory } from '@/constants/trigger-categories';
11 10
import { Trigger } from '@/lib/api';
12 11

195 194
    backgroundColor: Colors.light.tint + '1A',
196 195
  },
197 196
  impactLabel: { fontSize: 18, fontWeight: '600', color: Colors.light.textSecondary },
198 197
  impactLabelActive: { color: Colors.light.text },
199 198
});
frontend/app/notifications.tsx
1 1
import {
2 -
  View,
3 2
  StyleSheet,
4 3
  ScrollView,
5 4
  KeyboardAvoidingView,
6 -
  Platform,
7 -
  Alert,
8 5
} from "react-native";
9 6
import { Text } from "@/components/ui/Text";
10 7

11 8
import { useState, useEffect } from "react";
12 9
import * as Notifications from "expo-notifications";
13 10
import { useAuth } from "@/context/AuthContext";
14 11
import { useLocalSearchParams } from "expo-router";
15 12
import { StatusBar } from "expo-status-bar";
16 13
import { SafeAreaView } from "react-native-safe-area-context";
17 -
import { useThemeColor } from "@/hooks/use-theme-color";
18 14
import { Button } from "@/components/ui/Button";
19 15
import { Colors, Spacing } from "@/constants/theme";
20 16
import { Card } from "@/components/ui/Cards";
21 17
import { Section, SectionHeader } from "@/components/ui/Sections";
22 18

118 114
  header: {
119 115
    alignItems: "flex-start",
120 116
    marginBottom: 40,
121 117
  },
122 118
});
frontend/app/profile.tsx
1 -
import { useState, useEffect } from 'react';
1 +
import { useState } from 'react';
2 2
import {
3 3
  View,
4 4
  StyleSheet,
5 5
  ScrollView,
6 6
  KeyboardAvoidingView,
7 7
} from 'react-native';
8 8

9 9
import { Text } from '@/components/ui/Text';
10 -
import { ThemedView } from '@/components/ui/themed-view'
11 -
import { Link, useLocalSearchParams, router } from 'expo-router';
10 +
import { router } from 'expo-router';
12 11
import { StatusBar } from 'expo-status-bar';
13 12
import { SafeAreaView } from 'react-native-safe-area-context';
14 13
import { useThemeColor } from '@/hooks/use-theme-color';
15 14
import { Button, Input } from '@/components/ui';
16 15
import { useAuth } from '@/context/AuthContext';
249 248
  cardBlockHint: {
250 249
    ...Typography.cardHint,
251 250
    color: Colors.light.textSecondary
252 251
  }
253 252
});
frontend/app/sleep/index.tsx
1 1
import {
2 2
  View,
3 3
  StyleSheet,
4 4
  ScrollView
5 5
} from 'react-native';
6 6

7 -
import { Card } from '@/components/ui/Cards';
8 -
import { Spacing, Typography, Colors } from '@/constants/theme';
7 +
import { Spacing } from '@/constants/theme';
9 8

10 9
export default function SleepHub() {
11 10

12 11
  return (
13 12
    <View>
25 24
    gap: 24,
26 25
    paddingHorizontal: Spacing.containerPadding,
27 26
    paddingVertical: Spacing.sectionGap,
28 27
  }
29 28
})