parent
416db3df58
commit
db5f8e8d16
|
@ -23,6 +23,9 @@ import useLocalStorageState from 'hooks/useLocalStorageState'
|
||||||
import { SIDEBAR_COLLAPSE_KEY, TRADE_LAYOUT_KEY } from 'utils/constants'
|
import { SIDEBAR_COLLAPSE_KEY, TRADE_LAYOUT_KEY } from 'utils/constants'
|
||||||
import TradeHotKeys from './TradeHotKeys'
|
import TradeHotKeys from './TradeHotKeys'
|
||||||
import OrderbookTooltip from './OrderbookTooltip'
|
import OrderbookTooltip from './OrderbookTooltip'
|
||||||
|
import { ExclamationTriangleIcon } from '@heroicons/react/20/solid'
|
||||||
|
import useSelectedMarket from 'hooks/useSelectedMarket'
|
||||||
|
import { PerpMarket } from '@blockworks-foundation/mango-v4'
|
||||||
|
|
||||||
export type TradeLayout =
|
export type TradeLayout =
|
||||||
| 'chartLeft'
|
| 'chartLeft'
|
||||||
|
@ -56,6 +59,8 @@ const TradeAdvancedPage = () => {
|
||||||
'chartLeft',
|
'chartLeft',
|
||||||
)
|
)
|
||||||
const [isCollapsed] = useLocalStorageState(SIDEBAR_COLLAPSE_KEY, false)
|
const [isCollapsed] = useLocalStorageState(SIDEBAR_COLLAPSE_KEY, false)
|
||||||
|
const { serumOrPerpMarket } = useSelectedMarket()
|
||||||
|
const { tradeType } = mangoStore((s) => s.tradeForm)
|
||||||
|
|
||||||
const minPageHeight = 1000
|
const minPageHeight = 1000
|
||||||
const topnavbarHeight = 64
|
const topnavbarHeight = 64
|
||||||
|
@ -284,6 +289,18 @@ const TradeAdvancedPage = () => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
{/* Openbook warning */}
|
||||||
|
{serumOrPerpMarket instanceof PerpMarket ||
|
||||||
|
tradeType === 'Market' ? null : (
|
||||||
|
<div className="fixed bottom-16 left-1/2 z-20 w-[90%] -translate-x-1/2 rounded-full bg-th-down px-4 py-2 sm:w-max md:bottom-12">
|
||||||
|
<div className="flex items-center">
|
||||||
|
<ExclamationTriangleIcon className="h-5 w-5 flex-shrink-0 text-th-fgd-1" />
|
||||||
|
<p className="ml-2 text-th-fgd-1">
|
||||||
|
Placing limit orders is currently disabled for security reasons.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
{showMobileView ? (
|
{showMobileView ? (
|
||||||
<MobileTradeAdvancedPage />
|
<MobileTradeAdvancedPage />
|
||||||
) : (
|
) : (
|
||||||
|
|
Loading…
Reference in New Issue