diff --git a/apps/studio/components/interfaces/Auth/Hooks/CreateHookSheet.tsx b/apps/studio/components/interfaces/Auth/Hooks/CreateHookSheet.tsx index 9e081452d99..2d5027d9f45 100644 --- a/apps/studio/components/interfaces/Auth/Hooks/CreateHookSheet.tsx +++ b/apps/studio/components/interfaces/Auth/Hooks/CreateHookSheet.tsx @@ -225,7 +225,7 @@ export const CreateHookSheet = ({ return ( onClose()}> - +
{ const authHookSecret = generateAuthHookSecret() form.setValue('httpsValues.secret', authHookSecret) diff --git a/apps/studio/components/interfaces/Auth/ThirdPartyAuthForm/AddIntegrationDropdown.tsx b/apps/studio/components/interfaces/Auth/ThirdPartyAuthForm/AddIntegrationDropdown.tsx index 5228a5b6fae..2088848282b 100644 --- a/apps/studio/components/interfaces/Auth/ThirdPartyAuthForm/AddIntegrationDropdown.tsx +++ b/apps/studio/components/interfaces/Auth/ThirdPartyAuthForm/AddIntegrationDropdown.tsx @@ -1,18 +1,25 @@ import { ChevronDown } from 'lucide-react' import Image from 'next/image' +import { IS_PLATFORM } from 'common' +import { useOrgSubscriptionQuery } from 'data/subscriptions/org-subscription-query' +import { useSelectedOrganization } from 'hooks/misc/useSelectedOrganization' import { Button, + cn, DropdownMenu, DropdownMenuContent, DropdownMenuItem, + DropdownMenuLabel, + DropdownMenuSeparator, DropdownMenuTrigger, } from 'ui' import { - INTEGRATION_TYPES, getIntegrationTypeIcon, getIntegrationTypeLabel, + INTEGRATION_TYPES, } from './ThirdPartyAuthForm.utils' +import Link from 'next/link' interface AddIntegrationDropdownProps { buttonText?: string @@ -21,9 +28,38 @@ interface AddIntegrationDropdownProps { const Providers: INTEGRATION_TYPES[] = ['firebase', 'auth0', 'awsCognito'] +const ProviderDropdownItem = ({ + disabled, + type, + onSelectIntegrationType, +}: { + disabled?: boolean + type: INTEGRATION_TYPES + onSelectIntegrationType: (type: INTEGRATION_TYPES) => void +}) => { + return ( + onSelectIntegrationType(type)} + className={cn('flex items-center gap-x-2 p-2', disabled && 'cursor-not-allowed')} + disabled={disabled} + > + {`${type} + {getIntegrationTypeLabel(type)} + + ) +} + export const AddIntegrationDropdown = ({ onSelectIntegrationType, }: AddIntegrationDropdownProps) => { + const organization = useSelectedOrganization() + + const { data: subscription } = useOrgSubscriptionQuery( + { orgSlug: organization?.slug }, + { enabled: IS_PLATFORM } + ) + return ( @@ -31,25 +67,48 @@ export const AddIntegrationDropdown = ({ Add provider - - {Providers.map((type) => { - const name = getIntegrationTypeLabel(type) - return ( - onSelectIntegrationType(type)} - className="flex items-center gap-x-2 p-2" - > - {`${name} + + + {subscription?.plan.id === 'free' ? ( + <> + +
+ +

Unavailable on the Free plan

+

+ + Upgrade your plan + {' '} + to add the following providers to your project. +

+
+ - {name} - - ) - })} + +
+ + ) : ( + <> + + + + )}
) diff --git a/apps/studio/components/interfaces/Auth/ThirdPartyAuthForm/index.tsx b/apps/studio/components/interfaces/Auth/ThirdPartyAuthForm/index.tsx index 79c73d4313c..83941540b3c 100644 --- a/apps/studio/components/interfaces/Auth/ThirdPartyAuthForm/index.tsx +++ b/apps/studio/components/interfaces/Auth/ThirdPartyAuthForm/index.tsx @@ -21,9 +21,9 @@ import { CreateAwsCognitoAuthIntegrationDialog } from './CreateAwsCognitoAuthDia import { CreateFirebaseAuthIntegrationDialog } from './CreateFirebaseAuthDialog' import { IntegrationCard } from './IntegrationCard' import { - INTEGRATION_TYPES, getIntegrationType, getIntegrationTypeLabel, + INTEGRATION_TYPES, } from './ThirdPartyAuthForm.utils' export const ThirdPartyAuthForm = () => { @@ -62,14 +62,23 @@ export const ThirdPartyAuthForm = () => {
) : null } + docsUrl="https://supabase.com/docs/guides/auth/third-party/overview" /> - +
+ + Billing is based on the number of monthly active users (MAUs) requesting your API + throughout the billing period (50 included then you'll be charged{' '} + + $0.00325 + per MAU). +
{isLoading && (
{ 'border rounded border-default px-20 py-16 flex flex-col items-center justify-center space-y-4' )} > -

No integrations configured yet

+

No providers configured yet

{ return ( -
+