Skip to content

Commit

Permalink
fixed some things
Browse files Browse the repository at this point in the history
  • Loading branch information
philipye315 committed Oct 22, 2024
1 parent e269761 commit e989aab
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 95 deletions.
51 changes: 1 addition & 50 deletions src/screens/SeekHelp/ResourceList/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useEffect, useState } from 'react';
import { Button, Text, TouchableOpacity, View } from 'react-native';
import { Text, TouchableOpacity, View } from 'react-native';
import { getSeekHelpData } from '@/supabase/queries/generalQueries';
import { Resource } from '@/types/types';
import { styles } from './styles';
Expand Down Expand Up @@ -49,52 +49,3 @@ export default function ResourceList() {
</View>
);
}
// return(
// <View style={styles.container}>

// <View style={styles.leftPanel}>
// <Button title="General Resources" />
// <Button title="Health Organizations" />
// <Button title="LGBT Organizations" />
// <Button title="Legal Services" />
// <Button title="Government Resources" />
// </View>

// <View style={styles.rightPanel}>
// <Button title="Resource 1" />
// <Button title="Resource 2" />
// <Button title="Resource 3" />
// </View>
// </View>
// )

/*
const [summaries, setSummaries] = useState<Resource[]>([]);
useEffect(() => {
fetchData();
}, []);
const fetchData = async () => {
try {
const data = await getSeekHelpData();
setSummaries(data);
} catch (error) {
console.error('Error fetching data:', error);
}
};
return (
<View>
<Button title="Fetch Data" onPress={fetchData} />
{summaries.length > 0 ? (
summaries.map((resource, index) => (
<Text key={index}>{resource.summary}</Text>
))
) : (
<Text>Loading...</Text>
)}
</View>
);
}
*/
46 changes: 1 addition & 45 deletions src/screens/SeekHelp/index.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
// import React, { useEffect, useState } from 'react';
// import { Button, Text, View } from 'react-native';
// import styles from './styles';

// export default function SeekHelp({ navigation }: { navigation: any }) {
// return(
// <View style={styles.buttonContainer}>
// <Button title='State Resources' onPress={() => navigation.navigate('Resource List')} />
// <Button title='National Resources' onPress={() => navigation.navigate('Resource List')} />
// </View>
// )
// }

import React from 'react';
import { Text, TouchableOpacity, View } from 'react-native';
import { styles } from './styles'; // Make sure this is the correct path
import { styles } from './styles';

export default function SeekHelp({ navigation }: { navigation: any }) {
return (
Expand All @@ -33,34 +20,3 @@ export default function SeekHelp({ navigation }: { navigation: any }) {
</View>
);
}

/*
const [summaries, setSummaries] = useState<Resource[]>([]);
useEffect(() => {
fetchData();
}, []);
const fetchData = async () => {
try {
const data = await getSeekHelpData();
setSummaries(data);
} catch (error) {
console.error('Error fetching data:', error);
}
};
return (
<View>
<Button title="Fetch Data" onPress={fetchData} />
{summaries.length > 0 ? (
summaries.map((resource, index) => (
<Text key={index}>{resource.summary}</Text>
))
) : (
<Text>Loading...</Text>
)}
</View>
);
}
*/
4 changes: 4 additions & 0 deletions src/types/types 2.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export interface Resource {
summary: string;
[key: string]: any;
}

0 comments on commit e989aab

Please sign in to comment.