Skip to content

Commit

Permalink
feat: add bnb chain in mail app
Browse files Browse the repository at this point in the history
  • Loading branch information
Siddesh7 committed Nov 21, 2024
1 parent b1b6df7 commit b02ad4c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 4 additions & 1 deletion examples/email-app/src/components/connected-wallet-info.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TokenETH, TokenPUSH, TokenSOL } from '@web3icons/react';
import { TokenBNB, TokenETH, TokenPUSH, TokenSOL } from '@web3icons/react';
import { usePrivy } from '@privy-io/react-auth';
import { trimAddress } from '@/lib/utils';
import { useAppContext } from '@/context/app-context';
Expand All @@ -15,6 +15,7 @@ const ConnectedWalletInfo = () => {
}
setSelectedEmail(null);
};

return (
<div className="flex flex-row gap-2 items-center">
{(pushAccount || authenticated) && (
Expand All @@ -28,6 +29,8 @@ const ConnectedWalletInfo = () => {
<TokenPUSH className="w-6 h-6" />
) : user?.wallet?.chainType === 'solana' ? (
<TokenSOL className="w-6 h-6" />
) : user?.wallet?.chainId === 'eip155:56' ? (
<TokenBNB className="w-6 h-6" />
) : (
<TokenETH className="w-6 h-6" />
)}
Expand Down
9 changes: 8 additions & 1 deletion examples/email-app/src/components/new-email.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
import { useAppContext } from '@/context/app-context';
import { usePrivy, useSolanaWallets } from '@privy-io/react-auth';
import { useSignMessage } from 'wagmi';
import { TokenETH, TokenPUSH, TokenSOL } from '@web3icons/react';
import { TokenBNB, TokenETH, TokenPUSH, TokenSOL } from '@web3icons/react';
import { hexToBytes } from 'viem';
import { IEmail } from '@/types';
import { X } from 'lucide-react';
Expand Down Expand Up @@ -164,6 +164,8 @@ ${email.body
? 'eip155:1'
: recipient.chain === 'sol'
? 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp'
: recipient.chain === 'bnb'
? 'eip155:56'
: 'push:devnet'
}:${recipient.address}`
);
Expand Down Expand Up @@ -252,6 +254,8 @@ ${email.body
<TokenETH className="w-6 h-6" />
) : recipient.chain === 'sol' ? (
<TokenSOL className="w-6 h-6" />
) : recipient.chain === 'bnb' ? (
<TokenBNB className="w-6 h-6" />
) : (
<TokenPUSH className="w-6 h-6" />
)}
Expand Down Expand Up @@ -289,6 +293,9 @@ ${email.body
<SelectItem value="push">
<TokenPUSH className="w-6 h-6" />
</SelectItem>
<SelectItem value="bnb">
<TokenBNB className="w-6 h-6" />
</SelectItem>
</SelectContent>
</Select>
<Input
Expand Down

0 comments on commit b02ad4c

Please sign in to comment.