From 47564c99f2d8237f8fb78f837544584577ebaeec Mon Sep 17 00:00:00 2001 From: Sasi Date: Sun, 25 Feb 2024 23:53:16 +0530 Subject: [PATCH 1/2] Add type definition for Props in Signup component --- apps/web/src/components/Login/Signup.tsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/apps/web/src/components/Login/Signup.tsx b/apps/web/src/components/Login/Signup.tsx index db8321201..b2a0cf3b2 100644 --- a/apps/web/src/components/Login/Signup.tsx +++ b/apps/web/src/components/Login/Signup.tsx @@ -31,6 +31,7 @@ import { } from '@tape.xyz/ui' import Link from 'next/link' import Script from 'next/script' +import type { FC } from 'react' import React, { useEffect, useState } from 'react' import { useForm } from 'react-hook-form' import toast from 'react-hot-toast' @@ -55,6 +56,12 @@ declare global { } } +type Props = { + showLogin: boolean + onSuccess: () => void + setShowSignup: (b: boolean) => void +} + const formSchema = object({ handle: string() .min(5, { message: 'Handle should be at least 5 characters' }) @@ -66,15 +73,7 @@ const formSchema = object({ }) type FormData = z.infer -const Signup = ({ - showLogin, - onSuccess, - setShowSignup -}: { - showLogin: boolean - onSuccess: () => void - setShowSignup: (b: boolean) => void -}) => { +const Signup: FC = ({ showLogin, onSuccess, setShowSignup }) => { const { register, formState: { errors, isValid }, @@ -92,6 +91,7 @@ const Signup = ({ const { address } = useAccount() const handle = watch('handle')?.toLowerCase() + const debouncedValue = useDebounce(handle, 300) const { data: balanceData } = useBalance({ address, From 485700d244a702f99434615b11f51880e476a0ef Mon Sep 17 00:00:00 2001 From: Sasi Date: Sun, 25 Feb 2024 23:57:04 +0530 Subject: [PATCH 2/2] Fix typo in Signup component description --- apps/web/src/components/Login/Signup.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/web/src/components/Login/Signup.tsx b/apps/web/src/components/Login/Signup.tsx index b2a0cf3b2..522913ade 100644 --- a/apps/web/src/components/Login/Signup.tsx +++ b/apps/web/src/components/Login/Signup.tsx @@ -305,7 +305,7 @@ const Signup: FC = ({ showLogin, onSuccess, setShowSignup }) => { show={showModal} setShow={setShowModal} title="Why purchase?" - description="Creating new handle requires a purchase to help maintain the network and prevent bots. Rest assured, the associated price is a short-term measure. As the platform implements and refines additional bot prevention methods, the price will be gradually phased out." + description="Creating new handle requires a purchase to help maintain the network and prevent bots. Rest assured, the associated price is a short-term measure. As we implements and refines additional bot prevention methods, the price will be gradually phased out." > {!hasBalance && (
@@ -321,7 +321,7 @@ const Signup: FC = ({ showLogin, onSuccess, setShowSignup }) => {