From d8fa08a620fbf2247b443547a9def29ebc2e9258 Mon Sep 17 00:00:00 2001 From: fubits Date: Fri, 16 Feb 2024 23:45:53 +0100 Subject: [PATCH] Add astro, temporarily --- .../Home/Connect/Connect.constants.ts | 14 ++++ .../Home/Connect/ConnectionIcon.tsx | 2 +- .../Home/Connect/content/astro/content.tsx | 67 +++++++++++++++++++ .../public/img/libraries/astro-dark-icon.svg | 1 + .../public/img/libraries/astro-icon.svg | 1 + 5 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 apps/studio/components/interfaces/Home/Connect/content/astro/content.tsx create mode 100644 apps/studio/public/img/libraries/astro-dark-icon.svg create mode 100644 apps/studio/public/img/libraries/astro-icon.svg diff --git a/apps/studio/components/interfaces/Home/Connect/Connect.constants.ts b/apps/studio/components/interfaces/Home/Connect/Connect.constants.ts index d1d8a399258..29da67fac2e 100644 --- a/apps/studio/components/interfaces/Home/Connect/Connect.constants.ts +++ b/apps/studio/components/interfaces/Home/Connect/Connect.constants.ts @@ -112,6 +112,20 @@ export const FRAMEWORKS: ConnectionType[] = [ }, ], }, + { + key: 'astro', + label: 'Astro', + icon: 'astro', + guideLink: 'https://docs.astro.build/en/guides/backend/supabase/', + children: [ + { + key: 'supabasejs', + label: 'Supabase-js', + children: [], + icon: 'supabase', + }, + ], + }, { key: 'refine', label: 'refine', diff --git a/apps/studio/components/interfaces/Home/Connect/ConnectionIcon.tsx b/apps/studio/components/interfaces/Home/Connect/ConnectionIcon.tsx index de4541decae..06fea207496 100644 --- a/apps/studio/components/interfaces/Home/Connect/ConnectionIcon.tsx +++ b/apps/studio/components/interfaces/Home/Connect/ConnectionIcon.tsx @@ -13,7 +13,7 @@ const ConnectionIcon = ({ connection }: ConnectionIconProps) => { { + return ( + + + + + + + + + + {` +SUPABASE_URL=${projectKeys.apiUrl ?? 'your-project-url'} +SUPABASE_KEY=${projectKeys.anonKey ?? 'your-anon-key'} + `} + + + + + + {` +import { createClient } from "@supabase/supabase-js"; + +const supabaseUrl = import.meta.env.SUPABASE_URL; +const supabaseKey = import.meta.env.SUPABASE_KEY; + +export const supabase = createClient(supabaseUrl, supabaseKey); + `} + + + + + + {` +--- +import { supabase } from '../db/supabase'; + +const { data, error } = await supabase.from("todos").select('*'); +--- + +{ + ( +
    + {data.map((entry) => ( +
  • {entry.name}
  • + ))} +
+ ) +} +`} +
+
+
+ ) +} + +export default ContentFile diff --git a/apps/studio/public/img/libraries/astro-dark-icon.svg b/apps/studio/public/img/libraries/astro-dark-icon.svg new file mode 100644 index 00000000000..f9ed3938b6f --- /dev/null +++ b/apps/studio/public/img/libraries/astro-dark-icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/studio/public/img/libraries/astro-icon.svg b/apps/studio/public/img/libraries/astro-icon.svg new file mode 100644 index 00000000000..fd4528872b4 --- /dev/null +++ b/apps/studio/public/img/libraries/astro-icon.svg @@ -0,0 +1 @@ + \ No newline at end of file