Skip to content

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

Add expandable video on the side to the integration page.

Ivan Vasilovf05580fe959a
diff --git a/apps/docs/layouts/guides/index.tsx b/apps/docs/layouts/guides/index.tsx
index b637c118b20..1363448853c 100644
--- a/apps/docs/layouts/guides/index.tsx
+++ b/apps/docs/layouts/guides/index.tsx
@@ -1,17 +1,15 @@
import { MDXProvider } from '@mdx-js/react'
import { NextSeo } from 'next-seo'
import Head from 'next/head'
-import Link from 'next/link'
import { useRouter } from 'next/router'
import { FC, useEffect, useRef, useState } from 'react'
-import { IconExternalLink } from 'ui'
+import { ExpandableVideo, IconExternalLink } from 'ui'
import components from '~/components'
import { highlightSelectedTocItem } from '~/components/CustomHTMLElements/CustomHTMLElements.utils'
import { FooterHelpCalloutType } from '~/components/FooterHelpCallout'
import GuidesTableOfContents from '~/components/GuidesTableOfContents'
import useHash from '~/hooks/useHash'
import { LayoutMainContent } from '../DefaultLayout'
-import ExpandableVideo from 'ui/src/components/ExpandableVideo/ExpandableVideo'
interface Props {
meta: {
diff --git a/apps/www/pages/partners/integrations/[slug].tsx b/apps/www/pages/partners/integrations/[slug].tsx
index 9e1b67541a0..e99c570d579 100644
--- a/apps/www/pages/partners/integrations/[slug].tsx
+++ b/apps/www/pages/partners/integrations/[slug].tsx
@@ -11,7 +11,7 @@ import { Dispatch, SetStateAction, useState } from 'react'
import remarkGfm from 'remark-gfm'
import { Swiper, SwiperSlide } from 'swiper/react'
import 'swiper/swiper.min.css'
-import { Admonition, Button, IconChevronLeft, IconExternalLink } from 'ui'
+import { Admonition, Button, ExpandableVideo, IconChevronLeft, IconExternalLink } from 'ui'
import ImageModal from '~/components/ImageModal'
import DefaultLayout from '~/components/Layouts/Default'
import SectionContainer from '~/components/Layouts/SectionContainer'
@@ -166,22 +166,6 @@ function Partner({
Overview
</h2>
- {partner.video && (
- <div
- className="bg-scale-1000 relative w-full rounded-md shadow-lg"
- style={{ padding: '56.25% 0 0 0', marginBottom: '1rem' }}
- >
- <iframe
- title="Demo video showcasing Supabase"
- className="absolute h-full w-full rounded-md"
- src={`https://www.youtube-nocookie.com/embed/${partner.video}?autoplay=0&loop=0&controls=1&modestbranding=1&rel=0&disablekb=1`}
- style={{ top: 0, left: 0 }}
- frameBorder="0"
- allow="autoplay; modestbranding; encrypted-media"
- />
- </div>
- )}
-
<div className="prose">
<MDXRemote {...overview} components={mdxComponents(setFocusedImage)} />
</div>
@@ -196,6 +180,16 @@ function Partner({
Details
</h2>
+ {partner.video && (
+ <div className="mb-6">
+ <ExpandableVideo
+ imgUrl=""
+ videoId={partner.video}
+ imgOverlayText="Watch an introductory video"
+ />
+ </div>
+ )}
+
<div className="text-scale-1200 divide-y">
{partner.type === 'technology' && (
<div className="flex items-center justify-between py-2">
diff --git a/packages/ui/src/components/ExpandableVideo/ExpandableVideo.tsx b/packages/ui/src/components/ExpandableVideo/ExpandableVideo.tsx
index fb799acfe96..350ca3f6a78 100644
--- a/packages/ui/src/components/ExpandableVideo/ExpandableVideo.tsx
+++ b/packages/ui/src/components/ExpandableVideo/ExpandableVideo.tsx
@@ -1,15 +1,21 @@
-import React from 'react'
+import { useBreakpoint } from 'common'
import Image from 'next/image'
+import React from 'react'
import { IconPlay, Modal } from 'ui'
-import { useBreakpoint } from 'common'
interface ExpandableVideoProps {
imgUrl: string
videoId: string
+ imgOverlayText?: string
imgAltText?: string
}
-function ExpandableVideo({ imgUrl, videoId, imgAltText }: ExpandableVideoProps) {
+export function ExpandableVideo({
+ imgUrl,
+ videoId,
+ imgOverlayText,
+ imgAltText,
+}: ExpandableVideoProps) {
const [expandVideo, setExpandVideo] = React.useState(false)
const isMobile = useBreakpoint(768)
@@ -81,7 +87,7 @@ function ExpandableVideo({ imgUrl, videoId, imgAltText }: ExpandableVideoProps)
`}
>
<IconPlay strokeWidth={2} size="small" />
- <p className="text-sm">Watch video guide</p>
+ <p className="text-sm">{imgOverlayText ?? 'Watch video guide'}</p>
</div>
<Image
src={imgUrl}
@@ -94,5 +100,3 @@ function ExpandableVideo({ imgUrl, videoId, imgAltText }: ExpandableVideoProps)
</>
)
}
-
-export default ExpandableVideo