Skip to content

Commit

Permalink
Disable orderly feat (#602)
Browse files Browse the repository at this point in the history
* forbidden orderly operation

* update

* update index

* update index

---------

Co-authored-by: naturexie <786281870@qq.com>
  • Loading branch information
xieqiancaosissi and naturexie authored Sep 18, 2024
1 parent 54bb746 commit 36f40d0
Show file tree
Hide file tree
Showing 6 changed files with 223 additions and 178 deletions.
2 changes: 1 addition & 1 deletion src/pages/Orderly/OrderlyPerpetual.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import { parseSymbol } from './components/RecentTrade';
import { NewUserTip } from './components/Common/NewUserTip';
import BlockOrderBookTip from './BlockOrderBookTip';

export const REF_ORDERLY_PERP_TIP_SIG = 'REF_ORDERLY_PERP_TIP_SIGN11';
export const REF_ORDERLY_PERP_TIP_SIG = 'REF_ORDERLY_PERP_TIP_SIGN12';

function TradingBoard() {
const isLarge = useLargeScreen();
Expand Down
24 changes: 21 additions & 3 deletions src/pages/Orderly/OrderlyTradingBoard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ function MobileTradingBoard() {
export function OrderlyUnderMaintain() {
return (
<div
className="absolute xs:fixed w-screen h-full left-0 flex items-center justify-center"
className="absolute xs:fixed w-screen h-full left-0 flex items-center justify-center"
style={{
background: 'rgba(0, 19, 32, 0.6)',
zIndex: 90,
Expand All @@ -245,6 +245,24 @@ export function OrderlyUnderMaintain() {
</div>
);
}
export function OrderlyUnderMaintain2() {
return (
<div
className="absolute xs:fixed w-screen lg:h-full flex items-center justify-center"
style={{
background: 'rgba(0, 19, 32, 0.6)',
zIndex: 90,
backdropFilter: isMobile() ? 'blur(5px)' : '',
WebkitBackdropFilter: isMobile() ? 'blur(5px)' : '',
left: isMobile() ? '0px' : '280px',
top: isMobile() ? '0px' : '',
bottom: isMobile() ? '80px' : '',
}}
>
<OrderlyUnderMaintainIcon></OrderlyUnderMaintainIcon>
</div>
);
}

function OrderlyTradingBoard() {
const priKeyPath = get_orderly_private_key_path();
Expand All @@ -266,13 +284,13 @@ function OrderlyTradingBoard() {
<>
<div className="mx-auto relative xs:bottom-6 bottom-9">
{/* todo */}
{/* {!isMobile && <PerpOrderlyTip />} */}
{!isMobile && <PerpOrderlyTip />}
{!isMobile && <TradingBoard></TradingBoard>}

{isMobile && <MobileTradingBoard></MobileTradingBoard>}
</div>
{/* todo */}
{/* {isMobile && <PerpOrderlyTipMobile></PerpOrderlyTipMobile>} */}
{isMobile && <PerpOrderlyTipMobile></PerpOrderlyTipMobile>}
</>
);
}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Orderly/PorfolioOrderly.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
getOrderTrades,
getPortfolioAllOrders,
} from './orderly/off-chain-api';
import { OrderlyUnderMaintain } from './OrderlyTradingBoard';
import { OrderlyUnderMaintain2 } from './OrderlyTradingBoard';
import { FlexRow, orderEditPopUpFailure } from './components/Common';
import { orderPopUp } from './components/Common/index';
import { AssetManagerModal, TextWrapper } from './components/UserBoard';
Expand Down Expand Up @@ -324,7 +324,7 @@ function PortfolioOrderly() {
is_mobile,
}}
>
{maintenance && <OrderlyUnderMaintain />}
{maintenance && <OrderlyUnderMaintain2 />}
<div className="flex items-stretch justify-between pb-20 md:pb-0 lg:pb-0 w-full h-full lg:-mt-12">
{/* Navigation */}
<div
Expand Down
34 changes: 17 additions & 17 deletions src/pages/Orderly/components/PerpHeader/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@ export function PerpOrderlyTip() {

return (
<div
className="w-screen px-10 xs:pb-7 h-10 xs:rounded-2xl lg:relative xs:bottom-0 bg-gradientFromHover frcc "
className="w-screen px-10 xs:pb-7 h-10 xs:rounded-2xl lg:relative xs:bottom-0 bg-lightReBgColor text-redwarningColor frcc "
style={{
fontSize: '13px',
color: '#111F29',
// color: '#111F29',
zIndex: isMobile ? 999999 : '',
}}
>
<FormattedMessage
id="perpTip"
defaultMessage={
'Welcome to Perpetual Futures trading!{br} Please read {perpTipLink} docs to get start!'
}
// id="perpTipDown"
// id="perpTip"
// defaultMessage={
// 'Order book system update will be conducted from 2024/08/27 07:00 AM to 2024/08/27 08:00AM (UTC), during which time Spot and Perps will be temporarily unavailable.'
// 'Welcome to Perpetual Futures trading!{br} Please read {perpTipLink} docs to get start!'
// }
id="perpTipDown"
defaultMessage={
'Orderly has shut down and no longer supports Spot and Perps. New Spot and Perps are coming soon—stay tuned!'
}
values={{
perpTipLink: (
<a
Expand Down Expand Up @@ -78,24 +78,24 @@ export function PerpOrderlyTipMobile() {

return (
<div
className="w-screen px-4 xs:pr-8 xs:pb-9 xs:pt-2 xs:rounded-2xl xs:bottom-0 bg-gradientFromHover lg:frcc "
className="w-screen px-4 xs:pr-8 xs:pb-9 xs:pt-2 xs:rounded-2xl xs:bottom-0 bg-lightReBgColor text-redwarningColor lg:frcc "
style={{
fontSize: '14px',
color: '#111F29',
// color: '#111F29',
top: isMobile ? 'none' : '-48px',
zIndex: isMobile ? 51 : '',
zIndex: isMobile ? 100 : '',
position: 'fixed',
}}
>
<FormattedMessage
id="perpTip"
defaultMessage={
'Welcome to Perpetual Futures trading! Please read {perpTipLink} docs to get start!'
}
// id="perpTipDown"
// id="perpTip"
// defaultMessage={
// 'Order book system update will be conducted from 2024/08/27 07:00 AM to 2024/08/27 08:00AM (UTC), during which time Spot and Perps will be temporarily unavailable.'
// 'Welcome to Perpetual Futures trading! Please read {perpTipLink} docs to get start!'
// }
id="perpTipDown"
defaultMessage={
'Orderly has shut down and no longer supports Spot and Perps. New Spot and Perps are coming soon—stay tuned!'
}
values={{
perpTipLink: (
<a
Expand Down
171 changes: 93 additions & 78 deletions src/pages/Orderly/components/UserBoard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ import { CollatteralTokenAvailableCell } from '../UserBoardPerp/components/Hover
import getConfigV2 from '../../../../services/configV2';
import { useOrderlyBalancesStore } from '../../../../stores/orderlyBalances';
import WarningModal from '../WarningModal';
const configV2 = getConfigV2();
import CustomTooltip from 'src/components/customTooltip/customTooltip';
const configV2 = getConfigV2();

function getTipFOK() {
const intl = useIntl();
Expand Down Expand Up @@ -3929,56 +3929,72 @@ export function AssetManagerModal(
</div>
)}

<button
className={`flex ${
!validation() ||
new Big(inputValue || 0).lte(0) ||
buttonLoading
? 'opacity-70 cursor-not-allowed'
<div
className="text-white text-right"
data-class="reactTip"
data-tooltip-id="userBoardDepositId"
data-place="top"
data-tooltip-html={
type == 'deposit'
? `<div class="w-52 text-left">Orderly has shut down and no longer supports Spot and Perps. New Spot and Perps are coming soon—stay tuned!</div>`
: ''
} items-center justify-center font-bold text-base text-white py-2.5 rounded-lg bg-primaryGradient`}
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
if (!inputValue) return;
if (type == 'deposit') {
setWarningIsOpen(true);
} else {
setButtonLoading(true);
onClick(inputValue, tokenId);
}
}}
disabled={
!validation() ||
new Big(inputValue || 0).lte(0) ||
buttonLoading
}
>
{/* TODOXXX */}
<ButtonTextWrapper
loading={buttonLoading}
Text={() => (
<span>
{type === 'deposit'
? intl.formatMessage({
id: 'deposit',
defaultMessage: 'Deposit',
})
: type === 'withdraw'
? !validation()
<button
className={`flex w-full ${
!validation() ||
new Big(inputValue || 0).lte(0) ||
buttonLoading ||
type == 'deposit'
? 'opacity-30 cursor-not-allowed'
: ''
} items-center justify-center font-bold text-base text-white py-2.5 rounded-lg bg-primaryGradient`}
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
if (!inputValue) return;
if (type == 'deposit') {
setWarningIsOpen(true);
} else {
setButtonLoading(true);
onClick(inputValue, tokenId);
}
}}
disabled={
type == 'deposit'
? true
: !validation() ||
new Big(inputValue || 0).lte(0) ||
buttonLoading
}
>
{/* TODOXXX */}
<ButtonTextWrapper
loading={buttonLoading}
Text={() => (
<span>
{type === 'deposit'
? intl.formatMessage({
id: 'insufficient_balance',
defaultMessage: 'Insufficient Balance',
})
: intl.formatMessage({
id: 'withdraw',
defaultMessage: 'Withdraw',
id: 'deposit',
defaultMessage: 'Deposit',
})
: ''}
</span>
)}
></ButtonTextWrapper>
</button>
: type === 'withdraw'
? !validation()
? intl.formatMessage({
id: 'insufficient_balance',
defaultMessage: 'Insufficient Balance',
})
: intl.formatMessage({
id: 'withdraw',
defaultMessage: 'Withdraw',
})
: ''}
</span>
)}
></ButtonTextWrapper>
</button>
<CustomTooltip id="userBoardDepositId" />
</div>
</div>
</div>
</Modal>
Expand Down Expand Up @@ -4469,40 +4485,39 @@ function ConfirmOrderModal(
</span>
</FlexRow>
</div>

<button
className={`rounded-lg ${
loading
? 'opacity-70 cursor-not-allowed bg-buttonGradientBgOpacity'
: ''
} flex items-center justify-center py-3 bg-buttonGradientBg hover:bg-buttonGradientBgOpacity text-base text-white font-bold`}
onClick={(e: any) => {
e.preventDefault();
e.stopPropagation();
setWarningIsOpen(true);
// setLoading(true);
// onClick().then(() => {
// setLoading(false);
// onRequestClose && onRequestClose(e);
// });
}}
disabled={loading}
<div
className="text-white text-right"
data-class="reactTip"
data-tooltip-id="buy-sell-id"
data-place="top"
data-tooltip-html={`<div class="w-52 text-left">Orderly has shut down and no longer supports Spot and Perps. New Spot and Perps are coming soon—stay tuned!</div>`}
>
<ButtonTextWrapper
loading={loading}
Text={() => {
return (
<span>
{' '}
{intl.formatMessage({
id: 'confirm',
defaultMessage: 'Confirm',
})}
</span>
);
<button
className={`w-full rounded-lg opacity-30 cursor-not-allowed bg-buttonGradientBgOpacity flex items-center justify-center py-3 hover:bg-buttonGradientBgOpacity text-base text-white font-bold`}
onClick={(e: any) => {
// e.preventDefault();
// e.stopPropagation();
// setWarningIsOpen(true);
}}
/>
</button>
disabled={loading}
>
<ButtonTextWrapper
loading={loading}
Text={() => {
return (
<span>
{' '}
{intl.formatMessage({
id: 'confirm',
defaultMessage: 'Confirm',
})}
</span>
);
}}
/>
</button>
<CustomTooltip id="buy-sell-id" />
</div>
</div>
</div>
</Modal>
Expand Down
Loading

0 comments on commit 36f40d0

Please sign in to comment.