Skip to content

Commit

Permalink
good work arfa, minor adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
philipye314 committed Oct 24, 2024
1 parent 99a79e7 commit 702af1c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
8 changes: 5 additions & 3 deletions src/screens/HealingResources/HealingCatalogue/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export default function HealingCatalogue() {
{} as Record<string, HealingResource[]>,
);

// Scroll to top of theme header
const scrollToTheme = (index: number) => {
const targetY = headerPositions[index] || 0;
const paddingTop = 30;
Expand All @@ -39,7 +38,6 @@ export default function HealingCatalogue() {
});
};

// Captures the position of headers as being rendered to use for scrolling
const onLayoutHeader =
(index: number) => (event: { nativeEvent: { layout: { y: number } } }) => {
const { y } = event.nativeEvent.layout;
Expand Down Expand Up @@ -67,7 +65,11 @@ export default function HealingCatalogue() {
<View style={styles.resourcesContainer}>
{themes.map((theme, index) => (
<>
<View style={styles.themeHeader} onLayout={onLayoutHeader(index)}>
<View
style={styles.themeHeader}
onLayout={onLayoutHeader(index)}
key={index}
>
<Text style={styles.themeHeaderText}>{theme}</Text>
</View>
<View style={styles.cardsContainer}>
Expand Down
2 changes: 1 addition & 1 deletion src/screens/HealingResources/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default function HealingResources({ navigation }: { navigation: any }) {
<Text style={styles.buttonText}>Hope for Healing Guide</Text>
</TouchableOpacity>
<TouchableOpacity
style={styles.pagebutton} // Reusing the same style for consistency
style={styles.pagebutton}
onPress={() => navigation.navigate('Themed Healing Resources')}
>
<Text style={styles.buttonText}>Resources Catalogue</Text>
Expand Down
1 change: 0 additions & 1 deletion src/supabase/queries/generalQueries.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export const getHealingResourceData = async (): Promise<HealingResource[]> => {
if (error) {
throw new Error(`Error fetching resources: ${error.message}`);
}
// Convert comma-separated list of strings from `topics` into an array of strings
return data.map(resource => ({
...resource,
topics: resource.topics
Expand Down

0 comments on commit 702af1c

Please sign in to comment.