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 { Button, Dropdown, Menu } from "antd";
|
||||||
import { ButtonProps } from "antd/lib/button";
|
import { ButtonProps } from "antd/lib/button";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { LABELS } from "../../constants";
|
import { useWallet } from './../../contexts/wallet';
|
||||||
import { contexts } from '@oyster/common';
|
|
||||||
const { useWallet } = contexts.Wallet;
|
|
||||||
|
|
||||||
export interface ConnectButtonProps extends ButtonProps, React.RefAttributes<HTMLElement> {
|
export interface ConnectButtonProps extends ButtonProps, React.RefAttributes<HTMLElement> {
|
||||||
allowWalletChange?: boolean;
|
allowWalletChange?: boolean;
|
||||||
|
@ -29,7 +27,7 @@ export const ConnectButton = (
|
||||||
onClick={connected ? onClick : connect}
|
onClick={connected ? onClick : connect}
|
||||||
disabled={connected && disabled}
|
disabled={connected && disabled}
|
||||||
>
|
>
|
||||||
{connected ? props.children : LABELS.CONNECT_LABEL}
|
{connected ? props.children : 'Connect'}
|
||||||
</Button>;
|
</Button>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,7 +36,7 @@ export const ConnectButton = (
|
||||||
onClick={connected ? onClick : connect}
|
onClick={connected ? onClick : connect}
|
||||||
disabled={connected && disabled}
|
disabled={connected && disabled}
|
||||||
overlay={menu}>
|
overlay={menu}>
|
||||||
{LABELS.CONNECT_LABEL}
|
Connect
|
||||||
</Dropdown.Button>
|
</Dropdown.Button>
|
||||||
);
|
);
|
||||||
};
|
};
|
|
@ -1 +1,2 @@
|
||||||
export { ExplorerLink } from './ExplorerLink/index';
|
export { ExplorerLink } from './ExplorerLink/index';
|
||||||
|
export { ConnectButton } from './ConnectButton/index';
|
||||||
|
|
|
@ -41,6 +41,7 @@ export const WALLET_PROVIDERS = [
|
||||||
export interface WalletAdapter extends EventEmitter {
|
export interface WalletAdapter extends EventEmitter {
|
||||||
publicKey: PublicKey | null,
|
publicKey: PublicKey | null,
|
||||||
signTransaction: (transaction: Transaction) => Promise<Transaction>;
|
signTransaction: (transaction: Transaction) => Promise<Transaction>;
|
||||||
|
// signMultipleTransaction: (transaction: Transaction[]) => Promise<Transaction[]>;
|
||||||
connect: () => any,
|
connect: () => any,
|
||||||
disconnect: () => any,
|
disconnect: () => any,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
export * as actions from './actions';
|
export * as actions from './actions';
|
||||||
export * as components from './components';
|
export * from './components';
|
||||||
export * as config from './config';
|
export * as config from './config';
|
||||||
export * as constants from './constants';
|
export * as constants from './constants';
|
||||||
export * as hooks from './hooks';
|
export * as hooks from './hooks';
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Button, Popover } from 'antd';
|
import { Button, Popover } from 'antd';
|
||||||
import { contexts } from '@oyster/common';
|
import { contexts, ConnectButton } from '@oyster/common';
|
||||||
import { CurrentUserBadge } from '../CurrentUserBadge';
|
import { CurrentUserBadge } from '../CurrentUserBadge';
|
||||||
import { SettingOutlined } from '@ant-design/icons';
|
import { SettingOutlined } from '@ant-design/icons';
|
||||||
import { Settings } from '../Settings';
|
import { Settings } from '../Settings';
|
||||||
|
@ -12,26 +12,15 @@ export const AppBar = (props: { left?: JSX.Element; right?: JSX.Element }) => {
|
||||||
|
|
||||||
const TopBar = (
|
const TopBar = (
|
||||||
<div className="App-Bar-right">
|
<div className="App-Bar-right">
|
||||||
<CurrentUserBadge />
|
{connected ? (
|
||||||
<div>
|
<CurrentUserBadge />
|
||||||
{!connected && (
|
) : (
|
||||||
<Button
|
<ConnectButton
|
||||||
type="text"
|
type="text"
|
||||||
size="large"
|
size="large"
|
||||||
onClick={connected ? wallet?.disconnect : wallet?.connect}
|
allowWalletChange={true}
|
||||||
style={{ color: '#2abdd2' }}
|
style={{ color: "#2abdd2" }}/>
|
||||||
>
|
)}
|
||||||
{LABELS.CONNECT_BUTTON}
|
|
||||||
</Button>
|
|
||||||
)}
|
|
||||||
{connected && (
|
|
||||||
<Popover
|
|
||||||
placement="bottomRight"
|
|
||||||
title={LABELS.WALLET_TOOLTIP}
|
|
||||||
trigger="click"
|
|
||||||
></Popover>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
<Popover
|
<Popover
|
||||||
placement="topRight"
|
placement="topRight"
|
||||||
title={LABELS.SETTINGS_TOOLTIP}
|
title={LABELS.SETTINGS_TOOLTIP}
|
||||||
|
|
|
@ -11,14 +11,13 @@ import {
|
||||||
LendingReserveParser,
|
LendingReserveParser,
|
||||||
} from '../../models';
|
} from '../../models';
|
||||||
import { Card } from 'antd';
|
import { Card } from 'antd';
|
||||||
import { contexts, ParsedAccount } from '@oyster/common';
|
import { contexts, ParsedAccount, ConnectButton } from '@oyster/common';
|
||||||
|
|
||||||
import { borrow } from '../../actions';
|
import { borrow } from '../../actions';
|
||||||
import './style.less';
|
import './style.less';
|
||||||
import { LABELS } from '../../constants';
|
import { LABELS } from '../../constants';
|
||||||
import { ActionConfirmation } from './../ActionConfirmation';
|
import { ActionConfirmation } from './../ActionConfirmation';
|
||||||
import { BackButton } from './../BackButton';
|
import { BackButton } from './../BackButton';
|
||||||
import { ConnectButton } from '../ConnectButton';
|
|
||||||
import CollateralInput from '../CollateralInput';
|
import CollateralInput from '../CollateralInput';
|
||||||
import { useMidPriceInUSD } from '../../contexts/market';
|
import { useMidPriceInUSD } from '../../contexts/market';
|
||||||
import { RiskSlider } from '../RiskSlider';
|
import { RiskSlider } from '../RiskSlider';
|
||||||
|
|
|
@ -7,9 +7,8 @@ import { PublicKey } from '@solana/web3.js';
|
||||||
import './style.less';
|
import './style.less';
|
||||||
import { ActionConfirmation } from './../ActionConfirmation';
|
import { ActionConfirmation } from './../ActionConfirmation';
|
||||||
import { LABELS, marks } from '../../constants';
|
import { LABELS, marks } from '../../constants';
|
||||||
import { ConnectButton } from '../ConnectButton';
|
|
||||||
import CollateralInput from '../CollateralInput';
|
import CollateralInput from '../CollateralInput';
|
||||||
import { contexts } from '@oyster/common';
|
import { contexts, ConnectButton } from '@oyster/common';
|
||||||
const { useWallet } = contexts.Wallet;
|
const { useWallet } = contexts.Wallet;
|
||||||
const { useConnection } = contexts.Connection;
|
const { useConnection } = contexts.Connection;
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ import Card from 'antd/lib/card';
|
||||||
import React, { useCallback, useEffect } from 'react';
|
import React, { useCallback, useEffect } from 'react';
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { LABELS, marks } from '../../constants';
|
import { LABELS, marks } from '../../constants';
|
||||||
import { ParsedAccount, contexts, utils } from '@oyster/common';
|
import { ParsedAccount, contexts, utils, ConnectButton } from '@oyster/common';
|
||||||
import {
|
import {
|
||||||
EnrichedLendingObligation,
|
EnrichedLendingObligation,
|
||||||
InputType,
|
InputType,
|
||||||
|
@ -15,7 +15,6 @@ import { ActionConfirmation } from '../ActionConfirmation';
|
||||||
import { liquidate } from '../../actions';
|
import { liquidate } from '../../actions';
|
||||||
import './style.less';
|
import './style.less';
|
||||||
import CollateralInput from '../CollateralInput';
|
import CollateralInput from '../CollateralInput';
|
||||||
import { ConnectButton } from '../ConnectButton';
|
|
||||||
import { useMidPriceInUSD } from '../../contexts/market';
|
import { useMidPriceInUSD } from '../../contexts/market';
|
||||||
const { notify, fromLamports, wadToLamports } = utils;
|
const { notify, fromLamports, wadToLamports } = utils;
|
||||||
const { useConnection } = contexts.Connection;
|
const { useConnection } = contexts.Connection;
|
||||||
|
|
|
@ -7,12 +7,11 @@ import {
|
||||||
} from '../../hooks';
|
} from '../../hooks';
|
||||||
import { LendingReserve } from '../../models';
|
import { LendingReserve } from '../../models';
|
||||||
import { Card, Slider } from 'antd';
|
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 { repay } from '../../actions';
|
||||||
import './style.less';
|
import './style.less';
|
||||||
import { LABELS, marks } from '../../constants';
|
import { LABELS, marks } from '../../constants';
|
||||||
import { ActionConfirmation } from './../ActionConfirmation';
|
import { ActionConfirmation } from './../ActionConfirmation';
|
||||||
import { ConnectButton } from '../ConnectButton';
|
|
||||||
import CollateralInput from '../CollateralInput';
|
import CollateralInput from '../CollateralInput';
|
||||||
import { useMidPriceInUSD } from '../../contexts/market';
|
import { useMidPriceInUSD } from '../../contexts/market';
|
||||||
|
|
||||||
|
|
|
@ -12,9 +12,8 @@ import { PublicKey } from '@solana/web3.js';
|
||||||
import './style.less';
|
import './style.less';
|
||||||
import { LABELS, marks } from '../../constants';
|
import { LABELS, marks } from '../../constants';
|
||||||
import { ActionConfirmation } from './../ActionConfirmation';
|
import { ActionConfirmation } from './../ActionConfirmation';
|
||||||
import { ConnectButton } from '../ConnectButton';
|
|
||||||
import CollateralInput from '../CollateralInput';
|
import CollateralInput from '../CollateralInput';
|
||||||
import { contexts } from '@oyster/common';
|
import { contexts, ConnectButton } from '@oyster/common';
|
||||||
const { useConnection } = contexts.Connection;
|
const { useConnection } = contexts.Connection;
|
||||||
const { useWallet } = contexts.Wallet;
|
const { useWallet } = contexts.Wallet;
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
import React, { useCallback } from 'react';
|
import React, { useCallback } from 'react';
|
||||||
import { Card } from 'antd';
|
import { Card } from 'antd';
|
||||||
import { LAMPORTS_PER_SOL } from '@solana/web3.js';
|
import { LAMPORTS_PER_SOL } from '@solana/web3.js';
|
||||||
import { ConnectButton } from './../../components/ConnectButton';
|
|
||||||
import { LABELS } from '../../constants';
|
import { LABELS } from '../../constants';
|
||||||
import { contexts, utils } from '@oyster/common';
|
import { contexts, utils, ConnectButton } from '@oyster/common';
|
||||||
const { useConnection } = contexts.Connection;
|
const { useConnection } = contexts.Connection;
|
||||||
const { useWallet } = contexts.Wallet;
|
const { useWallet } = contexts.Wallet;
|
||||||
const { notify } = utils;
|
const { notify } = utils;
|
||||||
|
|
Loading…
Reference in New Issue