Skip to content

Commit

Permalink
feat: export StatefulConnect components and helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
yeager-eren committed Aug 28, 2024
1 parent aa1bc80 commit c28a94b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export { StatefulConnectModal } from './StatefulConnectModal';
export { isOnNamespace, isOnDerivationPath } from './helpers';
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,14 @@ export function reducer(state: State, action: Actions): State {
case 'reset':
return initState;
case 'resetDerivation':
return {
...state,
derivationPath: null,
status: 'namespace',
};
if (state.namespace) {
return {
...state,
derivationPath: null,
status: 'namespace',
};
}
return initState;
default:
throw new Error(`Action hasn't been defined.`);
}
Expand Down
12 changes: 12 additions & 0 deletions widget/embedded/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ import { useWallets, Events as WalletEvents } from '@rango-dev/wallets-react';
import { Networks, WalletTypes } from '@rango-dev/wallets-shared';
import { PendingSwapNetworkStatus } from 'rango-types';

import {
isOnDerivationPath,
isOnNamespace,
} from './components/StatefulConnectModal';
import { DerivationPath, Namespaces } from './components/WalletStatefulConnect';
import { WIDGET_UI_ID as UI_ID } from './constants';
import { SUPPORTED_FONTS } from './constants/fonts';
import { WidgetWallets } from './containers/Wallets';
Expand All @@ -76,6 +81,13 @@ import {
} from './types';
import { customizedThemeTokens } from './utils/ui';

export const StatefulConnect = {
DerivationPath,
Namespaces,
isOnDerivationPath,
isOnNamespace,
};

export type {
WidgetConfig,
WalletType,
Expand Down

0 comments on commit c28a94b

Please sign in to comment.