frontend: connect new sleep record screen
Pedro Lucas Porcellis porcellis@eletrotupi.com · 5 months ago
74927a490af73db488a3e18ed0526dd993d57f6f Browse filesParents
422fb6fChanged files
1
Additions
+7
Deletions
-2
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';
7 7
import { Card, SubtleInfoCard } from '@/components/ui/Cards';
8 8
import { Grid, Col, Row, Between } from '@/components/ui/LayoutHelpers';
9 9
import { Button } from '@/components/ui/Button'
10 10
import { Shadows, Colors, Typography, Spacing, BorderRadius } from '@/constants/theme';
11 11
import { Ionicons, Octicons } from '@expo/vector-icons';
12 -
import { Link } from 'expo-router';
12 +
import { Link, router } from 'expo-router';
13 13
14 14
export default function Actions() {
15 15
const { user } = useAuth();
16 +
17 +
const onPressSleep = () => {
18 +
router.push('/sleep/new')
19 +
}
16 20
17 21
return (
18 22
<ScreenLayout userName={user.firstName} userAvatar={user.avatarURL}
19 23
onNotificationPress={() => console.log('Notifications')}
20 24
showNotificationBadge={true}>
43 47
Controle horários, doses e estoque de suas prescrições.
44 48
</Text>
45 49
</Card>
46 50
47 51
<Grid gap={4}>
48 -
<Card style={{ padding: Spacing.cardGap }}>
52 +
<Card onPress={onPressSleep} style={{ padding: Spacing.cardGap }}>
49 53
<View style={[styles.cardIcon, { backgroundColor: '#EFF6FF' }]}>
50 54
<Ionicons name="moon-outline" size={20} color="#2563EB" />
51 55
</View>
52 56
53 57
<Text style={styles.cardTitle}>
125 129
color: Colors.light.textSecondary,
126 130
marginTop: 4
127 131
},
128 132
disclaimerCard: {
129 133
padding: Spacing.cardGap,
134 +
marginTop: 20
130 135
},
131 136
disclaimerTitleContainer: {
132 137
flex: 1,
133 138
flexDirection: 'row',
134 139
gap: 5,
156 161
fontSize: 12,
157 162
lineHeight: 16,
158 163
alignItems: 'center'
159 164
}
160 165
})