import React, { useCallback } from 'react';
import {
View,
ScrollView,
Text,
StyleSheet,
SafeAreaView,
TouchableOpacity,
RefreshControl,
} from 'react-native';
import { useResources } from '../../hooks/useResources';
import { LoadingState } from '../../components/ui/LoadingState';
import { ErrorState } from '../../components/ui/ErrorState';
import { EmptyState } from '../../components/ui/EmptyState';
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#f5f5f5',
},
header: {
backgroundColor: '#fff',
padding: 16,
borderBottomWidth: 1,
borderBottomColor: '#e0e0e0',
},
headerTitle: {
fontSize: 24,
fontWeight: '700',
color: '#000',
marginBottom: 8,
},
headerDescription: {
fontSize: 14,
color: '#666',
lineHeight: 20,
},
section: {
paddingHorizontal: 16,
marginTop: 16,
},
sectionTitle: {
fontSize: 16,
fontWeight: '600',
color: '#000',
marginBottom: 12,
},
resourceCard: {
backgroundColor: '#fff',
borderRadius: 12,
padding: 16,
marginBottom: 12,
borderLeftWidth: 4,
borderLeftColor: '#0066cc',
},
resourceTitle: {
fontSize: 15,
fontWeight: '600',
color: '#000',
marginBottom: 6,
},
resourceDescription: {
fontSize: 13,
color: '#666',
lineHeight: 18,
},
resourceLink: {
marginTop: 10,
paddingVertical: 8,
paddingHorizontal: 12,
backgroundColor: '#f0f0f0',
borderRadius: 6,
},
resourceLinkText: {
color: '#0066cc',
fontSize: 12,
fontWeight: '600',
textAlign: 'center',
},
});
export default function ResourcesScreen() {
const { data: resources, isLoading, isError, refetch } = useResources();
const onRefresh = useCallback(() => {
refetch();
}, [refetch]);
if (isLoading) {
return ;
}
if (isError) {
return ;
}
return (
}
>
Resources
We know how scary and overwhelming it can be to receive a diagnosis. We've curated helpful resources to make your journey a little easier.
{!resources || resources.length === 0 ? (
) : (
resources.map((resource) => (
{resource.title}
{resource.description}
Learn More →
))
)}
More Coming Soon
Be sure to check back often or sign up to receive updates as we're adding new resources all the time!
);
}