diff --git a/src/components/Claim/Link/Onchain/Success.view.tsx b/src/components/Claim/Link/Onchain/Success.view.tsx index 19447b4fd..63cfa3e51 100644 --- a/src/components/Claim/Link/Onchain/Success.view.tsx +++ b/src/components/Claim/Link/Onchain/Success.view.tsx @@ -14,6 +14,9 @@ import { useEffect, useMemo } from 'react' import type { Hash } from 'viem' import { formatUnits } from 'viem' import * as _consts from '../../Claim.consts' +import Image from 'next/image' +import { PEANUT_LOGO_BLACK, PEANUTMAN_LOGO } from '@/assets' +import CreateAccountButton from '@/components/Global/CreateAccountButton' export const SuccessClaimLinkView = ({ transactionHash, @@ -129,11 +132,7 @@ export const SuccessClaimLinkView = ({ ) } - return ( - router.push('/setup')} shadowSize="4"> - Create Account - - ) + return router.push('/setup')} /> } return ( diff --git a/src/components/Global/CreateAccountButton/index.tsx b/src/components/Global/CreateAccountButton/index.tsx new file mode 100644 index 000000000..f367ad66d --- /dev/null +++ b/src/components/Global/CreateAccountButton/index.tsx @@ -0,0 +1,25 @@ +'use client' + +import { PEANUT_LOGO_BLACK, PEANUTMAN_LOGO } from '@/assets' +import { Button } from '@/components/0_Bruddle' +import Image from 'next/image' +import React from 'react' + +interface CreateAccountButtonProps { + onClick: () => void +} + +const CreateAccountButton = ({ onClick }: CreateAccountButtonProps) => { + return ( + + Create a + + + + + account + + ) +} + +export default CreateAccountButton diff --git a/src/components/Payment/Views/Status.payment.view.tsx b/src/components/Payment/Views/Status.payment.view.tsx index 072280be1..5e3353da2 100644 --- a/src/components/Payment/Views/Status.payment.view.tsx +++ b/src/components/Payment/Views/Status.payment.view.tsx @@ -1,7 +1,9 @@ 'use client' +import { PEANUT_LOGO_BLACK, PEANUTMAN_LOGO } from '@/assets' import { Button } from '@/components/0_Bruddle' import AddressLink from '@/components/Global/AddressLink' import Card from '@/components/Global/Card' +import CreateAccountButton from '@/components/Global/CreateAccountButton' import { Icon } from '@/components/Global/Icons/Icon' import NavHeader from '@/components/Global/NavHeader' import { SoundPlayer } from '@/components/Global/SoundPlayer' @@ -18,6 +20,7 @@ import { paymentActions } from '@/redux/slices/payment-slice' import { ApiUser } from '@/services/users' import { formatAmount, getInitialsFromName, printableAddress } from '@/utils' import { useQueryClient } from '@tanstack/react-query' +import Image from 'next/image' import { useRouter } from 'next/navigation' import { ReactNode, useEffect, useMemo } from 'react' import { useDispatch } from 'react-redux' @@ -230,9 +233,7 @@ const DirectSuccessView = ({ Back to home ) : ( - router.push('/setup')} shadowSize="4"> - Create Account - + router.push('/setup')} /> )} {type === 'SEND' && !isExternalWalletFlow && !isWithdrawFlow && ( (null) const [isTokenDataLoading, setIsTokenDataLoading] = useState(true) const { setIsSupportModalOpen } = useSupportModalContext() + const router = useRouter() useEffect(() => { setIsModalOpen?.(showCancelLinkModal) @@ -278,6 +282,16 @@ export const TransactionDetailsReceipt = ({ } } + // Show profile button only if txn is completed, not to/by a guest user and its a send/request/receive txn + const showUserProfileButton = + !!transaction && + transaction.status === 'completed' && + !!transaction.userName && + !isAddress(transaction.userName) && + (transaction.extraDataForDrawer?.transactionCardType === 'send' || + transaction.extraDataForDrawer?.transactionCardType === 'request' || + transaction.extraDataForDrawer?.transactionCardType === 'receive') + return ( {/* show qr code at the top if applicable */} @@ -911,6 +925,22 @@ export const TransactionDetailsReceipt = ({ )} + {showUserProfileButton && ( + + router.push(`/${transaction.userName}`)} + shadowSize="4" + variant={ + transaction.extraDataForDrawer?.transactionCardType === 'request' + ? 'purple' + : 'primary-soft' + } + className="flex w-full items-center gap-1" + > + Go to {transaction.userName} profile + + + )} {/* Cancel deposit button for bridge_onramp transactions in awaiting_funds state */} {transaction.direction === 'bank_deposit' && transaction.extraDataForDrawer?.originalType !== EHistoryEntryType.REQUEST &&