Skip to content

Commit 6af9ff6

Browse files
authored
Chore/user management v2 panel (#29468)
* Midway implementing user management v2 panel * Do up overview panel less provider information * Midway provider info * Wrap up provider information * Add banned until banner * Slight adjustment to search input * Fix * Fix provider icons in data grid * Fix * Moar fixes * Add loading line * Address some feedback * Reorder some elements in the user overview panel * Fix icons going over cell headers
1 parent 4f71dd4 commit 6af9ff6

File tree

6 files changed

+778
-381
lines changed

6 files changed

+778
-381
lines changed

apps/studio/components/interfaces/Auth/AuthProvidersForm/ProviderForm.tsx

+13-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { PermissionAction } from '@supabase/shared-types/out/constants'
22
import { useParams } from 'common'
33
import { Check, ChevronUp, ExternalLink } from 'lucide-react'
4-
import { useState } from 'react'
4+
import { useEffect, useRef, useState } from 'react'
55
import ReactMarkdown from 'react-markdown'
66
import { toast } from 'sonner'
77

@@ -12,6 +12,7 @@ import { useProjectApiQuery } from 'data/config/project-api-query'
1212
import { useCustomDomainsQuery } from 'data/custom-domains/custom-domains-query'
1313
import { useCheckPermissions } from 'hooks/misc/useCheckPermissions'
1414
import { BASE_PATH } from 'lib/constants'
15+
import Link from 'next/link'
1516
import {
1617
Alert,
1718
Alert_Shadcn_,
@@ -26,16 +27,16 @@ import {
2627
import { ProviderCollapsibleClasses } from './AuthProvidersForm.constants'
2728
import type { Provider } from './AuthProvidersForm.types'
2829
import FormField from './FormField'
29-
import Link from 'next/link'
3030

3131
export interface ProviderFormProps {
3232
config: components['schemas']['GoTrueConfigResponse']
3333
provider: Provider
3434
}
3535

3636
const ProviderForm = ({ config, provider }: ProviderFormProps) => {
37+
const ref = useRef<HTMLButtonElement>(null)
3738
const [open, setOpen] = useState(false)
38-
const { ref: projectRef } = useParams()
39+
const { ref: projectRef, provider: urlProvider } = useParams()
3940
const { mutate: updateAuthConfig, isLoading: isUpdatingConfig } = useAuthConfigUpdateMutation()
4041

4142
const doubleNegativeKeys = ['MAILER_AUTOCONFIRM', 'SMS_AUTOCONFIRM']
@@ -182,6 +183,14 @@ const ProviderForm = ({ config, provider }: ProviderFormProps) => {
182183
)
183184
}
184185

186+
useEffect(() => {
187+
if (urlProvider === provider.title.toLowerCase()) {
188+
setOpen(true)
189+
ref.current?.scrollIntoView({ behavior: 'smooth', block: 'start' })
190+
}
191+
// eslint-disable-next-line react-hooks/exhaustive-deps
192+
}, [urlProvider])
193+
185194
return (
186195
<Collapsible
187196
open={open}
@@ -190,6 +199,7 @@ const ProviderForm = ({ config, provider }: ProviderFormProps) => {
190199
>
191200
<Collapsible.Trigger asChild>
192201
<button
202+
ref={ref}
193203
type="button"
194204
className="group flex w-full items-center justify-between rounded py-3 px-6 text-foreground"
195205
>

0 commit comments

Comments
 (0)