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/components/Partners/TileGrid.tsx b/apps/www/components/Partners/TileGrid.tsx index dfc733561ca..41b510dca63 100644 --- a/apps/www/components/Partners/TileGrid.tsx +++ b/apps/www/components/Partners/TileGrid.tsx @@ -3,35 +3,35 @@ import Link from 'next/link' import { Partner } from '~/types/partners' export default function TileGrid({ - partnersByCategory, + partners, hideCategories = false, }: { - partnersByCategory: { [category: string]: Partner[] } + partners: Partner[] hideCategories?: boolean }) { + const partnersByCategory: { [category: string]: Partner[] } = {} + partners.forEach( + (p) => (partnersByCategory[p.category] = [...(partnersByCategory[p.category] ?? []), p]) + ) + + const featuredPartners = partners.filter((p) => p.featured) + return ( <> - {Object.keys(partnersByCategory).map((category) => ( -
- {!hideCategories &&

{category}

} + {featuredPartners.length > 0 ? ( + +
+ ) : null} + {Object.keys(partnersByCategory).map((category) => ( +
+ {!hideCategories &&

{category}

} +
+ {partnersByCategory[category].map((p) => ( + + +
+
+
+ {p.title} +
+
+

+ {p.title} +

+

+ {p.description} +

diff --git a/apps/www/lib/database.types.ts b/apps/www/lib/database.types.ts index 2e536759c2f..c834e0a4110 100644 --- a/apps/www/lib/database.types.ts +++ b/apps/www/lib/database.types.ts @@ -1,112 +1,140 @@ -export type Json = string | number | boolean | null | { [key: string]: Json } | Json[] +export type Json = string | number | boolean | null | { [key: string]: Json | undefined } | Json[] export interface Database { public: { Tables: { - partners: { - Row: { - id: number - slug: string - type: Database['public']['Enums']['partner_type'] - category: string - developer: string - title: string - description: string - logo: string - images: string[] - video: string - overview: string - website: string - docs: string - approved: boolean - } - Insert: { - id?: number - slug?: string - type?: Database['public']['Enums']['partner_type'] - category?: string - developer?: string - title?: string - description?: string - logo?: string - images?: string[] - video?: string - overview?: string - website?: string - docs?: string - approved?: boolean - } - Update: { - id?: number - slug?: string - type?: Database['public']['Enums']['partner_type'] - category?: string - developer?: string - title?: string - description?: string - logo?: string - images?: string[] - video?: string - overview?: string - website?: string - docs?: string - approved?: boolean - } - } partner_contacts: { Row: { - id: number - type: Database['public']['Enums']['partner_type'] company: string + contacted: boolean country: string - details?: string + created_at: string + details: string | null email: string first: string + id: number last: string - phone?: string - size?: number - title?: string + phone: string | null + size: number | null + title: string | null + type: Database['public']['Enums']['partner_type'] website: string } Insert: { + company: string + contacted?: boolean + country: string + created_at?: string + details?: string | null + email: string + first: string id?: number - type?: Database['public']['Enums']['partner_type'] - company?: string - country?: string - details?: string - email?: string - first?: string - last?: string - phone?: string - size?: number - title?: string - website?: string + last: string + phone?: string | null + size?: number | null + title?: string | null + type: Database['public']['Enums']['partner_type'] + website: string } Update: { - id?: number - type?: Database['public']['Enums']['partner_type'] company?: string + contacted?: boolean country?: string - details?: string + created_at?: string + details?: string | null email?: string first?: string + id?: number last?: string - phone?: string - size?: number - title?: string + phone?: string | null + size?: number | null + title?: string | null + type?: Database['public']['Enums']['partner_type'] website?: string } + Relationships: [] + } + partners: { + Row: { + approved: boolean | null + call_to_action_link: string | null + category: string + contact: number + created_at: string + description: string + developer: string + docs: string | null + featured: boolean + id: number + images: string[] | null + logo: string + overview: string + slug: string + title: string + tsv: unknown | null + type: Database['public']['Enums']['partner_type'] + video: string | null + website: string + } + Insert: { + approved?: boolean | null + call_to_action_link?: string | null + category: string + contact: number + created_at?: string + description: string + developer: string + docs?: string | null + featured?: boolean + id?: number + images?: string[] | null + logo: string + overview: string + slug: string + title: string + tsv?: unknown | null + type: Database['public']['Enums']['partner_type'] + video?: string | null + website: string + } + Update: { + approved?: boolean | null + call_to_action_link?: string | null + category?: string + contact?: number + created_at?: string + description?: string + developer?: string + docs?: string | null + featured?: boolean + id?: number + images?: string[] | null + logo?: string + overview?: string + slug?: string + title?: string + tsv?: unknown | null + type?: Database['public']['Enums']['partner_type'] + video?: string | null + website?: string + } + Relationships: [ + { + foreignKeyName: 'partners_contact_fkey' + columns: ['contact'] + referencedRelation: 'partner_contacts' + referencedColumns: ['id'] + } + ] } } Views: {} - Functions: { - derive_label_sort_from_label: { - Args: { label: string } - Returns: string - } - } + Functions: {} Enums: { partner_type: 'technology' | 'expert' } + CompositeTypes: { + [_ in never]: never + } } } diff --git a/apps/www/pages/partners/experts/[slug].tsx b/apps/www/pages/partners/experts/[slug].tsx index 3d6b1807eb6..ffb5f8fe409 100644 --- a/apps/www/pages/partners/experts/[slug].tsx +++ b/apps/www/pages/partners/experts/[slug].tsx @@ -32,7 +32,7 @@ function Partner({ url: `https://supabase.com/partners/experts/${partner.slug}`, images: [ { - url: partner.images[0] ?? partner.logo, + url: partner.images ? partner.images[0] : partner.logo, }, ], }} @@ -92,7 +92,7 @@ function Partner({ }, }} > - {partner.images.map((image: any, i: number) => { + {partner.images?.map((image: any, i: number) => { return (
@@ -178,7 +178,7 @@ function Partner({
- {partner.type === 'technology' && ( + {partner.type === 'technology' && partner.docs && (
Documentation (partnersByCategory[p.category] = [...(partnersByCategory[p.category] ?? []), p]) - ) const router = useRouter() const meta_title = 'Find an expert' @@ -122,7 +118,7 @@ function ExpertPartnersPage(props: Props) { {/* Partner Tiles */}
{partners.length ? ( - + ) : (

No Partners Found

)} diff --git a/apps/www/pages/partners/integrations/[slug].tsx b/apps/www/pages/partners/integrations/[slug].tsx index 661369872d2..95a87f58eba 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, 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' @@ -60,7 +60,7 @@ function Partner({ url: `https://supabase.com/partners/integrations/${partner.slug}`, images: [ { - url: partner.images[0] ?? partner.logo, + url: partner.images ? partner.images[0] : partner.logo, }, ], }} @@ -137,7 +137,7 @@ function Partner({ }, }} > - {partner.images.map((image: any, i: number) => { + {partner.images?.map((image: any, i: number) => { return (
@@ -157,8 +157,8 @@ function Partner({
-
-
+
+

- {partner.video && ( -
-