diff --git a/packages/lending/src/components/ConnectButton/index.tsx b/packages/common/src/components/ConnectButton/index.tsx similarity index 82% rename from packages/lending/src/components/ConnectButton/index.tsx rename to packages/common/src/components/ConnectButton/index.tsx index 97d8ef7..6a0d15c 100644 --- a/packages/lending/src/components/ConnectButton/index.tsx +++ b/packages/common/src/components/ConnectButton/index.tsx @@ -1,9 +1,7 @@ import { Button, Dropdown, Menu } from "antd"; import { ButtonProps } from "antd/lib/button"; import React from "react"; -import { LABELS } from "../../constants"; -import { contexts } from '@oyster/common'; -const { useWallet } = contexts.Wallet; +import { useWallet } from './../../contexts/wallet'; export interface ConnectButtonProps extends ButtonProps, React.RefAttributes { allowWalletChange?: boolean; @@ -29,7 +27,7 @@ export const ConnectButton = ( onClick={connected ? onClick : connect} disabled={connected && disabled} > - {connected ? props.children : LABELS.CONNECT_LABEL} + {connected ? props.children : 'Connect'} ; } @@ -38,7 +36,7 @@ export const ConnectButton = ( onClick={connected ? onClick : connect} disabled={connected && disabled} overlay={menu}> - {LABELS.CONNECT_LABEL} + Connect ); }; diff --git a/packages/common/src/components/index.tsx b/packages/common/src/components/index.tsx index 731438b..0038ed5 100644 --- a/packages/common/src/components/index.tsx +++ b/packages/common/src/components/index.tsx @@ -1 +1,2 @@ export { ExplorerLink } from './ExplorerLink/index'; +export { ConnectButton } from './ConnectButton/index'; diff --git a/packages/common/src/contexts/wallet.tsx b/packages/common/src/contexts/wallet.tsx index 93a2f12..6e7d1f5 100644 --- a/packages/common/src/contexts/wallet.tsx +++ b/packages/common/src/contexts/wallet.tsx @@ -41,6 +41,7 @@ export const WALLET_PROVIDERS = [ export interface WalletAdapter extends EventEmitter { publicKey: PublicKey | null, signTransaction: (transaction: Transaction) => Promise; + // signMultipleTransaction: (transaction: Transaction[]) => Promise; connect: () => any, disconnect: () => any, } diff --git a/packages/common/src/index.tsx b/packages/common/src/index.tsx index 4c23c1d..c08601d 100644 --- a/packages/common/src/index.tsx +++ b/packages/common/src/index.tsx @@ -1,5 +1,5 @@ export * as actions from './actions'; -export * as components from './components'; +export * from './components'; export * as config from './config'; export * as constants from './constants'; export * as hooks from './hooks'; diff --git a/packages/lending/src/components/AppBar/index.tsx b/packages/lending/src/components/AppBar/index.tsx index 9e0705c..1132459 100644 --- a/packages/lending/src/components/AppBar/index.tsx +++ b/packages/lending/src/components/AppBar/index.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { Button, Popover } from 'antd'; -import { contexts } from '@oyster/common'; +import { contexts, ConnectButton } from '@oyster/common'; import { CurrentUserBadge } from '../CurrentUserBadge'; import { SettingOutlined } from '@ant-design/icons'; import { Settings } from '../Settings'; @@ -12,26 +12,15 @@ export const AppBar = (props: { left?: JSX.Element; right?: JSX.Element }) => { const TopBar = (
- -
- {!connected && ( - - )} - {connected && ( - - )} -
+ allowWalletChange={true} + style={{ color: "#2abdd2" }}/> + )}