eletrotupi / tcc/ commit / da58efb

frontend: rig new triggers screen

Pedro Lucas Porcellis porcellis@eletrotupi.com · 4 months ago da58efba46e647a5b167032232fc6bd69007195d Browse files
Parents 88aa4c0
Changed files
2
Additions
+12
Deletions
-1
frontend/app/(tabs)/actions.tsx
1 1
import { View, Text, StyleSheet } from 'react-native';
2 2
import { ThemedText } from '@/components/misc/themed-text';
3 3
import { ThemedView } from '@/components/misc/themed-view';
4 4
import { ScreenLayout } from '@/components/ui/ScreenLayout';
5 5
import { useAuth } from '@/context/AuthContext';
16 16

17 17
  const onPressSleep = () => {
18 18
    router.push('/sleep/new')
19 19
  }
20 20

21 +
  const onPressTrigger = () => {
22 +
    router.push('/triggers/new')
23 +
  }
24 +

21 25
  return (
22 26
    <ScreenLayout userName={user.firstName} userAvatar={user.avatarURL}
23 27
      onNotificationPress={() => console.log('Notifications')}
24 28
      showNotificationBadge={true}>
25 29
      <Section>
61 65
          <Text style={styles.cardDescription}>
62 66
            Informe duração e qualidade do sono.
63 67
          </Text>
64 68
        </Card>
65 69

66 -
        <Card style={{ padding: Spacing.cardGap }}>
70 +
        <Card style={{ padding: Spacing.cardGap }} onPress={onPressTrigger}>
67 71
          <View style={[styles.cardIcon, { backgroundColor: '#FFF7ED' }]}>
68 72
            <Ionicons name="flash-outline" size={20} color="#EA580C" />
69 73
          </View>
70 74

71 75
          <Text style={styles.cardTitle}>
161 165
    fontSize: 12,
162 166
    lineHeight: 16,
163 167
    alignItems: 'center'
164 168
  }
165 169
})
frontend/app/_layout.tsx
1 1
import { DarkTheme, DefaultTheme, ThemeProvider } from '@react-navigation/native'
2 2
import { Stack } from 'expo-router';
3 3
import { useColorScheme } from 'react-native';
4 4
import { QueryClientProvider } from '@tanstack/react-query';
5 5
import { queryClient } from '@/lib/queryClient';
50 50
              options={{
51 51
                title: "Registrar Sono"
52 52
              }}
53 53
            />
54 54

55 +
            <Stack.Screen
56 +
              name="triggers/new"
57 +
              options={{
58 +
                title: "Registrar Gatilho"
59 +
              }}
60 +
            />
61 +

55 62
            <Stack.Screen name="modal" options={{ presentation: 'modal', title: 'Modal' }} />
56 63
          </Stack>
57 64
        </AuthProvider>
58 65
      </ThemeProvider>
59 66
    </QueryClientProvider>
60 67
  );
61 68
}