diff --git a/App.tsx b/App.tsx index a76526e..dd13c1d 100644 --- a/App.tsx +++ b/App.tsx @@ -6,6 +6,7 @@ import Home from '@/screens/Home'; import LegalRights from '@/screens/LegalRights/index'; import VideoPage from '@/screens/LegalRights/VideoPage'; import SeekHelp from '@/screens/SeekHelp'; +import resourceList from '@/screens/SeekHelp/ResourceList'; const Stack = createNativeStackNavigator(); @@ -17,6 +18,7 @@ export default function App() { + diff --git a/src/navigation/seekHelpNav.tsx b/src/navigation/seekHelpNav.tsx new file mode 100644 index 0000000..52eab90 --- /dev/null +++ b/src/navigation/seekHelpNav.tsx @@ -0,0 +1,14 @@ +import * as React from 'react'; +import { createNativeStackNavigator } from '@react-navigation/native-stack'; +import SeekHelp from '@/screens/SeekHelp'; +import ResourceList from '@/screens/SeekHelp/ResourceList'; + +const Stack = createNativeStackNavigator(); +export default function seekHelpNav() { + return ( + + + + + ); +} diff --git a/src/screens/SeekHelp/ResourceList/index.tsx b/src/screens/SeekHelp/ResourceList/index.tsx new file mode 100644 index 0000000..0077d81 --- /dev/null +++ b/src/screens/SeekHelp/ResourceList/index.tsx @@ -0,0 +1,51 @@ +import React, { useEffect, useState } from 'react'; +import { Text, TouchableOpacity, View } from 'react-native'; +import { getSeekHelpData } from '@/supabase/queries/generalQueries'; +import { Resource } from '@/types/types'; +import { styles } from './styles'; + +export default function ResourceList() { + const filters = [ + 'General Resources', + 'Health Organizations', + 'LGBT Organizations', + 'Legal Services', + 'Government Resources', + ]; + const [summaries, setSummaries] = useState([]); + + useEffect(() => { + fetchData(); + }, []); + + const fetchData = async () => { + try { + const data = await getSeekHelpData(); + setSummaries(data); + } catch (error) { + console.error('Error fetching data:', error); + } + }; + return ( + + + {filters.map((filter, index) => ( + + {filter} + + ))} + + + + {summaries.length > 0 ? ( + summaries.map((resource, index) => ( + {resource.summary} + )) + ) : ( + Loading... + )} + + + + ); +} diff --git a/src/screens/SeekHelp/ResourceList/styles.ts b/src/screens/SeekHelp/ResourceList/styles.ts new file mode 100644 index 0000000..80879a5 --- /dev/null +++ b/src/screens/SeekHelp/ResourceList/styles.ts @@ -0,0 +1,37 @@ +import { StyleSheet } from 'react-native'; + +export const styles = StyleSheet.create({ + container: { + display: 'flex', + flexDirection: 'row', + marginTop: 10, + padding: 30, + }, + leftPanel: { + display: 'flex', + flexDirection: 'column', + justifyContent: 'flex-start', + width: '25%', + paddingRight: 20, + }, + rightPanel: { + display: 'flex', + flexDirection: 'column', + width: '75%', + backgroundColor: '#f8f8f8', + padding: 10, + }, + filterButton: { + backgroundColor: '#e8e8e8', + alignItems: 'center', + justifyContent: 'center', + borderRadius: 5, + marginVertical: 10, + paddingVertical: 15, + width: '100%', + }, + buttonText: { + fontSize: 16, + color: '#333', + }, +}); diff --git a/src/screens/SeekHelp/index.tsx b/src/screens/SeekHelp/index.tsx index a6e5df6..b02ec5a 100644 --- a/src/screens/SeekHelp/index.tsx +++ b/src/screens/SeekHelp/index.tsx @@ -1,34 +1,22 @@ -import React, { useEffect, useState } from 'react'; -import { Button, Text, View } from 'react-native'; -import { getSeekHelpData } from '@/supabase/queries/generalQueries'; -import { Resource } from '@/types/types'; - -export default function SeekHelp() { - const [summaries, setSummaries] = useState([]); - - useEffect(() => { - fetchData(); - }, []); - - const fetchData = async () => { - try { - const data = await getSeekHelpData(); - setSummaries(data); - } catch (error) { - console.error('Error fetching data:', error); - } - }; +import React from 'react'; +import { Text, TouchableOpacity, View } from 'react-native'; +import { styles } from './styles'; +export default function SeekHelp({ navigation }: { navigation: any }) { return ( - -