-
- {focusedWallet && (
-
-
-
- {isActiveWalletPW && (
-
- {user?.user.username}.peanut.wallet
-
- )}
- {isActiveWalletBYOW && (
-
- {walletDetails.address}.peanut.wallet
-
- )}
-
-
+
+
+
+
+
+
+ {selectedWallet && (
+ {}}
+ index={0}
+ isBalanceHidden={isBalanceHidden}
+ onToggleBalanceVisibility={handleToggleBalanceVisibility}
+ />
)}
+
-
-
- $ {printableUsdc(walletDetails?.balance ?? 0n)}
-
-
-
-
-
+
+
)
diff --git a/src/components/0_Bruddle/Button.tsx b/src/components/0_Bruddle/Button.tsx
index da3b39a1..2728e201 100644
--- a/src/components/0_Bruddle/Button.tsx
+++ b/src/components/0_Bruddle/Button.tsx
@@ -2,7 +2,7 @@ import React, { forwardRef } from 'react'
import { twMerge } from 'tailwind-merge'
import Loading from '../Global/Loading'
-type ButtonVariant = 'purple' | 'dark' | 'stroke' | 'transparent-light' | 'transparent-dark' | 'green' | 'yellow'
+export type ButtonVariant = 'purple' | 'dark' | 'stroke' | 'transparent-light' | 'transparent-dark' | 'green' | 'yellow'
type ButtonSize = 'small' | 'medium' | 'large' | 'xl' | 'xl-fixed'
type ButtonShape = 'default' | 'square'
type ShadowSize = '4' | '6' | '8'
diff --git a/src/components/Dashboard/components/MobileComponent.tsx b/src/components/Dashboard/components/MobileComponent.tsx
index 39631a33..8f0206cd 100644
--- a/src/components/Dashboard/components/MobileComponent.tsx
+++ b/src/components/Dashboard/components/MobileComponent.tsx
@@ -17,7 +17,7 @@ export const MobileItemComponent = ({
return (
setModalVisible(true)}
>
@@ -54,7 +54,7 @@ export const MobileItemComponent = ({
{linkDetail.status === 'claimed' ? (
claimed
) : (
-
pending
+
pending
)}
diff --git a/src/components/Global/DirectionalActionButtons/index.tsx b/src/components/Global/DirectionalActionButtons/index.tsx
new file mode 100644
index 00000000..3a330ec4
--- /dev/null
+++ b/src/components/Global/DirectionalActionButtons/index.tsx
@@ -0,0 +1,65 @@
+import { ArrowIcon, Button, ButtonVariant } from '@/components/0_Bruddle'
+import Link from 'next/link'
+import { twMerge } from 'tailwind-merge'
+
+interface DirectionalActionButton {
+ title: string
+ href: string
+ disabled?: boolean
+}
+
+interface DirectionalActionButtonsProps {
+ leftButton?: DirectionalActionButton
+ rightButton?: DirectionalActionButton
+ variant?: ButtonVariant
+}
+
+const DirectionalActionButtons = ({
+ leftButton = {
+ title: 'Top up',
+ href: '/topup',
+ disabled: false,
+ },
+ rightButton = {
+ title: 'Cash out',
+ href: '/cashout',
+ disabled: false,
+ },
+ variant = 'purple',
+}: DirectionalActionButtonsProps) => {
+ return (
+
+
+
+
+
+
+
+
+
+ )
+}
+
+export default DirectionalActionButtons
diff --git a/src/components/Global/EmptyStates/NoDataEmptyState.tsx b/src/components/Global/EmptyStates/NoDataEmptyState.tsx
new file mode 100644
index 00000000..0d6b71e2
--- /dev/null
+++ b/src/components/Global/EmptyStates/NoDataEmptyState.tsx
@@ -0,0 +1,42 @@
+import PEANUTMAN_CRY from '@/animations/GIF_ALPHA_BACKGORUND/512X512_ALPHA_GIF_konradurban_05.gif'
+import Image from 'next/image'
+import { useMemo } from 'react'
+
+interface NoDataEmptyStateProps {
+ message: string
+ cta?: React.ReactNode
+ animSize?: 'sm' | 'md' | 'lg' | 'xl'
+}
+
+const NoDataEmptyState = ({ message, cta, animSize }: NoDataEmptyStateProps) => {
+ const getAnimSize = useMemo(() => {
+ switch (animSize) {
+ case 'sm':
+ return 96
+ case 'md':
+ return 128
+ case 'lg':
+ return 192
+ case 'xl':
+ return 256
+ default:
+ return 96
+ }
+ }, [animSize])
+
+ return (
+
+
+
{message}
+ {cta && cta}
+
+ )
+}
+
+export default NoDataEmptyState
diff --git a/src/components/Global/EmptyStates/index.ts b/src/components/Global/EmptyStates/index.ts
new file mode 100644
index 00000000..bf8128d8
--- /dev/null
+++ b/src/components/Global/EmptyStates/index.ts
@@ -0,0 +1 @@
+export * from './NoDataEmptyState'
diff --git a/src/components/Global/ListItemView/index.tsx b/src/components/Global/ListItemView/index.tsx
index 104a1935..33ff9e91 100644
--- a/src/components/Global/ListItemView/index.tsx
+++ b/src/components/Global/ListItemView/index.tsx
@@ -7,6 +7,7 @@ import { copyTextToClipboardWithFallback, getExplorerUrl } from '@/utils'
import Image from 'next/image'
import { useState } from 'react'
import { twMerge } from 'tailwind-merge'
+import Icon from '../Icon'
interface TokenBalance {
chainId: string
@@ -85,8 +86,10 @@ export const ListItemView = ({ id, variant, primaryInfo, secondaryInfo, metadata
onClick={() => isHistory && setModalVisible(true)}
>
- {metadata.tokenLogo && (
-
+ {!!metadata.tokenLogo ? (
+
+ ) : (
+
)}
{metadata.chainLogo && (
@@ -148,7 +151,8 @@ export const ListItemView = ({ id, variant, primaryInfo, secondaryInfo, metadata
transactionDetails?.status === 'pending' && (
{
- transactionDetails.link && window.open(transactionDetails?.link ?? '', '_blank')
+ transactionDetails.link &&
+ window.open(transactionDetails?.link ?? '', '_blank', 'noopener,noreferrer')
}}
className="flex h-12 w-full items-center gap-2 px-4 text-h8 text-sm font-bold transition-colors last:mb-0 hover:bg-n-3/10 disabled:cursor-not-allowed disabled:bg-n-4 disabled:hover:bg-n-4/90 dark:hover:bg-white/20"
>
@@ -175,7 +179,11 @@ export const ListItemView = ({ id, variant, primaryInfo, secondaryInfo, metadata
?.chainId ?? ''
const explorerUrl = getExplorerUrl(chainId)
- window.open(`${explorerUrl}/tx/${transactionDetails?.txHash ?? ''}`, '_blank')
+ window.open(
+ `${explorerUrl}/tx/${transactionDetails?.txHash ?? ''}`,
+ '_blank',
+ 'noopener,noreferrer'
+ )
}}
className="flex h-12 w-full items-center gap-2 px-4 text-h8 text-sm font-bold transition-colors last:mb-0 hover:bg-n-3/10 disabled:cursor-not-allowed disabled:bg-n-4 disabled:hover:bg-n-4/90 dark:hover:bg-white/20"
>
@@ -187,6 +195,7 @@ export const ListItemView = ({ id, variant, primaryInfo, secondaryInfo, metadata
href={transactionDetails.attachmentUrl}
download
target="_blank"
+ rel="noopener noreferrer"
className="flex h-12 w-full items-center gap-2 px-4 text-h8 text-sm font-bold transition-colors last:mb-0 hover:bg-n-3/10 disabled:cursor-not-allowed disabled:bg-n-4 disabled:hover:bg-n-4/90 dark:hover:bg-white/20"
>
Download attachment
diff --git a/src/utils/general.utils.ts b/src/utils/general.utils.ts
index cf778eb5..2ae24f0c 100644
--- a/src/utils/general.utils.ts
+++ b/src/utils/general.utils.ts
@@ -3,6 +3,7 @@ import * as interfaces from '@/interfaces'
import peanut from '@squirrel-labs/peanut-sdk'
import chroma from 'chroma-js'
import { ethers } from 'ethers'
+import * as wagmiChains from 'wagmi/chains'
export function urlBase64ToUint8Array(base64String: string) {
const padding = '='.repeat((4 - (base64String.length % 4)) % 4)
@@ -1064,3 +1065,8 @@ export async function fetchTokenSymbol(tokenAddress: string, chainId: string): P
}
return tokenSymbol
}
+
+export function getChainName(chainId: string): string | undefined {
+ const chain = Object.entries(wagmiChains).find(([, chain]) => chain.id === Number(chainId))?.[1]
+ return chain?.name ?? undefined
+}