frontend: apply screen layout on tabs pages and redirect to insights after saving

Pedro Lucas Porcellis porcellis@eletrotupi.com 1 month ago aba81d95d4708f53c546b720093b00fe1ec2e6c0
Parents: 1180f89
5 file(s) changed
  • frontend/app/(tabs)/actions/index.tsx +13 -5
  • frontend/app/(tabs)/history/index.tsx +13 -5
  • frontend/app/(tabs)/insights/index.tsx +13 -5
  • frontend/app/(tabs)/new/index.tsx +13 -5
  • frontend/app/profile.tsx +1 -1
frontend/app/(tabs)/actions/index.tsx
@@ -1,12 +1,20 @@
1 1 import { ThemedText } from '@/components/misc/themed-text';
2 2 import { ThemedView } from '@/components/misc/themed-view';
3 + import { ScreenLayout } from '@/components/ui/ScreenLayout';
4 + import { useAuth } from '@/context/AuthContext';
3 5
4 6 export default function Actions() {
7 + const { user } = useAuth();
8 +
5 9 return (
6 - <ThemedView>
7 - <ThemedText>
8 - Actions
9 - </ThemedText>
10 - </ThemedView>
10 + <ScreenLayout userName={user.firstName}
11 + onNotificationPress={() => console.log('Notifications')}
12 + showNotificationBadge={true}>
13 + <ThemedView>
14 + <ThemedText>
15 + Novo
16 + </ThemedText>
17 + </ThemedView>
18 + </ScreenLayout>
11 19 )
12 20 }
frontend/app/(tabs)/history/index.tsx
@@ -1,12 +1,20 @@
1 1 import { ThemedText } from '@/components/misc/themed-text';
2 2 import { ThemedView } from '@/components/misc/themed-view';
3 + import { ScreenLayout } from '@/components/ui/ScreenLayout';
4 + import { useAuth } from '@/context/AuthContext';
3 5
4 6 export default function History() {
7 + const { user } = useAuth();
8 +
5 9 return (
6 - <ThemedView>
7 - <ThemedText>
8 - History
9 - </ThemedText>
10 - </ThemedView>
10 + <ScreenLayout userName={user.firstName}
11 + onNotificationPress={() => console.log('Notifications')}
12 + showNotificationBadge={true}>
13 + <ThemedView>
14 + <ThemedText>
15 + History
16 + </ThemedText>
17 + </ThemedView>
18 + </ScreenLayout>
11 19 )
12 20 }
frontend/app/(tabs)/insights/index.tsx
@@ -1,12 +1,20 @@
1 1 import { ThemedText } from '@/components/misc/themed-text';
2 2 import { ThemedView } from '@/components/misc/themed-view';
3 + import { ScreenLayout } from '@/components/ui/ScreenLayout';
4 + import { useAuth } from '@/context/AuthContext';
3 5
4 6 export default function Insights() {
7 + const { user } = useAuth();
8 +
5 9 return (
6 - <ThemedView>
7 - <ThemedText>
8 - Insights
9 - </ThemedText>
10 - </ThemedView>
10 + <ScreenLayout userName={user.firstName}
11 + onNotificationPress={() => console.log('Notifications')}
12 + showNotificationBadge={true}>
13 + <ThemedView>
14 + <ThemedText>
15 + Insights
16 + </ThemedText>
17 + </ThemedView>
18 + </ScreenLayout>
11 19 )
12 20 }
frontend/app/(tabs)/new/index.tsx
@@ -1,12 +1,20 @@
1 1 import { ThemedText } from '@/components/misc/themed-text';
2 2 import { ThemedView } from '@/components/misc/themed-view';
3 + import { ScreenLayout } from '@/components/ui/ScreenLayout';
4 + import { useAuth } from '@/context/AuthContext';
3 5
4 6 export default function New() {
7 + const { user } = useAuth();
8 +
5 9 return (
6 - <ThemedView>
7 - <ThemedText>
8 - New
9 - </ThemedText>
10 - </ThemedView>
10 + <ScreenLayout userName={user.firstName}
11 + onNotificationPress={() => console.log('Notifications')}
12 + showNotificationBadge={true}>
13 + <ThemedView>
14 + <ThemedText>
15 + Novo
16 + </ThemedText>
17 + </ThemedView>
18 + </ScreenLayout>
11 19 )
12 20 }
frontend/app/profile.tsx
@@ -99,7 +99,7 @@ });
99 99
100 100 updateAuthUser(response.user);
101 101
102 - router.replace('/(tabs)');
102 + router.replace('/(tabs)/insights');
103 103 } catch (error: any) {
104 104 console.error("[PROFILE]", error)
105 105 Alert.alert('Erro: ', 'Falha ao tentar atualizar o usuário');