From f58214bfcdca602d1b258e16eaf62183eb96b661 Mon Sep 17 00:00:00 2001 From: Nezzar KEFIF <36443340+nezz0746@users.noreply.github.com> Date: Wed, 2 Oct 2024 08:36:31 +0200 Subject: [PATCH 1/8] fix: .find callback breaking at address casing --- .../Request/Pay/Views/Initial.view.tsx | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/components/Request/Pay/Views/Initial.view.tsx b/src/components/Request/Pay/Views/Initial.view.tsx index ade8118f..78f821e4 100644 --- a/src/components/Request/Pay/Views/Initial.view.tsx +++ b/src/components/Request/Pay/Views/Initial.view.tsx @@ -194,6 +194,12 @@ export const InitialView = ({ } } + const chainDetails = consts.peanutTokenDetails.find((chain) => chain.chainId === requestLinkData.chainId) + + const tokenRequestedLogoURI = chainDetails?.tokens.find((token) => + utils.compareTokenAddresses(token.address, requestLinkData.tokenAddress) + )?.logoURI + return (
{(requestLinkData.reference || requestLinkData.attachmentUrl) && ( @@ -240,16 +246,7 @@ export const InitialView = ({
- chain.chainId === requestLinkData.chainId) - ?.tokens.find((token) => token.address === requestLinkData.tokenAddress) - ?.logoURI - } - className="absolute left-0 top-0 h-6 w-6" - alt="logo" - /> + logo Date: Wed, 2 Oct 2024 09:06:41 +0200 Subject: [PATCH 2/8] fix: make return button go back to home screen when on first step --- src/components/Request/Create/Create.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/Request/Create/Create.tsx b/src/components/Request/Create/Create.tsx index 2064c386..518b390d 100644 --- a/src/components/Request/Create/Create.tsx +++ b/src/components/Request/Create/Create.tsx @@ -4,8 +4,10 @@ import { createElement, useEffect, useState } from 'react' import * as _consts from './Create.consts' import { IAttachmentOptions } from '@/components/Create/Create.consts' import { useAccount } from 'wagmi' +import { useRouter } from 'next/navigation' export const CreateRequestLink = () => { + const router = useRouter() const [step, setStep] = useState<_consts.ICreateScreenState>(_consts.INIT_VIEW_STATE) const [tokenValue, setTokenValue] = useState(undefined) const [usdValue, setUsdValue] = useState(undefined) @@ -29,7 +31,9 @@ export const CreateRequestLink = () => { } const handleOnPrev = () => { - if (step.idx === 0) return + if (step.idx === 0) { + return router.push('/') + } const newIdx = step.idx - 1 setStep(() => ({ screen: _consts.CREATE_SCREEN_FLOW[newIdx], From 5f45a99de8d0046bfb92cc4f7c65735c58c4c7ef Mon Sep 17 00:00:00 2001 From: Nezzar KEFIF <36443340+nezz0746@users.noreply.github.com> Date: Wed, 2 Oct 2024 10:07:42 +0200 Subject: [PATCH 3/8] fix: make NO KYC badge clickable --- src/components/Profile/index.tsx | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/components/Profile/index.tsx b/src/components/Profile/index.tsx index b8678641..8e96e327 100644 --- a/src/components/Profile/index.tsx +++ b/src/components/Profile/index.tsx @@ -1,9 +1,9 @@ 'use client' + import Icon from '../Global/Icon' import * as consts from '@/constants' import { createAvatar } from '@dicebear/core' import { identicon } from '@dicebear/collection' -import MoreInfo from '../Global/MoreInfo' import * as components from './Components' import { useContext, useEffect, useRef, useState } from 'react' import { Divider, ToastId, useToast } from '@chakra-ui/react' @@ -16,11 +16,10 @@ import Modal from '../Global/Modal' import { useAuth } from '@/context/authContext' import ImageEdit from '../Global/ImageEdit' import TextEdit from '../Global/TextEdit' -import IframeWrapper from '../Global/IframeWrapper' import Link from 'next/link' import * as context from '@/context' import Loading from '../Global/Loading' -import peanut, { generateKeysFromString } from '@squirrel-labs/peanut-sdk' + const tabs = [ { title: 'History', @@ -396,9 +395,15 @@ export const Profile = () => { {user?.user?.email}
- {user?.user?.kycStatus === 'verified' ? 'KYC' : 'NO KYC'} + {user?.user?.kycStatus === 'verified' ? ( + 'KYC' + ) : ( + + NO KYC + + )}
From 68dba2f8b27d872d96a34e1b8e657931c35b17d8 Mon Sep 17 00:00:00 2001 From: Nezzar KEFIF <36443340+nezz0746@users.noreply.github.com> Date: Wed, 2 Oct 2024 11:42:41 +0200 Subject: [PATCH 4/8] fix: show user truncated address in profile and propose to KYC & sign-in if no email --- src/components/Kyc/index.tsx | 2 +- src/components/Profile/index.tsx | 33 ++++++++++++++++---------------- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/src/components/Kyc/index.tsx b/src/components/Kyc/index.tsx index 76e80b54..89e5e803 100644 --- a/src/components/Kyc/index.tsx +++ b/src/components/Kyc/index.tsx @@ -68,7 +68,7 @@ export const KYCComponent = () => {
) : ( { }} /> - {user?.user?.email && ( - - {user?.user?.email} -
-
- {user?.user?.kycStatus === 'verified' ? ( - 'KYC' - ) : ( - - NO KYC - - )} -
+ + {user?.user?.email ?? + utils.shortenAddressLong(user.accounts[0].account_identifier)} +
+
+ {user?.user?.kycStatus === 'verified' ? ( + 'KYC' + ) : ( + + NO KYC + + )}
- - )} +
+