mirror of https://github.com/certusone/oyster.git
fix: build issue
This commit is contained in:
parent
e960d1d19b
commit
9c92d884c4
|
@ -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<HTMLElement> {
|
||||
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'}
|
||||
</Button>;
|
||||
}
|
||||
|
||||
|
@ -38,7 +36,7 @@ export const ConnectButton = (
|
|||
onClick={connected ? onClick : connect}
|
||||
disabled={connected && disabled}
|
||||
overlay={menu}>
|
||||
{LABELS.CONNECT_LABEL}
|
||||
Connect
|
||||
</Dropdown.Button>
|
||||
);
|
||||
};
|
|
@ -1 +1,2 @@
|
|||
export { ExplorerLink } from './ExplorerLink/index';
|
||||
export { ConnectButton } from './ConnectButton/index';
|
||||
|
|
|
@ -41,6 +41,7 @@ export const WALLET_PROVIDERS = [
|
|||
export interface WalletAdapter extends EventEmitter {
|
||||
publicKey: PublicKey | null,
|
||||
signTransaction: (transaction: Transaction) => Promise<Transaction>;
|
||||
// signMultipleTransaction: (transaction: Transaction[]) => Promise<Transaction[]>;
|
||||
connect: () => any,
|
||||
disconnect: () => any,
|
||||
}
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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 = (
|
||||
<div className="App-Bar-right">
|
||||
{connected ? (
|
||||
<CurrentUserBadge />
|
||||
<div>
|
||||
{!connected && (
|
||||
<Button
|
||||
) : (
|
||||
<ConnectButton
|
||||
type="text"
|
||||
size="large"
|
||||
onClick={connected ? wallet?.disconnect : wallet?.connect}
|
||||
style={{ color: '#2abdd2' }}
|
||||
>
|
||||
{LABELS.CONNECT_BUTTON}
|
||||
</Button>
|
||||
allowWalletChange={true}
|
||||
style={{ color: "#2abdd2" }}/>
|
||||
)}
|
||||
{connected && (
|
||||
<Popover
|
||||
placement="bottomRight"
|
||||
title={LABELS.WALLET_TOOLTIP}
|
||||
trigger="click"
|
||||
></Popover>
|
||||
)}
|
||||
</div>
|
||||
<Popover
|
||||
placement="topRight"
|
||||
title={LABELS.SETTINGS_TOOLTIP}
|
||||
|
|
|
@ -11,14 +11,13 @@ import {
|
|||
LendingReserveParser,
|
||||
} from '../../models';
|
||||
import { Card } from 'antd';
|
||||
import { contexts, ParsedAccount } from '@oyster/common';
|
||||
import { contexts, ParsedAccount, ConnectButton } from '@oyster/common';
|
||||
|
||||
import { borrow } from '../../actions';
|
||||
import './style.less';
|
||||
import { LABELS } from '../../constants';
|
||||
import { ActionConfirmation } from './../ActionConfirmation';
|
||||
import { BackButton } from './../BackButton';
|
||||
import { ConnectButton } from '../ConnectButton';
|
||||
import CollateralInput from '../CollateralInput';
|
||||
import { useMidPriceInUSD } from '../../contexts/market';
|
||||
import { RiskSlider } from '../RiskSlider';
|
||||
|
|
|
@ -7,9 +7,8 @@ import { PublicKey } from '@solana/web3.js';
|
|||
import './style.less';
|
||||
import { ActionConfirmation } from './../ActionConfirmation';
|
||||
import { LABELS, marks } from '../../constants';
|
||||
import { ConnectButton } from '../ConnectButton';
|
||||
import CollateralInput from '../CollateralInput';
|
||||
import { contexts } from '@oyster/common';
|
||||
import { contexts, ConnectButton } from '@oyster/common';
|
||||
const { useWallet } = contexts.Wallet;
|
||||
const { useConnection } = contexts.Connection;
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ import Card from 'antd/lib/card';
|
|||
import React, { useCallback, useEffect } from 'react';
|
||||
import { useState } from 'react';
|
||||
import { LABELS, marks } from '../../constants';
|
||||
import { ParsedAccount, contexts, utils } from '@oyster/common';
|
||||
import { ParsedAccount, contexts, utils, ConnectButton } from '@oyster/common';
|
||||
import {
|
||||
EnrichedLendingObligation,
|
||||
InputType,
|
||||
|
@ -15,7 +15,6 @@ import { ActionConfirmation } from '../ActionConfirmation';
|
|||
import { liquidate } from '../../actions';
|
||||
import './style.less';
|
||||
import CollateralInput from '../CollateralInput';
|
||||
import { ConnectButton } from '../ConnectButton';
|
||||
import { useMidPriceInUSD } from '../../contexts/market';
|
||||
const { notify, fromLamports, wadToLamports } = utils;
|
||||
const { useConnection } = contexts.Connection;
|
||||
|
|
|
@ -7,12 +7,11 @@ import {
|
|||
} from '../../hooks';
|
||||
import { LendingReserve } from '../../models';
|
||||
import { Card, Slider } from 'antd';
|
||||
import { ParsedAccount, contexts, utils, hooks } from '@oyster/common';
|
||||
import { ParsedAccount, contexts, utils, hooks, ConnectButton } from '@oyster/common';
|
||||
import { repay } from '../../actions';
|
||||
import './style.less';
|
||||
import { LABELS, marks } from '../../constants';
|
||||
import { ActionConfirmation } from './../ActionConfirmation';
|
||||
import { ConnectButton } from '../ConnectButton';
|
||||
import CollateralInput from '../CollateralInput';
|
||||
import { useMidPriceInUSD } from '../../contexts/market';
|
||||
|
||||
|
|
|
@ -12,9 +12,8 @@ import { PublicKey } from '@solana/web3.js';
|
|||
import './style.less';
|
||||
import { LABELS, marks } from '../../constants';
|
||||
import { ActionConfirmation } from './../ActionConfirmation';
|
||||
import { ConnectButton } from '../ConnectButton';
|
||||
import CollateralInput from '../CollateralInput';
|
||||
import { contexts } from '@oyster/common';
|
||||
import { contexts, ConnectButton } from '@oyster/common';
|
||||
const { useConnection } = contexts.Connection;
|
||||
const { useWallet } = contexts.Wallet;
|
||||
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
import React, { useCallback } from 'react';
|
||||
import { Card } from 'antd';
|
||||
import { LAMPORTS_PER_SOL } from '@solana/web3.js';
|
||||
import { ConnectButton } from './../../components/ConnectButton';
|
||||
import { LABELS } from '../../constants';
|
||||
import { contexts, utils } from '@oyster/common';
|
||||
import { contexts, utils, ConnectButton } from '@oyster/common';
|
||||
const { useConnection } = contexts.Connection;
|
||||
const { useWallet } = contexts.Wallet;
|
||||
const { notify } = utils;
|
||||
|
|
Loading…
Reference in New Issue