summaryrefslogtreecommitdiff
path: root/src/routes/team/index.svelte
diff options
context:
space:
mode:
authorLogan Hunt <loganhunt@simponic.xyz>2022-04-12 18:39:51 -0600
committerLogan Hunt <loganhunt@simponic.xyz>2022-04-12 18:39:51 -0600
commit3a4b67eb37142fb065ce0fb83b0bb184eab01b02 (patch)
treed569aad03f33f9a2bfdf7bf193a19ac4a319d594 /src/routes/team/index.svelte
downloadmistymountainstherapy-3a4b67eb37142fb065ce0fb83b0bb184eab01b02.tar.gz
mistymountainstherapy-3a4b67eb37142fb065ce0fb83b0bb184eab01b02.zip
Let there be light
Diffstat (limited to 'src/routes/team/index.svelte')
-rw-r--r--src/routes/team/index.svelte43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/routes/team/index.svelte b/src/routes/team/index.svelte
new file mode 100644
index 0000000..56a7e33
--- /dev/null
+++ b/src/routes/team/index.svelte
@@ -0,0 +1,43 @@
+<script>
+ import PersonCard from './PersonCard.svelte';
+
+ import { onMount } from 'svelte';
+ import { supabase } from '$lib/supabase';
+
+ const getPeople = async () => {
+ const { data, error } = await supabase.from('people').select();
+ if (!error) {
+ return data;
+ }
+ console.log(error);
+ return [];
+ }
+
+ const mapImages = (people) => {
+ return people.map((x) => {
+ const { publicURL, error } = supabase
+ .storage
+ .from('mistymountains')
+ .getPublicUrl(x.image);
+ if (!error) {
+ return { ...x, image: publicURL };
+ }
+ return x;
+ });
+ }
+
+ let people = [];
+ onMount(async () => {
+ people = await getPeople().then(mapImages);
+ });
+</script>
+
+<main>
+ {#if people.length}
+ {#each people as person, i}
+ <div class="row">
+ <PersonCard person={person} direction={i % 2 ? 'left' : 'right'} />
+ </div>
+ {/each}
+ {/if}
+</main> \ No newline at end of file