eletrotupi / tcc/ commit / 92fe16c

frontend/notifications: drop the bell's badge dot

The dot was always on and counted nothing, so it read as an unread
marker that never cleared. The bell still opens the inbox; it just
carries no badge
Pedro Lucas Porcellis porcellis@eletrotupi.com · 11 days ago 92fe16c5883a76b1919f4c7dcb888c00e2912fc3 Browse files
Parents f8f41f3
Changed files
6
Additions
0
Deletions
-19
frontend/app/(tabs)/actions.tsx
1 1
import { View, StyleSheet } from "react-native";
2 2
import { Text } from "@/components/ui/Text";
3 3
import { ScreenLayout } from "@/components/ui/ScreenLayout";
4 4
import { useAuth } from "@/context/AuthContext";
5 5
import { Section, SectionHeader } from "@/components/ui/Sections";
29 29

30 30
  return (
31 31
    <ScreenLayout
32 32
      userName={user?.firstName}
33 33
      userAvatar={user?.avatarURL}
34 -
      showNotificationBadge={true}
35 34
    >
36 35
      <Section>
37 36
        <SectionHeader
38 37
          title="Ações de Cuidado"
39 38
          subtitle="Registre atividades, acompanhe medicamentos e mantenha sua rotina organizada"
172 171
    fontSize: 12,
173 172
    lineHeight: 16,
174 173
    alignItems: "center",
175 174
  },
176 175
});
frontend/app/(tabs)/history.tsx
1 1
import { useState } from "react";
2 2
import { ScrollView, View } from "react-native";
3 3
import { ScreenLayout } from "@/components/ui/ScreenLayout";
4 4
import { Section, SectionHeader } from "@/components/ui/Sections";
5 5
import { FilterPills } from "@/components/ui/FilterPills";
45 45

46 46
  return (
47 47
    <ScreenLayout
48 48
      userName={user?.firstName}
49 49
      userAvatar={user?.avatarURL}
50 -
      showNotificationBadge={true}
51 50
    >
52 51
      <ScrollView testID="history-list">
53 52
        <FilterPills active={activeFilter} onChange={setActiveFilter} />
54 53

55 54
        {Object.keys(grouped).length === 0 ? (
72 71
        )}
73 72
      </ScrollView>
74 73
    </ScreenLayout>
75 74
  );
76 75
}
frontend/app/(tabs)/insights.tsx
1 1
import { ScreenLayout } from "@/components/ui/ScreenLayout";
2 2
import { useAuth } from "@/context/AuthContext";
3 3
import { Section, SectionHeader } from "@/components/ui/Sections";
4 4
import { WeeklyResume } from "@/components/insights/WeeklyResume";
5 5
import { MoodTrendWidget } from "@/components/insights/MoodTrendWidget";
11 11

12 12
  return (
13 13
    <ScreenLayout
14 14
      userName={user?.firstName}
15 15
      userAvatar={user?.avatarURL}
16 -
      showNotificationBadge={true}
17 16
    >
18 17
      {user?.weeklyResumeEnabled && (
19 18
        <WeeklyResume
20 19
          avgMood="Neutro"
21 20
          stats={[
35 34
        <TriggerPatternWidget />
36 35
      </Section>
37 36
    </ScreenLayout>
38 37
  );
39 38
}
frontend/app/(tabs)/new/index.tsx
1 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 5
import { ScreenLayout } from "@/components/ui/ScreenLayout";
38 38

39 39
  return (
40 40
    <ScreenLayout
41 41
      userName={user?.firstName}
42 42
      userAvatar={user?.avatarURL}
43 -
      showNotificationBadge={true}
44 43
    >
45 44
      <Section>
46 45
        <SectionHeader
47 46
          title="Como você está hoje?"
48 47
          subtitle="Sua jornada começa agora"
157 156
    fontSize: 11,
158 157
    fontWeight: 600,
159 158
    lineHeight: 16.5,
160 159
  },
161 160
});
frontend/app/(tabs)/settings.tsx
1 1
import {
2 2
  TouchableOpacity,
3 3
  StyleSheet,
4 4
  View,
5 5
  Switch,
99 99

100 100
  return (
101 101
    <ScreenLayout
102 102
      userName={user?.firstName}
103 103
      userAvatar={user?.avatarURL}
104 -
      showNotificationBadge={true}
105 104
    >
106 105
      <Section>
107 106
        <SectionHeader title="Perfil" />
108 107

109 108
        <Card style={{ padding: Spacing.cardGap }} onPress={handleProfilePress}>
463 462
    height: StyleSheet.hairlineWidth,
464 463
    backgroundColor: "#D1D5DB",
465 464
    marginVertical: 16,
466 465
  },
467 466
});
frontend/components/ui/ScreenLayout.tsx
1 1
import {
2 2
  View,
3 3
  ScrollView,
4 4
  StyleSheet,
5 5
  Image,
17 17
interface ScreenLayoutProps {
18 18
  children: React.ReactNode;
19 19
  userName?: string;
20 20
  userAvatar?: string;
21 21
  onNotificationPress?: () => void;
22 -
  showNotificationBadge?: boolean;
23 22
  scrollEnabled?: boolean;
24 23
}
25 24

26 25
export const ScreenLayout: React.FC<ScreenLayoutProps> = ({
27 26
  children,
28 27
  userName = "Usuário",
29 28
  userAvatar,
30 29
  onNotificationPress,
31 -
  showNotificationBadge = false,
32 30
  scrollEnabled = true,
33 31
}) => {
34 32
  const router = useRouter();
35 33
  const textColor = useThemeColor({}, "text") as string;
36 34
  const backgroundColor = useThemeColor({}, "background") as string;
37 35
  const surfaceColor = useThemeColor({}, "surface") as string;
38 36
  const dividerColor = useThemeColor({}, "divider") as string;
39 37
  const accentBlue = useThemeColor({}, "accentBlue") as string;
40 -
  const tintColor = useThemeColor({}, "tint") as string;
41 38

42 39
  return (
43 40
    <View style={[styles.container, { backgroundColor }]}>
44 41
      <StatusBar barStyle="dark-content" />
45 42
      <SafeAreaView
62 59
            style={styles.notificationButton}
63 60
            onPress={onNotificationPress ?? (() => router.push("/notifications"))}
64 61
            hitSlop={8}
65 62
          >
66 63
            <IconSymbol size={24} name="notifications" color={textColor} />
67 -
            {showNotificationBadge && (
68 -
              <View style={[styles.notificationBadge, { backgroundColor: tintColor }]} />
69 -
            )}
70 64
          </Pressable>
71 65
        </View>
72 66

73 67
        <ScrollView
74 68
          scrollEnabled={scrollEnabled}
116 110
    width: 40,
117 111
    height: 40,
118 112
    borderRadius: BorderRadius.md,
119 113
    justifyContent: "center",
120 114
    alignItems: "center",
121 -
  },
122 -
  notificationBadge: {
123 -
    position: "absolute",
124 -
    top: 4,
125 -
    right: 4,
126 -
    width: 8,
127 -
    height: 8,
128 -
    borderRadius: 4,
129 115
  },
130 116
  scrollContent: {
131 117
    paddingHorizontal: Spacing.containerPadding,
132 118
    paddingVertical: Spacing.sectionGap,
133 119
  },
134 120
});
135 121

136 122
export default ScreenLayout;