From b3a0522d7feea6de65463a18be89708c2597d6b6 Mon Sep 17 00:00:00 2001 From: Leszek Stachowski Date: Thu, 3 Oct 2024 13:05:12 +0200 Subject: [PATCH] resolve TODOs + typos --- .../delegation/DelegateRegistrationForm.tsx | 24 +++++++++++-------- src/features/delegation/utils.ts | 1 - 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/features/delegation/DelegateRegistrationForm.tsx b/src/features/delegation/DelegateRegistrationForm.tsx index 7ed784e..51b8a6b 100644 --- a/src/features/delegation/DelegateRegistrationForm.tsx +++ b/src/features/delegation/DelegateRegistrationForm.tsx @@ -14,15 +14,15 @@ import { import { validateRegistrationRequest } from 'src/features/delegation/validateRegistrationRequest'; import { useAccount } from 'wagmi'; -// TODO remove default values -// @ts-ignore TODO fix this const initialValues: RegisterDelegateFormValues = { - name: 'name', - description: 'description', - twitterUrl: 'https://x.com/celo', + address: '0x', + name: '', + description: '', + twitterUrl: '', websiteUrl: '', - interests: 'some, interests', - verificationUrl: 'https://x.com/verification-url', + interests: '', + verificationUrl: '', + image: null, }; export function DelegateRegistrationForm({ @@ -39,6 +39,7 @@ export function DelegateRegistrationForm({ const validate = async (values: RegisterDelegateFormValues, image: File | null) => { return await validateRegistrationRequest({ ...values, + address: address!, image, }); }; @@ -62,7 +63,7 @@ export function DelegateRegistrationForm({ return ( <>

- Your delegate registration has been submitted successfully and a{' '} + Your delegatee registration has been submitted successfully and a{' '} pull request {' '} @@ -83,7 +84,10 @@ export function DelegateRegistrationForm({ setIsSubmitting(true); setIsSigning(true); - const signature = await signForm(values); + const signature = await signForm({ + ...values, + address: address! + }); setIsSigning(false); @@ -221,7 +225,7 @@ export function DelegateRegistrationForm({

{errors.verificationUrl}

)}

- Provide a URL to proof authenticity of your delegate registration, it can be a link + Provide a URL to proof authenticity of your delegatee registration, it can be a link to a tweet, a forum post etc.

diff --git a/src/features/delegation/utils.ts b/src/features/delegation/utils.ts index 72193b5..149414f 100644 --- a/src/features/delegation/utils.ts +++ b/src/features/delegation/utils.ts @@ -121,7 +121,6 @@ export async function createDelegationPR(request: RegisterDelegateRequest) { repo: GITHUB_REPO_NAME, head: branchName, base: 'main', - // TODO escape the name title: `Adding delegate ${request.name}`, body: `Adding delegate \`${request.name}\` with address [${request.address}](https://celoscan.io/address/${request.address}).