-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
108 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ yarn-error.* | |
*.pem | ||
|
||
# local env files | ||
.env | ||
.env*.local | ||
|
||
# typescript | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import React, { useEffect, useState } from 'react'; | ||
import { Button, View } from 'react-native'; | ||
import supabase from '../supabase/createClient'; | ||
|
||
interface Resource { | ||
summary: string; | ||
[key: string]: any; | ||
} | ||
|
||
export default function HealingResources() { | ||
const [, setSummaries] = useState<Resource[]>([]); | ||
|
||
useEffect(() => { | ||
fetchData(); | ||
}, []); | ||
|
||
const fetchData = async () => { | ||
try { | ||
const { data, error } = await supabase | ||
.from('healing_resources') | ||
.select('*'); | ||
|
||
if (error) { | ||
console.error('Error fetching resources:', error); | ||
return; | ||
} | ||
|
||
setSummaries(data as Resource[]); | ||
} catch (error) { | ||
console.error('Error fetching data:', error); | ||
} | ||
}; | ||
|
||
return ( | ||
<View> | ||
<Button | ||
title="Hope Healing Guide" | ||
onPress={() => console.log('does this work')} | ||
/> | ||
<Button | ||
title="Theme Healing Resources" | ||
onPress={() => console.log('does this work')} | ||
/> | ||
</View> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { StyleSheet } from 'react-native'; | ||
|
||
export default StyleSheet.create({ | ||
container: { | ||
width: '100%', | ||
height: '100%', | ||
alignItems: 'center', | ||
justifyContent: 'flex-start', | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import React, { useEffect, useState } from 'react'; | ||
import { Button, Text, View } from 'react-native'; | ||
import supabase from '../supabase/createClient'; | ||
|
||
interface Resource { | ||
summary: string; | ||
[key: string]: any; | ||
} | ||
|
||
export default function SeekHelp() { | ||
const [summaries, setSummaries] = useState<Resource[]>([]); | ||
|
||
useEffect(() => { | ||
fetchData(); | ||
}, []); | ||
|
||
const fetchData = async () => { | ||
try { | ||
const { data, error } = await supabase | ||
.from('state_resources') | ||
.select('*') | ||
.in('state', ['California', 'National']); | ||
|
||
if (error) { | ||
console.error('Error fetching resources:', error); | ||
return; | ||
} | ||
|
||
setSummaries(data as Resource[]); | ||
} 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> | ||
); | ||
} |
Empty file.