Skip to content

Commit 30a0935

Browse files
committed
made all entries into sheet using tamagui, needs testing
1 parent a6d925a commit 30a0935

File tree

11 files changed

+3068
-2222
lines changed

11 files changed

+3068
-2222
lines changed

app/_layout.tsx

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ import { SafeAreaView, View, ActivityIndicator } from 'react-native';
1818
import { LinearGradient } from 'expo-linear-gradient';
1919
import colors from './styles/color';
2020

21+
import { TamaguiProvider } from 'tamagui';
22+
import { tamaguiConfig } from '../tamagui.config';
23+
24+
2125
export {
2226
// Catch any errors thrown by the Layout component.
2327
ErrorBoundary,
@@ -93,23 +97,25 @@ function AuthenticationGuard({ children }: { children: React.ReactNode }) {
9397
function RootLayoutNav() {
9498
return (
9599
<>
96-
<ThemeProvider value={NAV_THEME['light']}>
97-
<UserProvider>
98-
<SafeAreaView style={{ flex: 1 }}>
99-
<AuthenticationGuard>
100-
<Stack screenOptions={{ headerShown: false }}>
101-
<Stack.Screen name="index" />
102-
<Stack.Screen name="signin" />
103-
<Stack.Screen name="JournalEntryScreen" />
104-
<Stack.Screen name="interview" />
105-
<Stack.Screen name="summary" />
106-
{/* <Stack.Screen name="signin/email" /> */}
107-
<Stack.Screen name="modal" options={{ presentation: 'modal' }} />
108-
</Stack>
109-
</AuthenticationGuard>
110-
</SafeAreaView>
111-
</UserProvider>
112-
</ThemeProvider>
100+
<TamaguiProvider config={tamaguiConfig}>
101+
<ThemeProvider value={NAV_THEME['light']}>
102+
<UserProvider>
103+
<SafeAreaView style={{ flex: 1 }}>
104+
<AuthenticationGuard>
105+
<Stack screenOptions={{ headerShown: false }}>
106+
<Stack.Screen name="index" />
107+
<Stack.Screen name="signin" />
108+
<Stack.Screen name="JournalEntryScreen" />
109+
<Stack.Screen name="interview" />
110+
<Stack.Screen name="summary" />
111+
{/* <Stack.Screen name="signin/email" /> */}
112+
<Stack.Screen name="modal" options={{ presentation: 'modal' }} />
113+
</Stack>
114+
</AuthenticationGuard>
115+
</SafeAreaView>
116+
</UserProvider>
117+
</ThemeProvider>
118+
</TamaguiProvider>
113119
</>
114120
);
115121
}

app/screens/EntryDetail.tsx

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,22 @@
11
import React from 'react';
22
import { View, Text, StyleSheet, ScrollView, TouchableOpacity } from 'react-native';
33
import { useNavigation } from '@react-navigation/native';
4+
import { RouteProp } from '@react-navigation/native';
45

5-
const EntryDetail = ({ route }) => {
6+
type EntryDetailParams = {
7+
Entry: {
8+
entry: {
9+
title: string;
10+
categories: string[];
11+
shortSummary: string;
12+
identifiedHardSkills: string[];
13+
identifiedSoftSkills: string[];
14+
reflection?: string;
15+
};
16+
};
17+
};
18+
19+
const EntryDetail = ({ route }: { route: RouteProp<EntryDetailParams, 'Entry'> }) => {
620
const { entry } = route.params;
721
const navigation = useNavigation();
822

@@ -16,7 +30,7 @@ const EntryDetail = ({ route }) => {
1630

1731
{/* Categories */}
1832
<View style={styles.categoriesContainer}>
19-
{entry.categories.map(cat => (
33+
{entry.categories.map((cat: string) => (
2034
<Text key={cat} style={[styles.categoryChip, { backgroundColor: getCategoryColor(cat) }]}>
2135
{cat}
2236
</Text>
@@ -30,15 +44,15 @@ const EntryDetail = ({ route }) => {
3044
{/* Identified Hard Skills */}
3145
<Text style={styles.sectionTitle}>Identified Hard Skills</Text>
3246
{entry.identifiedHardSkills.length > 0 ? (
33-
entry.identifiedHardSkills.map(skill => <Text key={skill} style={styles.listItem}>{skill}</Text>)
47+
entry.identifiedHardSkills.map((skill: string) => <Text key={skill} style={styles.listItem}>{skill}</Text>)
3448
) : (
3549
<Text style={styles.entryText}>No hard skills identified.</Text>
3650
)}
3751

3852
{/* Identified Soft Skills */}
3953
<Text style={styles.sectionTitle}>Identified Soft Skills</Text>
4054
{entry.identifiedSoftSkills.length > 0 ? (
41-
entry.identifiedSoftSkills.map(skill => <Text key={skill} style={styles.listItem}>{skill}</Text>)
55+
entry.identifiedSoftSkills.map((skill: string) => <Text key={skill} style={styles.listItem}>{skill}</Text>)
4256
) : (
4357
<Text style={styles.entryText}>No soft skills identified.</Text>
4458
)}
@@ -51,15 +65,17 @@ const EntryDetail = ({ route }) => {
5165
};
5266

5367
// Helper function to match category colors
54-
export const getCategoryColor = (category: string) => {
68+
const getCategoryColor = (category: string) => {
5569
const CATEGORIES: Record<string, string> = {
5670
Academic: '#FDE68A',
5771
Personal: '#99E9F2',
5872
Leadership: '#F8B4C0',
5973
Research: '#BBF7D0',
6074
Project: '#FDAF75',
6175
};
62-
return CATEGORIES[category] || '#ccc';
76+
77+
// Check if the category is a valid key
78+
return CATEGORIES[category as keyof typeof CATEGORIES] || '#ccc';
6379
};
6480

6581
const styles = StyleSheet.create({

0 commit comments

Comments
 (0)