Bromeo777 commited on
Commit
c0d87eb
·
unverified ·
1 Parent(s): 395aa38

Delete mobile_app/screens/Dashboard.tsx

Browse files
Files changed (1) hide show
  1. mobile_app/screens/Dashboard.tsx +0 -195
mobile_app/screens/Dashboard.tsx DELETED
@@ -1,195 +0,0 @@
1
- import React from 'react';
2
- import { View, Text, StyleSheet, ScrollView, TouchableOpacity, Dimensions, Image } from 'react-native';
3
- import { LinearGradient } from 'expo-linear-gradient';
4
- import { FontAwesome5 } from '@expo/vector-icons';
5
- import { NativeStackNavigationProp } from '@react-navigation/native-stack';
6
- import { RootStackParamList, useAuth } from '../App';
7
-
8
- type Props = {
9
- navigation: NativeStackNavigationProp<RootStackParamList, 'Dashboard'>;
10
- };
11
-
12
- const { width } = Dimensions.get('window');
13
-
14
- export default function Dashboard({ navigation }: Props) {
15
- // Pulling the Global Auth State from the App.tsx Context
16
- const { userToken } = useAuth();
17
-
18
- return (
19
- <ScrollView style={styles.container} showsVerticalScrollIndicator={false}>
20
-
21
- {/* ==========================================
22
- HEADER SECTION & AUTH STATUS
23
- ========================================== */}
24
- <View style={styles.header}>
25
- <View>
26
- <Text style={styles.greeting}>
27
- Welcome • {userToken?.is_premium ? 'Premium Tier' : 'Standard Access'}
28
- </Text>
29
- <Text style={styles.brandTitle}>RM Research <Text style={styles.highlight}>AI</Text></Text>
30
- </View>
31
- <View style={styles.avatarContainer}>
32
- <Image source={{ uri: 'https://i.pravatar.cc/150?img=11' }} style={styles.avatar} />
33
- {/* Show a gold crown if the user has a premium JWT token */}
34
- {userToken?.is_premium && (
35
- <View style={styles.premiumBadge}>
36
- <FontAwesome5 name="crown" size={8} color="#0B0F19" />
37
- </View>
38
- )}
39
- </View>
40
- </View>
41
-
42
- {/* ==========================================
43
- WORKSPACE 1: DISCOVERY & DATA GATHERING
44
- ========================================== */}
45
- <Text style={styles.sectionTitle}>Discovery & Library</Text>
46
- <ScrollView horizontal showsHorizontalScrollIndicator={false} style={styles.workspaceScroll}>
47
- <WorkspaceCard
48
- title="Explore Engine"
49
- sub="Phase 1: OpenAlex Search"
50
- icon="search"
51
- colors={['#3b82f6', '#1d4ed8']}
52
- onPress={() => console.log('Hit /api/v1/explore')}
53
- />
54
- <WorkspaceCard
55
- title="Library Manager"
56
- sub="Phase 2: Zotero Sync"
57
- icon="book"
58
- colors={['#6366f1', '#4338ca']}
59
- onPress={() => console.log('Hit /api/v1/library')}
60
- />
61
- <WorkspaceCard
62
- title="Data Extraction"
63
- sub="Phase 3: PICO Parsing"
64
- icon="file-export"
65
- colors={['#8b5cf6', '#6d28d9']}
66
- onPress={() => console.log('Hit /api/v1/extraction')}
67
- />
68
- <WorkspaceCard
69
- title="Concept Maps"
70
- sub="Phase 4: Network Graphs"
71
- icon="project-diagram"
72
- colors={['#ec4899', '#be185d']}
73
- onPress={() => console.log('Hit /api/v1/maps')}
74
- />
75
- </ScrollView>
76
-
77
- {/* ==========================================
78
- WORKSPACE 2: SYNTHESIS & PRODUCTION
79
- ========================================== */}
80
- <Text style={styles.sectionTitle}>Synthesis & Production</Text>
81
- <ScrollView horizontal showsHorizontalScrollIndicator={false} style={styles.workspaceScroll}>
82
- <WorkspaceCard
83
- title="WriteSage"
84
- sub="Phase 9: Scientific Drafting"
85
- icon="pen-fancy"
86
- colors={['#10b981', '#047857']}
87
- onPress={() => navigation.navigate('WriteSage')} // This connects to our final file!
88
- />
89
- <WorkspaceCard
90
- title="Veritas Shield"
91
- sub="Phase 7: Integrity Audit"
92
- icon="shield-alt"
93
- colors={['#f59e0b', '#b45309']}
94
- onPress={() => console.log('Hit /api/v1/veritas')}
95
- />
96
- <WorkspaceCard
97
- title="ProposAI"
98
- sub="Phase 8: NIH/NSF Grants"
99
- icon="rocket"
100
- colors={['#f43f5e', '#be123c']}
101
- onPress={() => console.log('Hit /api/v1/proposals')}
102
- />
103
- <WorkspaceCard
104
- title="DataPure"
105
- sub="Phase 10: MICE Imputation"
106
- icon="database"
107
- colors={['#14b8a6', '#0f766e']}
108
- onPress={() => console.log('Hit /api/v1/data')}
109
- />
110
- </ScrollView>
111
-
112
- {/* ==========================================
113
- ACTIVE JOBS (Mocking FastAPI BackgroundTasks)
114
- ========================================== */}
115
- <Text style={styles.sectionTitle}>Active BackgroundTasks</Text>
116
- <View style={styles.listContainer}>
117
- <JobCard
118
- title="Extraction Engine"
119
- status="/api/v1/extraction/run (Processing 12 PDFs)"
120
- progress={65}
121
- icon="file-pdf"
122
- />
123
- <JobCard
124
- title="DataPure Job"
125
- status="Imputing missing clinical values..."
126
- progress={30}
127
- icon="table"
128
- />
129
- </View>
130
- </ScrollView>
131
- );
132
- }
133
-
134
- // ==========================================
135
- // REUSABLE UI COMPONENTS
136
- // ==========================================
137
-
138
- const WorkspaceCard = ({ title, sub, icon, colors, onPress }: any) => (
139
- <TouchableOpacity activeOpacity={0.8} onPress={onPress}>
140
- <LinearGradient colors={colors} start={{ x: 0, y: 0 }} end={{ x: 1, y: 1 }} style={styles.card}>
141
- <View style={styles.cardIconGlow}>
142
- <FontAwesome5 name={icon} size={24} color="#FFF" />
143
- </View>
144
- <Text style={styles.cardTitle}>{title}</Text>
145
- <Text style={styles.cardSubtitle}>{sub}</Text>
146
- </LinearGradient>
147
- </TouchableOpacity>
148
- );
149
-
150
- const JobCard = ({ title, status, progress, icon }: any) => (
151
- <View style={styles.jobCard}>
152
- <View style={styles.jobIcon}>
153
- <FontAwesome5 name={icon} size={20} color="#3b82f6" />
154
- </View>
155
- <View style={styles.jobDetails}>
156
- <Text style={styles.jobTitle}>{title}</Text>
157
- <Text style={styles.jobStatus}>{status}</Text>
158
- <View style={styles.progressBarBg}>
159
- <LinearGradient colors={['#3b82f6', '#8b5cf6']} style={[styles.progressBarFill, { width: `${progress}%` }]} />
160
- </View>
161
- </View>
162
- </View>
163
- );
164
-
165
- // ==========================================
166
- // STYLESHEET (Strict Premium Guidelines)
167
- // ==========================================
168
-
169
- const styles = StyleSheet.create({
170
- container: { flex: 1, backgroundColor: '#0B0F19', paddingHorizontal: 20, paddingTop: 60 },
171
- header: { flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', marginBottom: 25 },
172
- greeting: { color: '#10b981', fontSize: 14, fontWeight: '600', marginBottom: 4 },
173
- brandTitle: { color: '#FFF', fontSize: 26, fontWeight: '800' },
174
- highlight: { color: '#3b82f6' },
175
- avatarContainer: { position: 'relative' },
176
- avatar: { width: 50, height: 50, borderRadius: 25, borderWidth: 2, borderColor: '#3b82f6' },
177
- premiumBadge: { position: 'absolute', bottom: -5, right: -5, backgroundColor: '#f59e0b', padding: 4, borderRadius: 10, borderWidth: 2, borderColor: '#0B0F19' },
178
-
179
- sectionTitle: { color: '#FFF', fontSize: 18, fontWeight: '700', marginBottom: 15 },
180
- workspaceScroll: { marginBottom: 30 },
181
-
182
- card: { width: width * 0.42, height: 180, borderRadius: 24, padding: 20, marginRight: 15, justifyContent: 'flex-end' },
183
- cardIconGlow: { width: 50, height: 50, borderRadius: 25, backgroundColor: 'rgba(255,255,255,0.2)', justifyContent: 'center', alignItems: 'center', marginBottom: 20 },
184
- cardTitle: { color: '#FFF', fontSize: 18, fontWeight: '700' },
185
- cardSubtitle: { color: 'rgba(255,255,255,0.8)', fontSize: 12, marginTop: 5 },
186
-
187
- listContainer: { paddingBottom: 50 },
188
- jobCard: { backgroundColor: '#111827', borderRadius: 20, padding: 15, flexDirection: 'row', alignItems: 'center', marginBottom: 15, borderWidth: 1, borderColor: '#1F2937' },
189
- jobIcon: { width: 50, height: 50, borderRadius: 15, backgroundColor: 'rgba(59, 130, 246, 0.1)', justifyContent: 'center', alignItems: 'center', marginRight: 15 },
190
- jobDetails: { flex: 1 },
191
- jobTitle: { color: '#FFF', fontSize: 16, fontWeight: '600' },
192
- jobStatus: { color: '#9CA3AF', fontSize: 12, marginTop: 4, marginBottom: 8 },
193
- progressBarBg: { height: 6, backgroundColor: '#1F2937', borderRadius: 3, overflow: 'hidden' },
194
- progressBarFill: { height: '100%', borderRadius: 3 },
195
- });