eletrotupi / tcc/ commit / 9e81281

frontend: drop the unused trigger pattern metadata and imports

Pedro Lucas Porcellis porcellis@eletrotupi.com · 12 days ago 9e81281bc996022abab0d2183e9466b5b3553b51 Browse files
Parents e8826b4
Changed files
5
Additions
+4
Deletions
-14
frontend/components/insights/TriggerPatternWidget.tsx
1 1
import React from "react";
2 2
import { View, StyleSheet, ActivityIndicator } from "react-native";
3 3
import { Text } from "@/components/ui/Text";
4 -
import { MaterialIcons } from "@expo/vector-icons";
5 4
import { Card } from "@/components/ui/Cards";
6 5
import { useInsight } from "@/hooks/useInsights.queries";
7 6
import { Colors, Spacing } from "@/constants/theme";
8 -
import { getTriggerCategory } from "@/constants/trigger-categories";
9 7
import { InsightCard } from "./InsightCard";
10 8

11 9
export const TriggerPatternWidget: React.FC = () => {
12 10
  const { data: insight, isLoading } = useInsight("TRIGGER_PATTERN");
13 11

43 41

44 42
  const pct =
45 43
    metadata.total > 0
46 44
      ? Math.round((metadata.topCount / metadata.total) * 100)
47 45
      : 0;
48 -

49 -
  const topMeta = getTriggerCategory(metadata.topCategory);
50 46

51 47
  return (
52 48
    <InsightCard
53 49
      category="Gatilhos"
54 50
      body={
88 84
  empty: {
89 85
    color: Colors.light.lightSlateGray,
90 86
    marginTop: 4,
91 87
  },
92 88
});
frontend/components/ui/Cards.tsx
1 1
import React from 'react';
2 2
import {
3 3
  View,
4 4
  StyleSheet,
5 5
  Pressable,
6 6
  ViewStyle,
7 +
  type StyleProp,
7 8
} from 'react-native';
8 9

9 -
import { Colors, Typography, Spacing, BorderRadius, Shadows } from '@/constants/theme';
10 +
import { Colors, Spacing, BorderRadius, Shadows } from '@/constants/theme';
10 11
import { useThemeColor } from '@/hooks/use-theme-color';
11 12
import { Text } from '@/components/ui/Text'
12 13
import { Ionicons } from '@expo/vector-icons';
13 14

14 15
interface CardProps {
15 16
  children: React.ReactNode;
16 17
  onPress?: () => void;
17 18
  variant?: 'default' | 'highlighted';
18 -
  style?: ViewStyle;
19 +
  style?: StyleProp<ViewStyle>;
19 20
  testID?: string;
20 21
}
21 22

22 23
export const Card: React.FC<CardProps> = ({
23 24
  children,
66 67
  );
67 68
};
68 69

69 70
interface SubtleInfoCardProps {
70 71
  text: string;
71 -
  style?: ViewStyle;
72 +
  style?: StyleProp<ViewStyle>;
72 73
};
73 74

74 75
export const SubtleInfoCard: React.FC<SubtleInfoCardProps> = ({
75 76
  text,
76 77
  style
103 104
        {text.replace(/\s+/g, ' ').trim()}
104 105
      </Text>
105 106
    </View>
106 107
  )
107 108
}
frontend/components/ui/FilterPills.tsx
1 1
import { useRef } from "react";
2 2
import {
3 3
  ScrollView,
4 4
  TouchableOpacity,
5 5
  View,
6 6
  StyleSheet,
7 -
  Platform,
8 7
} from "react-native";
9 8
import { Text } from "@/components/ui/Text";
10 -
import { LinearGradient } from "expo-linear-gradient";
11 9
import type { HistoryCategory } from "@/lib/history/types";
12 10
import { Colors } from "@/constants/theme";
13 11

14 12
export type FilterOption = {
15 13
  label: string;
109 107
    top: 0,
110 108
    bottom: 0,
111 109
    width: 48,
112 110
  },
113 111
});
frontend/components/ui/Input.tsx
1 1
import React, { useState } from 'react';
2 2
import {
3 3
  TextInput,
4 4
  TextInputProps,
5 5
  StyleSheet,
6 6
  View,
7 7
  TouchableOpacity,
8 -
  Platform,
9 8
} from 'react-native';
10 9
import { Text } from '@/components/ui/Text';
11 10
import { useThemeColor } from '@/hooks/use-theme-color';
12 11
import { Ionicons } from '@expo/vector-icons';
13 12

74 73
  style,
75 74
  ...props
76 75
}) => {
77 76
  const [showPassword, setShowPassword] = useState(false);
78 77
  const {
79 -
    textColor,
80 78
    placeholderColor,
81 79
    errorColor,
82 80
    inputStyle
83 81
  } = useInputStyles(variant, error, showPasswordToggle);
84 82

137 135
  maxRows,
138 136
  style,
139 137
  ...props
140 138
}) => {
141 139
  const {
142 -
    textColor,
143 140
    placeholderColor,
144 141
    errorColor,
145 142
    inputStyle
146 143
  } = useInputStyles(variant, error);
147 144

227 224
  errorText: {
228 225
    fontSize: 12,
229 226
    marginTop: 4,
230 227
  },
231 228
});
frontend/components/ui/MoodEntryLog.tsx
1 -
import { format, isToday, isYesterday } from 'date-fns';
2 -
import { ptBR } from 'date-fns/locale';
3 1
import { StyleSheet, View } from 'react-native';
4 2
import { Text } from '@/components/ui/Text';
5 3
import { router } from 'expo-router';
6 4

7 5
import { Card } from '@/components/ui/Cards';
83 81
    letterSpacing: 0.1,
84 82
  },
85 83
});
86 84

87 85
export default MoodEntryLog