Skip to content

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

Small style fixes

Joshen Limae6f987647de
diff --git a/studio/components/interfaces/Account/TOTPFactors/AddNewFactorModal.tsx b/studio/components/interfaces/Account/TOTPFactors/AddNewFactorModal.tsx
index 58925ab8aec..fa0b563aec1 100644
--- a/studio/components/interfaces/Account/TOTPFactors/AddNewFactorModal.tsx
+++ b/studio/components/interfaces/Account/TOTPFactors/AddNewFactorModal.tsx
@@ -173,7 +173,7 @@ const SecondStep = ({
>
<Modal.Content>
<>
- <div className="py-4 px-4 text-sm">
+ <div className="py-4 pb-0 text-sm">
<span>
Use an authenticator app to scan the following QR code, and provide the code from the
app to complete the enrolment.
@@ -186,7 +186,7 @@ const SecondStep = ({
)}
{factor && (
<>
- <div className="flex justify-center py-3">
+ <div className="flex justify-center py-6">
<div className="h-48 w-48 bg-white rounded">
<img width={190} height={190} src={factor.totp.qr_code} alt={factor.totp.uri} />
</div>
diff --git a/studio/components/interfaces/Account/TOTPFactors/index.tsx b/studio/components/interfaces/Account/TOTPFactors/index.tsx
index 39d949b12fa..47cdc0b6361 100644
--- a/studio/components/interfaces/Account/TOTPFactors/index.tsx
+++ b/studio/components/interfaces/Account/TOTPFactors/index.tsx
@@ -50,23 +50,23 @@ const TOTPFactors = () => {
{data.totp.map((factor) => {
return (
<div key={factor.id} className="flex flex-row justify-between py-2">
- <div className="flex flex-col space-y-0.5">
- <span className="text-sm text">
- Name: {factor.friendly_name ?? 'No name provided'}
- </span>
- <span className="text-sm text-light">Factor ID: {factor.id}</span>
- </div>
- <div className="flex items-center gap-3">
- <span className="text-sm text-light">
- Created at {dayjs(factor.updated_at).format(DATETIME_FORMAT)}
- </span>
+ <p className="text-sm text flex items-center space-x-2">
+ <span className="text-light">Name:</span>{' '}
+ <span>{factor.friendly_name ?? 'No name provided'}</span>
+ </p>
+ <div className="flex items-center gap-4">
+ <p className="text-sm text-light">
+ Added on {dayjs(factor.updated_at).format(DATETIME_FORMAT)}
+ </p>
<Button
size="tiny"
- type="text"
- className="px-1"
- icon={<IconTrash />}
+ type="default"
+ // className="px-1"
+ // icon={<IconTrash />}
onClick={() => setFactorToBeDeleted(factor.id)}
- />
+ >
+ Remove
+ </Button>
</div>
</div>
)
diff --git a/studio/components/interfaces/SignIn/SignInMfaForm.tsx b/studio/components/interfaces/SignIn/SignInMfaForm.tsx
index 990635907b3..03a41eb9ec8 100644
--- a/studio/components/interfaces/SignIn/SignInMfaForm.tsx
+++ b/studio/components/interfaces/SignIn/SignInMfaForm.tsx
@@ -27,7 +27,11 @@ const SignInMfaForm = () => {
isSuccess: factorsSuccess,
isLoading: areFactorsLoading,
} = useMfaListFactorsQuery()
- const { mutateAsync: mfaChallengeAndVerify, isLoading } = useMfaChallengeAndVerifyMutation()
+ const {
+ mutateAsync: mfaChallengeAndVerify,
+ isLoading,
+ isSuccess,
+ } = useMfaChallengeAndVerifyMutation()
const [selectedFactor, setSelectedFactor] = useState<Factor | null>(null)
const signOut = useSignOut()
@@ -93,69 +97,73 @@ const SignInMfaForm = () => {
onSubmit={onSignIn}
>
{() => (
- <div className="flex flex-col gap-4">
- <Input
- id="code"
- name="code"
- type="text"
- autoFocus
- icon={<IconLock />}
- placeholder="XXXXXX"
- disabled={isLoading}
- autoComplete="off"
- spellCheck="false"
- autoCapitalize="none"
- autoCorrect="off"
- label={
- selectedFactor && factors?.totp.length === 2
- ? `Code generated by ${selectedFactor.friendly_name}`
- : null
- }
- />
+ <>
+ <div className="flex flex-col gap-4">
+ <Input
+ id="code"
+ name="code"
+ type="text"
+ autoFocus
+ icon={<IconLock />}
+ placeholder="XXXXXX"
+ disabled={isLoading}
+ autoComplete="off"
+ spellCheck="false"
+ autoCapitalize="none"
+ autoCorrect="off"
+ label={
+ selectedFactor && factors?.totp.length === 2
+ ? `Code generated by ${selectedFactor.friendly_name}`
+ : null
+ }
+ />
- <Button
- block
- form="sign-in-mfa-form"
- htmlType="submit"
- size="large"
- disabled={isLoading}
- loading={isLoading}
- >
- {isLoading ? 'Verifying' : 'Verify'}
- </Button>
- {factors?.totp.length === 2 && (
- <div className="text-sm flex flex-col items-center w-full gap-1">
- <div>
- <span className="text-scale-900">Having problems?</span>{' '}
- <a
- className="text-white hover:border-b border-white"
- href="#"
- onClick={() =>
- setSelectedFactor(factors.totp.find((f) => f.id !== selectedFactor?.id)!)
- }
- >{`Authenticate using ${
- factors.totp.find((f) => f.id !== selectedFactor?.id)?.friendly_name
- }?`}</a>
+ <Button
+ block
+ form="sign-in-mfa-form"
+ htmlType="submit"
+ size="large"
+ disabled={isLoading || isSuccess}
+ loading={isLoading || isSuccess}
+ >
+ {isLoading ? 'Verifying' : 'Verify'}
+ </Button>
+ {factors?.totp.length === 2 && (
+ <div className="text-sm flex flex-col items-center w-full gap-1">
+ <div>
+ <span className="text-scale-900">Having problems?</span>{' '}
+ <a
+ className="text-white hover:border-b border-white"
+ href="#"
+ onClick={() =>
+ setSelectedFactor(factors.totp.find((f) => f.id !== selectedFactor?.id)!)
+ }
+ >{`Authenticate using ${
+ factors.totp.find((f) => f.id !== selectedFactor?.id)?.friendly_name
+ }?`}</a>
+ </div>
</div>
- </div>
- )}
- </div>
+ )}
+ </div>
+ <div
+ onClick={onClickLogout}
+ className="mt-3 transition text-center text-sm text-scale-1000 hover:text-scale-1200 cursor-pointer"
+ >
+ Cancel sign in
+ </div>
+ </>
)}
</Form>
)}
- <div>
- <a
- className="underline transition text-scale-1100 hover:text-scale-1200 cursor-pointer"
- onClick={onClickLogout}
- >
- Cancel signing in?
- </a>
- </div>
<div className="self-center my-8 text-sm">
- <span className="text-scale-1000">Unable to log in?</span>{' '}
- <Link href="/support/new?subject=Unable+to+log+in+via+MFA&category=Login_issues">
- <a className="underline transition text-scale-1100 hover:text-scale-1200">
+ <span className="text-scale-1000">Unable to sign in?</span>{' '}
+ <Link passHref href="/support/new?subject=Unable+to+sign+in+via+MFA&category=Login_issues">
+ <a
+ target="_blank"
+ rel="noreferrer"
+ className="underline transition text-scale-1100 hover:text-scale-1200"
+ >
Reach out via support
</a>
</Link>
diff --git a/studio/components/interfaces/Support/SupportForm.tsx b/studio/components/interfaces/Support/SupportForm.tsx
index 9655d767525..ed4d58f65dd 100644
--- a/studio/components/interfaces/Support/SupportForm.tsx
+++ b/studio/components/interfaces/Support/SupportForm.tsx
@@ -390,44 +390,46 @@ const SupportForm = ({ setSentCategory }: SupportFormProps) => {
</div>
)}
- {isSuccessProjects && values.projectRef === 'no-project' && (
- <div className="px-6">
- {isLoadingOrganizations && (
- <div className="space-y-2">
- <p className="text-sm prose">Which organization is affected?</p>
- <ShimmeringLoader className="!py-[19px]" />
- </div>
- )}
- {isErrorOrganizations && (
- <div className="space-y-2">
- <p className="text-sm prose">Which organization is affected?</p>
- <div className="border rounded-md px-4 py-2 flex items-center space-x-2">
- <IconAlertCircle strokeWidth={2} className="text-scale-1000" />
- <p className="text-sm prose">Failed to retrieve organizations</p>
+ {isSuccessProjects &&
+ values.projectRef === 'no-project' &&
+ values.category !== 'Login_issues' && (
+ <div className="px-6">
+ {isLoadingOrganizations && (
+ <div className="space-y-2">
+ <p className="text-sm prose">Which organization is affected?</p>
+ <ShimmeringLoader className="!py-[19px]" />
</div>
- </div>
- )}
- {isSuccessOrganizations && (
- <Listbox
- id="organizationSlug"
- layout="vertical"
- label="Which organization is affected?"
- >
- {organizations?.map((option) => {
- return (
- <Listbox.Option
- key={`option-${option.slug}`}
- label={option.name || ''}
- value={option.slug}
- >
- <span>{option.name}</span>
- </Listbox.Option>
- )
- })}
- </Listbox>
- )}
- </div>
- )}
+ )}
+ {isErrorOrganizations && (
+ <div className="space-y-2">
+ <p className="text-sm prose">Which organization is affected?</p>
+ <div className="border rounded-md px-4 py-2 flex items-center space-x-2">
+ <IconAlertCircle strokeWidth={2} className="text-scale-1000" />
+ <p className="text-sm prose">Failed to retrieve organizations</p>
+ </div>
+ </div>
+ )}
+ {isSuccessOrganizations && (
+ <Listbox
+ id="organizationSlug"
+ layout="vertical"
+ label="Which organization is affected?"
+ >
+ {organizations?.map((option) => {
+ return (
+ <Listbox.Option
+ key={`option-${option.slug}`}
+ label={option.name || ''}
+ value={option.slug}
+ >
+ <span>{option.name}</span>
+ </Listbox.Option>
+ )
+ })}
+ </Listbox>
+ )}
+ </div>
+ )}
{subscription?.plan.id === 'free' && values.category !== 'Login_issues' && (
<div className="px-6">
diff --git a/studio/components/layouts/AccountLayout/AccountLayout.tsx b/studio/components/layouts/AccountLayout/AccountLayout.tsx
index 7a8dbe4dae2..5ebbab909b1 100644
--- a/studio/components/layouts/AccountLayout/AccountLayout.tsx
+++ b/studio/components/layouts/AccountLayout/AccountLayout.tsx
@@ -81,6 +81,13 @@ const AccountLayout = ({ children, title, breadcrumbs }: PropsWithChildren<Accou
href: `/account/me`,
key: `/account/me`,
},
+ {
+ isActive: router.pathname === `/account/tokens`,
+ icon: `${router.basePath}/img/user.svg`,
+ label: 'Access Tokens',
+ href: `/account/tokens`,
+ key: `/account/tokens`,
+ },
// show the MFA page only if the feature flag is set or the user has already MFA setup.
// He should be able to edit/revoke his MFA even if MFA feature flag is disabled.
...(mfaSetup || (factors?.all || []).length > 0
@@ -94,13 +101,6 @@ const AccountLayout = ({ children, title, breadcrumbs }: PropsWithChildren<Accou
},
]
: []),
- {
- isActive: router.pathname === `/account/tokens`,
- icon: `${router.basePath}/img/user.svg`,
- label: 'Access Tokens',
- href: `/account/tokens`,
- key: `/account/tokens`,
- },
],
},
]
diff --git a/studio/pages/account/security.tsx b/studio/pages/account/security.tsx
index b34c08743a4..c44af798c73 100644
--- a/studio/pages/account/security.tsx
+++ b/studio/pages/account/security.tsx
@@ -43,11 +43,7 @@ const Security: NextPageWithLayout = () => {
</div>
{data ? (
- <Badge
- color={
- data.totp.length === 0 ? 'gray' : data.totp.length === 1 ? 'yellow' : 'green'
- }
- >
+ <Badge color={data.totp.length === 0 ? 'gray' : 'green'}>
{data.totp.length} app{data.totp.length === 1 ? '' : 's'} configured
</Badge>
) : null}