@orderly.network/ui-order-entry 2.8.9-alpha.0 → 2.8.10-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -4144,8 +4144,11 @@ var OrderEntry = (props) => {
4144
4144
  const soundAlertId = React3.useId();
4145
4145
  const { getErrorMsg } = reactApp.useOrderEntryFormErrorMsg(validated ? errors : null);
4146
4146
  const buttonLabel = React3.useMemo(() => {
4147
+ if (isMobile && freeCollateral <= 0) {
4148
+ return t("common.deposit");
4149
+ }
4147
4150
  return side === types.OrderSide.BUY ? t("orderEntry.buyLong") : t("orderEntry.sellShort");
4148
- }, [side, t]);
4151
+ }, [side, t, isMobile, freeCollateral]);
4149
4152
  React3.useEffect(() => {
4150
4153
  if (validated) {
4151
4154
  setErrorMsgVisible(true);
@@ -4417,9 +4420,17 @@ var OrderEntry = (props) => {
4417
4420
  id: "order-entry-submit-button",
4418
4421
  "data-type": types.OrderSide.BUY,
4419
4422
  className: ui.cn(
4420
- side === types.OrderSide.BUY ? "orderly-order-entry-submit-button-buy oui-bg-success-darken hover:oui-bg-success-darken/80 active:oui-bg-success-darken/80" : "orderly-order-entry-submit-button-sell oui-bg-danger-darken hover:oui-bg-danger-darken/80 active:oui-bg-danger-darken/80"
4423
+ isMobile && freeCollateral <= 0 ? "oui-bg-primary-darken hover:oui-bg-primary-darken/80 active:oui-bg-primary-darken/80" : side === types.OrderSide.BUY ? "orderly-order-entry-submit-button-buy oui-bg-success-darken hover:oui-bg-success-darken/80 active:oui-bg-success-darken/80" : "orderly-order-entry-submit-button-sell oui-bg-danger-darken hover:oui-bg-danger-darken/80 active:oui-bg-danger-darken/80"
4421
4424
  ),
4422
- onClick: validateSubmit,
4425
+ onClick: () => {
4426
+ if (isMobile && freeCollateral <= 0) {
4427
+ ui.modal.show("DepositAndWithdrawWithSheetId", {
4428
+ activeTab: "deposit"
4429
+ });
4430
+ } else {
4431
+ validateSubmit();
4432
+ }
4433
+ },
4423
4434
  loading: props.isMutating,
4424
4435
  disabled: !props.canTrade,
4425
4436
  children: buttonLabel