Skip to content

Commit

Permalink
playground update
Browse files Browse the repository at this point in the history
  • Loading branch information
brendan-defi committed Dec 13, 2024
1 parent b24c438 commit 9b240e7
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 28 deletions.
47 changes: 25 additions & 22 deletions playground/nextjs-app-router/components/demo/Wallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { color } from '@coinbase/onchainkit/theme';
import {
ConnectWallet,
Wallet,
WalletBasic,
WalletDropdown,
WalletDropdownBasename,
WalletDropdownDisconnect,
Expand All @@ -24,29 +25,31 @@ function WalletComponent() {
return (
<div className="flex justify-end">
<Wallet>
<ConnectWallet text="Connect Wallet">
<Avatar address={address} className="h-6 w-6" />
<Name />
</ConnectWallet>
<WalletDropdown>
<Identity className="px-4 pt-3 pb-2">
<Avatar />
<WalletBasic>
<ConnectWallet text="Connect Wallet">
<Avatar address={address} className="h-6 w-6" />
<Name />
<Address className={color.foregroundMuted} />
<EthBalance />
<Socials />
</Identity>
<WalletDropdownBasename />
<WalletDropdownLink
icon="wallet"
href="https://keys.coinbase.com"
target="_blank"
>
Wallet
</WalletDropdownLink>
<WalletDropdownFundLink />
<WalletDropdownDisconnect />
</WalletDropdown>
</ConnectWallet>
<WalletDropdown>
<Identity className="px-4 pt-3 pb-2">
<Avatar />
<Name />
<Address className={color.foregroundMuted} />
<EthBalance />
<Socials />
</Identity>
<WalletDropdownBasename />
<WalletDropdownLink
icon="wallet"
href="https://keys.coinbase.com"
target="_blank"
>
Wallet
</WalletDropdownLink>
<WalletDropdownFundLink />
<WalletDropdownDisconnect />
</WalletDropdown>
</WalletBasic>
</Wallet>
</div>
);
Expand Down
6 changes: 2 additions & 4 deletions src/wallet/components/WalletDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { useWalletContext } from './WalletProvider';
export function WalletDropdown({ children, className }: WalletDropdownReact) {
const breakpoint = useBreakpoints();
const { address } = useAccount();
const { isOpen, isClosing } = useWalletContext();
const { isClosing } = useWalletContext();

const childrenArray = useMemo(() => {
return Children.toArray(children).map((child) => {
Expand Down Expand Up @@ -42,9 +42,7 @@ export function WalletDropdown({ children, className }: WalletDropdownReact) {
pressable.default,
color.foreground,
'absolute right-0 z-10 mt-1 flex w-max min-w-[300px] cursor-default flex-col overflow-hidden rounded-xl',
isClosing || !isOpen
? 'animate-walletContainerOut'
: 'animate-walletContainerIn',
isClosing ? 'animate-walletContainerOut' : 'animate-walletContainerIn',
className,
)}
data-testid="ockWalletDropdown"
Expand Down
2 changes: 0 additions & 2 deletions src/wallet/components/WalletProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ export function WalletProvider({ children }: WalletProviderReact) {
const { address } = useAccount();
const containerRef = useRef<HTMLDivElement>(null);

console.log({ isOpen, isClosing, containerRef });

const handleClose = useCallback(() => {
setIsClosing(true);
setTimeout(() => {
Expand Down

0 comments on commit 9b240e7

Please sign in to comment.