Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

chore: using ts-ignore on some example imports to get things moving 🙈

Jonathan Summers-Muirf4f97177eb45
diff --git a/www/components/AuthWidget/AuthWidget.tsx b/www/components/AuthWidget/AuthWidget.tsx
index b3a151f1ccb..308896e195a 100644
--- a/www/components/AuthWidget/AuthWidget.tsx
+++ b/www/components/AuthWidget/AuthWidget.tsx
@@ -142,7 +142,7 @@ function AuthPage() {
<Space size={12} direction="vertical">
<div>
<Typography.Title level={3}>Customise your login form</Typography.Title>
- <Typography.Text level={3}>
+ <Typography.Text>
Our ReactJS Auth form will help you get going even quicker{' '}
</Typography.Text>
</div>
diff --git a/www/components/BuiltWithSupabase/index.tsx b/www/components/BuiltWithSupabase/index.tsx
index 7794b3306f6..084857f29bc 100644
--- a/www/components/BuiltWithSupabase/index.tsx
+++ b/www/components/BuiltWithSupabase/index.tsx
@@ -6,6 +6,7 @@ import SectionContainer from '../Layouts/SectionContainer'
import ExampleCard from '../ExampleCard'
import Examples from 'data/Examples.json'
+import Link from 'next/link'
// import Button from '../Button'
const BuiltExamples = () => {
@@ -17,20 +18,28 @@ const BuiltExamples = () => {
<Typography.Text>
<p className="text-lg">There's many example apps and starter projects to get going</p>
<Space className="justify-center">
- <Button type="outline" href="https://github.com/supabase/supabase/tree/master/examples">
- View all examples
- </Button>
- <Button
- type="outline"
- icon={<IconGitHub />}
+ <Link
href="https://github.com/supabase/supabase/tree/master/examples"
+ as="https://github.com/supabase/supabase/tree/master/examples"
>
- Official github library
- </Button>
+ <a>
+ <Button type="outline">View all examples</Button>
+ </a>
+ </Link>
+ <Link
+ href="https://github.com/supabase/supabase/tree/master/examples"
+ as="https://github.com/supabase/supabase/tree/master/examples"
+ >
+ <a>
+ <Button type="outline" icon={<IconGitHub />}>
+ Official github library
+ </Button>
+ </a>
+ </Link>
</Space>
</Typography.Text>
</div>
- <div class="grid grid-cols-12 gap-5 mt-16">
+ <div className="grid grid-cols-12 gap-5 mt-16">
{Examples.slice(0, 6).map((example, i) => {
return (
<div className="col-span-12 lg:col-span-6 xl:col-span-4">
diff --git a/www/components/Card.tsx b/www/components/Card.tsx
index 7d144096dc5..c319e2e0c80 100644
--- a/www/components/Card.tsx
+++ b/www/components/Card.tsx
@@ -67,7 +67,7 @@ const Card = (props: Props) => {
</div>
)} */}
<p className="text-sm font-base capitalize text-gray-600 dark:text-dark-300">{type}</p>
- <div className="block mt-2 flex flex-col justify-between h-32">
+ <div className="mt-2 flex flex-col justify-between h-32">
{/* {logoUrl && <img src={logoUrl} className="h-9 my-4" />} */}
{title && <p className="text-xl text-gray-900 dark:text-white">{title}</p>}
<p className="mt-3 text-base text-gray-500 dark:text-dark-400">
diff --git a/www/components/Carousels/ImageCarousel.tsx b/www/components/Carousels/ImageCarousel.tsx
index 57a633fa3e5..28f4f23e37e 100644
--- a/www/components/Carousels/ImageCarousel.tsx
+++ b/www/components/Carousels/ImageCarousel.tsx
@@ -4,33 +4,27 @@ import { useState } from 'react'
// Import Swiper React components
import { Swiper, SwiperSlide } from 'swiper/react'
-import SwiperCore, { EffectFade } from 'swiper'
// Import Swiper styles
import 'swiper/swiper.min.css'
-import 'swiper/components/effect-fade/effect-fade.min.css'
-
-import CodeBlock from '../CodeBlock/CodeBlock'
import ImageCarouselStyles from './ImageCarousel.module.css'
-import TweetCard from '../TweetCard'
-
-SwiperCore.use([EffectFade])
interface Content {
title: string
label?: string
- img_url: string
- text: string
+ img_url?: string
+ video_url?: string
+ text?: string
}
-interface ImageCaoursel {
- content: Content
+interface ImageCarouselProps {
+ content: Content[]
footer?: React.ReactNode
altTabView?: boolean
}
-function ImageCarousel(props: ImageCaoursel) {
+function ImageCarousel(props: ImageCarouselProps) {
// base path for images
const { basePath } = useRouter()
@@ -80,7 +74,7 @@ function ImageCarousel(props: ImageCaoursel) {
// @ts-ignore
onChange={(id: string) => handleImageSwiperNav(Number(id))}
>
- {props.content.map((content, i) => {
+ {props.content.map((content: Content, i) => {
return (
<Tabs.Panel
label={content.label ? content.label : content.title}
@@ -106,7 +100,7 @@ function ImageCarousel(props: ImageCaoursel) {
autoHeight={true}
allowTouchMove={false}
>
- {props.content.map((content, i) => {
+ {props.content.map((content: Content, i: number) => {
return (
<SwiperSlide key={i}>
{content.img_url && <img src={`${basePath}${content.img_url}`} />}
@@ -140,7 +134,7 @@ function ImageCarousel(props: ImageCaoursel) {
onChange={(id: string) => handleImageSwiperNav(Number(id))}
block
>
- {props.content.map((content, i) => {
+ {props.content.map((content: Content, i: number) => {
return (
<Tabs.Panel label={content.label ? content.label : content.title} id={i.toString()}>
<span></span>
diff --git a/www/components/Carousels/SplitCodeBlockCarousel.tsx b/www/components/Carousels/SplitCodeBlockCarousel.tsx
index e854b1ecbc0..6bebca92e3d 100644
--- a/www/components/Carousels/SplitCodeBlockCarousel.tsx
+++ b/www/components/Carousels/SplitCodeBlockCarousel.tsx
@@ -9,8 +9,21 @@ import CodeBlock from '../CodeBlock/CodeBlock'
import 'swiper/swiper.min.css'
import Badge from '../Badge'
+interface Content {
+ lang: 'js' | 'py' | 'sql'
+ title: string
+ code: string
+ detail_title?: string
+ detail_text?: string
+ badges_label?: string
+ badges?: string[]
+ url?: string
+}
+
interface SplitCodeBlockCarousel {
- content: any
+ content: Content[]
+ footer?: React.ReactNode
+ altTabView?: boolean
}
function SplitCodeBlockCarousel(props: SplitCodeBlockCarousel) {
@@ -48,7 +61,6 @@ function SplitCodeBlockCarousel(props: SplitCodeBlockCarousel) {
return (
<div className="col-span-12 lg:col-span-6 lg:col-start-7 sbui-tabs--alt">
<Tabs
- className="alt-tabs"
scrollable
// @ts-ignore
activeId={apiSwiperActiveIndex.toString()}
diff --git a/www/components/Footer/index.tsx b/www/components/Footer/index.tsx
index fc6b8c19594..c119b7cc6fa 100644
--- a/www/components/Footer/index.tsx
+++ b/www/components/Footer/index.tsx
@@ -1,9 +1,7 @@
-import { useState, useEffect } from 'react'
-import FooterLinks from 'data/Footer.json'
import { useRouter } from 'next/router'
+import FooterLinks from 'data/Footer.json'
import SectionContainer from '../Layouts/SectionContainer'
import DarkModeToggle from '../DarkModeToggle'
-import SupabaseStatus from './SupabaseStatus'
type Props = {
darkMode: boolean
diff --git a/www/components/Hero.tsx b/www/components/Hero.tsx
index 32c0037efd2..64b396948ab 100644
--- a/www/components/Hero.tsx
+++ b/www/components/Hero.tsx
@@ -64,7 +64,7 @@ const Hero = () => {
</div>
</div>
</div>
- <div className="flex content-center mt-16 sm:mt-24 lg:absolute lg:-right-80 lg:mt-4 lg:w-9/12 lg:mt-0 lg:col-span-6 xl:relative xl:right-0 xl:w-full">
+ <div className="flex content-center mt-16 sm:mt-24 lg:absolute lg:-right-80 lg:w-9/12 lg:mt-0 lg:col-span-6 xl:relative xl:right-0 xl:w-full">
<div className="flex flex-col items-center justify-center relative w-full rounded-md">
<div className="w-full rounded-t-md h-5 bg-dark-700 flex items-center justify-start px-2">
<div className="h-2 w-2 mr-2 rounded-full bg-dark-500" />
diff --git a/www/components/Layouts/Default.tsx b/www/components/Layouts/Default.tsx
index 65e8705f3e9..5c673f5644e 100644
--- a/www/components/Layouts/Default.tsx
+++ b/www/components/Layouts/Default.tsx
@@ -27,7 +27,7 @@ const DefaultLayout = (props: Props) => {
return (
<>
- {!hideHeader && <Nav darkMode={darkMode} updateTheme={updateTheme} />}
+ {!hideHeader && <Nav darkMode={darkMode} />}
<div className="min-h-screen bg-white dark:bg-gray-800">
<main>{children}</main>
</div>
diff --git a/www/components/MadeForDevelopers/index.tsx b/www/components/MadeForDevelopers/index.tsx
index 7532568678f..7a230919eb5 100644
--- a/www/components/MadeForDevelopers/index.tsx
+++ b/www/components/MadeForDevelopers/index.tsx
@@ -1,26 +1,12 @@
-// import Button from 'components/Button'
-// import Badge from 'components/Badge'
-import {
- Badge,
- Button,
- IconAlignJustify,
- IconArrowUpRight,
- IconCode,
- IconMail,
- IconTerminal,
- IconType,
- Typography,
-} from '@supabase/ui'
-import SectionHeader from 'components/UI/SectionHeader'
-// import CodeExamples from 'components/MadeForDevelopers/CodeExamples'
-
-import CodeExamples from 'data/home/api-examples'
-
-import DeveloperFeatures from 'data/DeveloperFeatures.json'
+import { Badge, Button, IconArrowUpRight, IconMail } from '@supabase/ui'
import APISection from '../Sections/APISection'
import SectionContainer from '../Layouts/SectionContainer'
import FeatureColumn from '../FeatureColumn'
+import CodeExamples from 'data/home/api-examples'
+import DeveloperFeatures from 'data/DeveloperFeatures.json'
+import Link from 'next/link'
+
const MadeForDevelopers = () => {
return (
<SectionContainer className="pb-0">
@@ -37,10 +23,10 @@ const MadeForDevelopers = () => {
endpoints and focus on your product.
</p>,
]}
+ // @ts-ignore
content={CodeExamples}
size="small"
footer={[
- // <div className="grid grid-cols-12 gap-8 lg:gap-16">
<dl className="grid grid-cols-12 gap-8">
{DeveloperFeatures.map((feature: any, idx: number) => {
return (
@@ -56,13 +42,21 @@ const MadeForDevelopers = () => {
</div>
)}
{feature.badge ? (
- <Button href={feature.url} type="default" icon={<IconMail />}>
- {'Get notified'}
- </Button>
+ <Link href={feature.url} as={feature.url}>
+ <a>
+ <Button type="default" icon={<IconMail />}>
+ {'Get notified'}
+ </Button>
+ </a>
+ </Link>
) : (
- <Button href={feature.url} type="default" icon={<IconArrowUpRight />}>
- {'Explore more'}
- </Button>
+ <Link href={feature.url} as={feature.url}>
+ <a>
+ <Button type="default" icon={<IconArrowUpRight />}>
+ {'Explore more'}
+ </Button>
+ </a>
+ </Link>
)}
</dt>
</div>
@@ -70,7 +64,6 @@ const MadeForDevelopers = () => {
)
})}
</dl>,
- // </div>,
]}
/>
</SectionContainer>
diff --git a/www/components/Nav/index.tsx b/www/components/Nav/index.tsx
index c91fcc61a7a..e16402c9654 100644
--- a/www/components/Nav/index.tsx
+++ b/www/components/Nav/index.tsx
@@ -244,7 +244,7 @@ const Nav = (props: Props) => {
<a
href="https://app.supabase.io/api/login"
className={`
- inline-flex items-center px-1 border-b-2 border-transparent text-sm font-medium
+ items-center px-1 border-b-2 border-transparent text-sm font-medium
text-gray-500 hover:text-gray-700 hidden lg:block dark:text-dark-100 dark:hover:text-white
`}
>
@@ -267,7 +267,7 @@ const Nav = (props: Props) => {
leaveFrom="opacity-100 translate-y-0"
leaveTo="opacity-0 translate-y-1"
>
- <div className="p-4 md:p-8 h-full h-screen fixed bg-white transform lg:hidden overflow-y-scroll -inset-y-0 z-50 dark:bg-dark-700">
+ <div className="p-4 md:p-8 h-screen fixed bg-white transform lg:hidden overflow-y-scroll -inset-y-0 z-50 dark:bg-dark-700">
<div className="absolute right-4 top-4 items-center justify-between">
<div className="-mr-2">
<button
diff --git a/www/components/Sections/APISection.tsx b/www/components/Sections/APISection.tsx
index 8fe6735c74b..5be568bc6fc 100644
--- a/www/components/Sections/APISection.tsx
+++ b/www/components/Sections/APISection.tsx
@@ -4,15 +4,15 @@ import { Button, IconArrowUpRight, Tabs, Typography } from '@supabase/ui'
import { Swiper, SwiperSlide } from 'swiper/react'
import CodeBlock from '../CodeBlock/CodeBlock'
-interface APIExample {
+interface Example {
lang: 'js' | 'py' | 'sql'
- code: string
title: string
- size?: 'small' | 'large'
+ code: string
}
interface Props {
- content?: APIExample
+ size?: 'small' | 'large'
+ content: Example[]
title: string | React.ReactNode
footer?: React.ReactNode
text?: React.ReactNode
@@ -42,13 +42,11 @@ function APISection(props: Props) {
<div className="col-span-12 lg:col-span-7 xl:col-span-6 xl:col-start-7 sbui-tabs--alt">
<Tabs
scrollable
- // @ts-ignore
activeId={apiSwiperActiveIndex.toString()}
- // @ts-ignore
onChange={(id: string) => handleApiSwiperNavChange(Number(id))}
>
{props.content &&
- props.content.map((content, i) => (
+ props.content.map((content: Example, i) => (
<Tabs.Panel label={content.title} id={i.toString()}>
<span></span>
</Tabs.Panel>
@@ -66,13 +64,9 @@ function APISection(props: Props) {
allowTouchMove={false}
>
{props.content &&
- props.content.map((content, i) => (
+ props.content.map((content: Example, i) => (
<SwiperSlide>
- <CodeBlock
- key={i}
- lang={content.lang}
- size={content.size ? content.size : 'small'}
- >
+ <CodeBlock key={i} lang={content.lang} size={props.size ? props.size : 'small'}>
{content.code}
</CodeBlock>
</SwiperSlide>
diff --git a/www/data/home/api-examples.js b/www/data/home/api-examples.js
index f10478174ec..1bbf73cd983 100644
--- a/www/data/home/api-examples.js
+++ b/www/data/home/api-examples.js
@@ -1,8 +1,8 @@
export default [
{
+ lang: 'js',
title: 'Create user',
description: 'Sign up a new user in an example chat room',
- lang: 'js',
code: `import { createClient } from '@supabase/supabase-js'
// Initialize
@@ -18,9 +18,9 @@ const { user, error } = await supabase.auth.signUp({
`,
},
{
+ lang: 'js',
title: 'Realtime subscriptions',
description: 'Receive realtime messages in an example chat room',
- lang: 'js',
code: `import { createClient } from '@supabase/supabase-js'
// Initialize
@@ -38,9 +38,9 @@ const realtime = supabase
`,
},
{
+ lang: 'js',
title: 'Read a record',
description: 'Get all public rooms and their messages',
- lang: 'js',
code: `m '@supabase/supabase-js'
// Initialize
@@ -59,9 +59,9 @@ const publicRooms = await supabase
`,
},
{
+ lang: 'js',
title: 'Create a record',
description: 'Create a new chat room',
- lang: 'js',
code: `import { createClient } from '@supabase/supabase-js'
// Initialize
@@ -76,9 +76,9 @@ const newRoom = await supabase
`,
},
{
+ lang: 'js',
title: 'Update a record',
description: 'Update a user',
- lang: 'js',
code: `import { createClient } from '@supabase/supabase-js'
// Initialize
diff --git a/www/pages/auth/Auth.tsx b/www/pages/auth/Auth.tsx
index ba0fce69442..754a87476f9 100644
--- a/www/pages/auth/Auth.tsx
+++ b/www/pages/auth/Auth.tsx
@@ -123,9 +123,7 @@ function AuthPage() {
<p className="text-lg">
Auth built into your project, with no need for external authentication services.
</p>
- <p>
- Use your own custom domains with SMTP settings.
- </p>
+ <p>Use your own custom domains with SMTP settings.</p>
</Typography.Text>
</div>
<div className="col-span-3 col-start-9">
@@ -135,7 +133,8 @@ function AuthPage() {
<Typography.Title level={4}>Own your data</Typography.Title>
<Typography.Text>
<p className="text-lg">
- Keep all your user data in your supabase project so you never have to worry about 3rd party privacy issues.
+ Keep all your user data in your supabase project so you never have to worry about
+ 3rd party privacy issues.
</p>
<p>Supabase is GDPR / CPA Compliant.</p>
</Typography.Text>
@@ -146,7 +145,9 @@ function AuthPage() {
<SectionContainer className="-mb-48">
<APISection
title="Simple and convenient APIs"
+ // @ts-ignore
content={ApiExamples}
+ size="large"
text={[
<p>
An API built from the groud up for server and client side authentication that is fast
@@ -211,7 +212,10 @@ function AuthPage() {
</Button>
</div>
<div className="col-span-12 lg:col-span-6 lg:col-start-7">
- <SplitCodeBlockCarousel content={AuthSqlRulesExamples} />
+ <SplitCodeBlockCarousel
+ // @ts-ignore
+ content={AuthSqlRulesExamples}
+ />
</div>
</div>
</SectionContainer>
diff --git a/www/pages/database/Database.tsx b/www/pages/database/Database.tsx
index c8f5167252c..e9c5f7b6857 100644
--- a/www/pages/database/Database.tsx
+++ b/www/pages/database/Database.tsx
@@ -219,6 +219,7 @@ function Database() {
<SectionContainer className="-mb-48">
<APISection
+ // @ts-ignore
content={ApiExamplesData}
title="Never write an API again"
text={[
@@ -300,7 +301,10 @@ function Database() {
</Button>
</div>
<div className="mt-8 lg:mt-0 col-span-12 lg:col-span-6 lg:col-start-7">
- <SplitCodeBlockCarousel content={ExtensionsExamplesData} />
+ <SplitCodeBlockCarousel
+ // @ts-ignore
+ content={ExtensionsExamplesData}
+ />
</div>
</div>
</SectionContainer>