Skip to content

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

chore: update footer component to change content.

Jonathan Summers-Muir96ca5f09cc78
diff --git a/apps/docs/components/FooterCTACallout.tsx b/apps/docs/components/FooterCTACallout.tsx
deleted file mode 100644
index 713a0121368..00000000000
--- a/apps/docs/components/FooterCTACallout.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-const FooterCTACallout = () => {
- return (
- <div className="mt-32">
- <div className="min-w-full px-8 py-6 prose bg-scale-300 dark:bg-whiteA-200 rounded">
- <h5 className="text-sm m-0 text-scale-1100">Looking for Serverless Postgres?</h5>
- <p className="m-0 text-sm text-scale-900">
- Supabase is the fastest way to get started with Postgres in a serverless environment. <a href="https://supabase.com/database?utm=postgres-helpers">Learn more</a>.
- </p>
- </div>
- </div>
- )
-}
-
-export default FooterCTACallout
\ No newline at end of file
diff --git a/apps/docs/components/FooterHelpCallout.tsx b/apps/docs/components/FooterHelpCallout.tsx
index 2eb6421dc4c..23e676f0043 100644
--- a/apps/docs/components/FooterHelpCallout.tsx
+++ b/apps/docs/components/FooterHelpCallout.tsx
@@ -1,11 +1,38 @@
-const FooterHelpCallout = () => {
+import { ReactMarkdown } from 'react-markdown/lib/react-markdown'
+
+export type FooterHelpCalloutType = 'default' | 'postgres'
+
+const content = {
+ default: {
+ title: 'Need some help?',
+ description: `Not to worry, our specialist engineers are here to help. Submit a support ticket through the [Dashboard](https://app.supabase.com/support/new).`,
+ },
+ postgres: {
+ title: 'Looking for Serverless Postgres?',
+ description: `Supabase is the fastest way to get started with Postgres in a serverless environment. [Learn more](https://supabase.com/database?utm=postgres-helpers).`,
+ },
+}
+
+const FooterHelpCallout = ({
+ footerHelpType = 'default',
+ title,
+}: {
+ footerHelpType: FooterHelpCalloutType
+ title: any
+}) => {
return (
- <div className="mt-32">
- <div className="min-w-full px-8 py-6 prose bg-scale-300 dark:bg-whiteA-200 rounded">
- <h5 className="text-sm m-0 text-scale-1100">Need some help?</h5>
+ <div className="mt-32 not-prose">
+ <div
+ className="
+ min-w-full
+ px-8 py-6
+ prose
+ bg-scale-300 dark:bg-whiteA-200
+ rounded"
+ >
+ <h5 className="text-sm m-0 text-scale-1100">{content[footerHelpType].title}</h5>
<p className="m-0 text-sm text-scale-900">
- Not to worry, our specialist engineers are here to help. Submit a support ticket through
- the <a href="https://app.supabase.com/support/new">Dashboard</a>.
+ <ReactMarkdown>{content[footerHelpType].description}</ReactMarkdown>
</p>
</div>
</div>
diff --git a/apps/docs/layouts/DefaultGuideLayout.tsx b/apps/docs/layouts/DefaultGuideLayout.tsx
index ea39047c4dd..d2c01704763 100644
--- a/apps/docs/layouts/DefaultGuideLayout.tsx
+++ b/apps/docs/layouts/DefaultGuideLayout.tsx
@@ -1,8 +1,15 @@
import { FC } from 'react'
+import { FooterHelpCalloutType } from '~/components/FooterHelpCallout'
import GuideLayout from './guides'
interface Props {
- meta: { title: string; description?: string; hide_table_of_contents?: boolean; video?: string }
+ meta: {
+ title: string
+ description?: string
+ hide_table_of_contents?: boolean
+ video?: string
+ footerHelpType?: FooterHelpCalloutType
+ }
children: any
toc?: any
currentPage?: string
diff --git a/apps/docs/layouts/SiteLayout.tsx b/apps/docs/layouts/SiteLayout.tsx
index cb31612a3da..fe864ae4fd0 100644
--- a/apps/docs/layouts/SiteLayout.tsx
+++ b/apps/docs/layouts/SiteLayout.tsx
@@ -330,7 +330,6 @@ const SiteLayout = ({ children }) => {
</div>
<div className="grow px-5 max-w-7xl mx-auto py-16">
{children}
- <FooterHelpCallout />
<Footer />
</div>
<MobileMenuBackdrop />
diff --git a/apps/docs/layouts/guides/index.tsx b/apps/docs/layouts/guides/index.tsx
index 07ec7929195..8e4cd6b2366 100644
--- a/apps/docs/layouts/guides/index.tsx
+++ b/apps/docs/layouts/guides/index.tsx
@@ -6,9 +6,9 @@ import { FC, useEffect, useRef, useState } from 'react'
import { IconExternalLink } from 'ui'
import components from '~/components'
import { highlightSelectedTocItem } from '~/components/CustomHTMLElements/CustomHTMLElements.utils'
+import FooterHelpCallout, { FooterHelpCalloutType } from '~/components/FooterHelpCallout'
import GuidesTableOfContents from '~/components/GuidesTableOfContents'
import useHash from '~/hooks/useHash'
-import { getPageType } from '~/lib/helpers'
interface Props {
meta: {
@@ -17,6 +17,7 @@ interface Props {
hide_table_of_contents?: boolean
breadcrumb?: string
subtitle?: string
+ footerHelpType?: FooterHelpCalloutType
}
children: any
toc?: any
@@ -25,6 +26,7 @@ interface Props {
}
const Layout: FC<Props> = (props) => {
+ console.log('PAGE META', props.meta)
const [hash] = useHash()
const articleRef = useRef()
@@ -145,6 +147,7 @@ const Layout: FC<Props> = (props) => {
</div>
)}
</div>
+ <FooterHelpCallout footerHelpType={props.meta?.footerHelpType} title={props.meta?.title} />
</>
)
}
diff --git a/apps/docs/pages/guides/resources/postgres/dropping-all-tables-in-schema.mdx b/apps/docs/pages/guides/resources/postgres/dropping-all-tables-in-schema.mdx
index 2e35c56903a..e3d9645f763 100644
--- a/apps/docs/pages/guides/resources/postgres/dropping-all-tables-in-schema.mdx
+++ b/apps/docs/pages/guides/resources/postgres/dropping-all-tables-in-schema.mdx
@@ -3,6 +3,7 @@ import Layout from '~/layouts/DefaultGuideLayout'
export const meta = {
title: 'Drop all tables in a PostgreSQL schema',
description: 'Useful snippet for deleting all tables in a given schema',
+ footerHelpType: 'postgres',
}
If you need to drop all tables in a given schema, you can execute the query below.
diff --git a/apps/docs/pages/guides/resources/postgres/first-row-in-group.mdx b/apps/docs/pages/guides/resources/postgres/first-row-in-group.mdx
index 667e41fd7da..8db101398c4 100644
--- a/apps/docs/pages/guides/resources/postgres/first-row-in-group.mdx
+++ b/apps/docs/pages/guides/resources/postgres/first-row-in-group.mdx
@@ -3,6 +3,7 @@ import Layout from '~/layouts/DefaultGuideLayout'
export const meta = {
title: 'Select first row for each group in PostgreSQL',
description: 'PostgreSQL snippet for grabbing the first row in each distinct group by group',
+ footerHelpType: 'postgres',
}
Given a table `seasons`:
@@ -15,7 +16,7 @@ Given a table `seasons`:
| 4 | Brighton | 28 |
| 5 | Liverpool | 79 |
-We want to find the rows containing the maximum number of points *per team*.
+We want to find the rows containing the maximum number of points _per team_.
The expected output we want is:
@@ -27,10 +28,16 @@ The expected output we want is:
From the [SQL editor](https://app.supabase.com/project/_/sql) you can run a query like:
```sql
-select distinct on (team)
- id, team, points
-from seasons
-order BY id, points desc, team;
+select distinct
+ on (team) id,
+ team,
+ points
+from
+ seasons
+order BY
+ id,
+ points desc,
+ team;
```
The important bits here are the `desc` that we put on the ordering of `points` which ranks the points in descending value (starting with the highest). And the `distinct` keyword that tells Postgres to only return a single row per team.
diff --git a/apps/docs/pages/guides/resources/postgres/which-version-of-postgres.mdx b/apps/docs/pages/guides/resources/postgres/which-version-of-postgres.mdx
index 60adf7780e9..db254addb3b 100644
--- a/apps/docs/pages/guides/resources/postgres/which-version-of-postgres.mdx
+++ b/apps/docs/pages/guides/resources/postgres/which-version-of-postgres.mdx
@@ -3,6 +3,7 @@ import Layout from '~/layouts/DefaultGuideLayout'
export const meta = {
title: 'Print PostgreSQL version',
description: 'Useful snippet for finding out which version of postgres you are running',
+ footerHelpType: 'postgres',
}
It's important to know which version of PostgreSQL you are running, since each major version has different features and may cause breaking changes. If [upgrading](https://www.postgresql.org/docs/current/pgupgrade.html) or downgrading a major Postgres version, you may need to update your schema.
@@ -10,7 +11,8 @@ It's important to know which version of PostgreSQL you are running, since each m
From the [SQL editor](https://app.supabase.com/project/_/sql) you can run the simple query:
```sql
-select version();
+select
+ version ();
```
Which should return something like: