Fixed: Register page shows Button with Sign In instead of Sign Up

This commit is contained in:
Diwash 2023-09-29 09:16:56 +05:45
parent 651f984e52
commit d45ab66865
2 changed files with 12 additions and 4 deletions

View file

@ -34,7 +34,7 @@ export default function RegisterPage() {
Enter your email below to create your account
</p>
</div>
<UserAuthForm />
<UserAuthForm option="register" />
<p className="px-8 text-center text-sm text-muted-foreground">
By clicking continue, you agree to our{" "}
<Link

View file

@ -15,11 +15,17 @@ import { Label } from "@/components/ui/label"
import { toast } from "@/components/ui/use-toast"
import { Icons } from "@/components/icons"
interface UserAuthFormProps extends React.HTMLAttributes<HTMLDivElement> {}
interface UserAuthFormProps extends React.HTMLAttributes<HTMLDivElement> {
option?: string
}
type FormData = z.infer<typeof userAuthSchema>
export function UserAuthForm({ className, ...props }: UserAuthFormProps) {
export function UserAuthForm({
className,
option,
...props
}: UserAuthFormProps) {
const {
register,
handleSubmit,
@ -84,7 +90,9 @@ export function UserAuthForm({ className, ...props }: UserAuthFormProps) {
{isLoading && (
<Icons.spinner className="mr-2 h-4 w-4 animate-spin" />
)}
Sign In with Email
{option === "register"
? "Sign Up with Email"
: "Sign In with Email"}
</button>
</div>
</form>