diff --git a/.vscode/settings.json b/.vscode/settings.json index 97d5d1948..82aa3c1a3 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,7 +1,7 @@ { "typescript.tsdk": "node_modules/typescript/lib", "editor.codeActionsOnSave": { - "source.fixAll.eslint": true + "source.fixAll.eslint": "explicit" }, "eslint.validate": ["typescript", "typescriptreact", "javascript", "javascriptreact"], "javascript.preferences.importModuleSpecifier": "non-relative", diff --git a/apps/web/src/components/forms/forgot-password.tsx b/apps/web/src/components/forms/forgot-password.tsx index 55e313c33..3d9efee42 100644 --- a/apps/web/src/components/forms/forgot-password.tsx +++ b/apps/web/src/components/forms/forgot-password.tsx @@ -82,8 +82,8 @@ export const ForgotPasswordForm = ({ className }: ForgotPasswordFormProps) => { /> - diff --git a/apps/web/src/components/forms/password.tsx b/apps/web/src/components/forms/password.tsx index b6b41264c..0eb491537 100644 --- a/apps/web/src/components/forms/password.tsx +++ b/apps/web/src/components/forms/password.tsx @@ -4,7 +4,7 @@ import { zodResolver } from '@hookform/resolvers/zod'; import { useForm } from 'react-hook-form'; import { z } from 'zod'; -import { User } from '@documenso/prisma/client'; +import type { User } from '@documenso/prisma/client'; import { TRPCClientError } from '@documenso/trpc/client'; import { trpc } from '@documenso/trpc/react'; import { cn } from '@documenso/ui/lib/utils'; @@ -146,8 +146,8 @@ export const PasswordForm = ({ className }: PasswordFormProps) => {
-
diff --git a/apps/web/src/components/forms/profile.tsx b/apps/web/src/components/forms/profile.tsx index dc6e3c4d5..0ce5c7f3d 100644 --- a/apps/web/src/components/forms/profile.tsx +++ b/apps/web/src/components/forms/profile.tsx @@ -6,7 +6,7 @@ import { zodResolver } from '@hookform/resolvers/zod'; import { useForm } from 'react-hook-form'; import { z } from 'zod'; -import { User } from '@documenso/prisma/client'; +import type { User } from '@documenso/prisma/client'; import { TRPCClientError } from '@documenso/trpc/client'; import { trpc } from '@documenso/trpc/react'; import { cn } from '@documenso/ui/lib/utils'; @@ -133,8 +133,8 @@ export const ProfileForm = ({ className, user }: ProfileFormProps) => { /> - diff --git a/apps/web/src/components/forms/reset-password.tsx b/apps/web/src/components/forms/reset-password.tsx index e7c701667..354584f6e 100644 --- a/apps/web/src/components/forms/reset-password.tsx +++ b/apps/web/src/components/forms/reset-password.tsx @@ -125,8 +125,8 @@ export const ResetPasswordForm = ({ className, token }: ResetPasswordFormProps) /> - diff --git a/apps/web/src/components/forms/signin.tsx b/apps/web/src/components/forms/signin.tsx index 46173a97c..4e671a569 100644 --- a/apps/web/src/components/forms/signin.tsx +++ b/apps/web/src/components/forms/signin.tsx @@ -199,9 +199,8 @@ export const SignInForm = ({ className }: SignInFormProps) => { size="lg" loading={isSubmitting} className="dark:bg-documenso dark:hover:opacity-90" - loadingText="Signing in..." > - Sign In + {isSubmitting ? 'Signing in...' : 'Sign In'}
@@ -275,8 +274,8 @@ export const SignInForm = ({ className }: SignInFormProps) => { {twoFactorAuthenticationMethod === 'totp' ? 'Use Backup Code' : 'Use Authenticator'} -
diff --git a/apps/web/src/components/forms/signup.tsx b/apps/web/src/components/forms/signup.tsx index 3988314c5..b91b4a9fd 100644 --- a/apps/web/src/components/forms/signup.tsx +++ b/apps/web/src/components/forms/signup.tsx @@ -162,10 +162,9 @@ export const SignUpForm = ({ className }: SignUpFormProps) => { type="submit" size="lg" loading={isSubmitting} - loadingText="Signing up..." className="dark:bg-documenso dark:hover:opacity-90" > - Sign Up + {isSubmitting ? 'Signing up...' : 'Sign Up'} diff --git a/packages/ui/primitives/button.tsx b/packages/ui/primitives/button.tsx index 9ee3324c6..5754b35a5 100644 --- a/packages/ui/primitives/button.tsx +++ b/packages/ui/primitives/button.tsx @@ -1,7 +1,8 @@ import * as React from 'react'; import { Slot } from '@radix-ui/react-slot'; -import { VariantProps, cva } from 'class-variance-authority'; +import type { VariantProps } from 'class-variance-authority'; +import { cva } from 'class-variance-authority'; import { Loader } from 'lucide-react'; import { cn } from '../lib/utils'; @@ -53,15 +54,10 @@ export interface ButtonProps * Will display the loading spinner and disable the button. */ loading?: boolean; - - /** - * The label to show in the button when `isLoading` is true - */ - loadingText?: string; } const Button = React.forwardRef( - ({ className, variant, size, asChild = false, loadingText, loading, ...props }, ref) => { + ({ className, variant, size, asChild = false, loading, ...props }, ref) => { if (asChild) { return ( @@ -79,7 +75,7 @@ const Button = React.forwardRef( disabled={isDisabled} > {isLoading && } - {isLoading && loadingText ? loadingText : props.children} + {props.children} ); },