Skip to content

Commit

Permalink
fix: Fix style order issue
Browse files Browse the repository at this point in the history
  • Loading branch information
wenty22 committed Aug 26, 2024
1 parent 05d1577 commit 14f67e0
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 44 deletions.
1 change: 1 addition & 0 deletions packages/walletkit/__dev__/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
binanceWeb3Wallet,
bitgetWallet,
coinbaseWallet,
EthereumScript,
evmConfig,
mathWallet,
metaMask,
Expand Down
16 changes: 6 additions & 10 deletions packages/walletkit/src/core/index.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
// evm
export * from '@/evm/components/EthereumScript';

// core
// utils
export * from '@/core/base/utils/mobile';
export * from '@/core/base/utils/css';

// providers
export { type BaseWallet } from '@/core/configs/types';
export * from '@/core/providers/WalletKitProvider';

export { type WalletKitConfig, useWalletKit } from '@/core/providers/WalletKitProvider/context';

export { type ColorMode } from '@/core/providers/ThemeProvider/context';
export { type Theme } from '@/core/providers/ThemeProvider';

// modals
export * from '@/core/modals/EmbeddedConnectModal';

export * from '@/core/modals/ConnectModal';
export { useConnectModal } from '@/core/modals/ConnectModal/context';

export { type ColorMode } from '@/core/providers/ThemeProvider/context';
export { type Theme } from '@/core/providers/ThemeProvider';

export * from '@/core/providers/WalletKitProvider';
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { SolanaConfig } from '@/solana/utils/solanaConfig';
import { BaseWallet } from '@/core/configs/types';
import { useEvmConnect } from '@/evm/hooks/useEvmConnect';
import { useConnectors } from 'wagmi';
import { toast } from '@/core/base/components/toast';

export type Action = 'add-network' | undefined;

Expand Down Expand Up @@ -113,6 +112,7 @@ export function useSelectedWallet() {
}

export function useWalletKit() {
const log = useLogger();
const { wallets, setWallets } = useContext(WalletKitContext);

const { connect } = useEvmConnect();
Expand All @@ -127,9 +127,7 @@ export function useWalletKit() {
const wallet = wallets.find((item) => item.id === walletId);

if (!wallet) {
toast.info({
description: 'Wallet not found',
});
log(`wallet not found, walletId: ${walletId}`);
} else {
const connector = connectors.find((item) => item.id === walletId);
if (connector && wallet.isInstalled())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import { ViewRoutes } from '@/core/modals/ConnectModal/RouteProvider';
import { useRouter } from '@/core/modals/ConnectModal/RouteProvider/context';
import {
useEventConfig,
useEvmConfig,
useLogger,
useSelectedWallet,
} from '@/core/providers/WalletKitProvider/context';
import { useEvmWallets } from '@/evm/hooks/useEvmWallets';
import { useWalletConnectModal } from '@/evm/hooks/useWalletConnectModal';
import { EvmWallet, isWalletConnect } from '@/evm/wallets';
import { useRef } from 'react';
Expand All @@ -34,7 +34,7 @@ export function SetEvmWalletClickRef(props: SetEvmWalletClickRefProps) {

const timerRef = useRef<any>();
const mobile = isMobile();
const { wallets } = useEvmWallets();
const { wallets } = useEvmConfig();

clickRef.current = (walletId: string, e: React.MouseEvent<Element, MouseEvent>) => {
const connector = connectors.find((item) => item.id === walletId)!;
Expand Down
10 changes: 0 additions & 10 deletions packages/walletkit/src/evm/hooks/useEvmWallets.ts

This file was deleted.

3 changes: 0 additions & 3 deletions packages/walletkit/src/evm/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,3 @@ export * from './components/EthereumScript';

// utils
export * from './utils/evmConfig';

// hooks
export * from './hooks/useEvmWallets';
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import {
useEventConfig,
useLogger,
useSelectedWallet,
useSolanaConfig,
} from '@/core/providers/WalletKitProvider/context';
import { useSolanaWallets } from '@/solana/hooks/useSolanaWallets';
import { SolanaWallet } from '@/solana/wallets';
import { useWallet } from '@solana/wallet-adapter-react';
import { useRef } from 'react';
Expand All @@ -23,7 +23,7 @@ export function SetSolanaWalletClickRef(props: SetSolanaWalletClickRefProps) {
const { setSelectedWallet } = useSelectedWallet();

const { disconnect } = useWallet();
const { wallets } = useSolanaWallets();
const { wallets } = useSolanaConfig();

const connectModal = useConnectModal();
const router = useRouter();
Expand Down
10 changes: 0 additions & 10 deletions packages/walletkit/src/solana/hooks/useSolanaWallets.ts

This file was deleted.

3 changes: 0 additions & 3 deletions packages/walletkit/src/solana/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,3 @@ export * from './utils/solanaConfig';

// wallets
export * from './wallets';

// hooks
export * from './hooks/useSolanaWallets';

0 comments on commit 14f67e0

Please sign in to comment.