@orderly.network/portfolio 2.8.13 → 2.8.14-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 +133 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +133 -5
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +18 -18
package/dist/index.js
CHANGED
|
@@ -8115,6 +8115,7 @@ __export(setting_exports, {
|
|
|
8115
8115
|
SettingWidget: () => SettingWidget
|
|
8116
8116
|
});
|
|
8117
8117
|
var ORDERLY_ORDER_SOUND_ALERT_KEY = "orderly_order_sound_alert";
|
|
8118
|
+
var ORDERLY_MWEB_ORDER_ENTRY_SIDE_MARKETS_LAYOUT = "orderly_mweb_order_entry_side_markets_layout";
|
|
8118
8119
|
var useSettingScript = () => {
|
|
8119
8120
|
const { data, mutate: refresh } = hooks.useAccountInfo();
|
|
8120
8121
|
const { wrongNetwork, disabledConnect } = reactApp.useAppContext();
|
|
@@ -8125,6 +8126,10 @@ var useSettingScript = () => {
|
|
|
8125
8126
|
ORDERLY_ORDER_SOUND_ALERT_KEY,
|
|
8126
8127
|
notification?.orderFilled?.defaultOpen ?? false
|
|
8127
8128
|
);
|
|
8129
|
+
const [orderPanelLayout, setOrderPanelLayout] = hooks.useLocalStorage(
|
|
8130
|
+
ORDERLY_MWEB_ORDER_ENTRY_SIDE_MARKETS_LAYOUT,
|
|
8131
|
+
"right"
|
|
8132
|
+
);
|
|
8128
8133
|
React12.useEffect(() => {
|
|
8129
8134
|
setChecked(data?.maintenance_cancel_orders || false);
|
|
8130
8135
|
}, [data]);
|
|
@@ -8153,7 +8158,9 @@ var useSettingScript = () => {
|
|
|
8153
8158
|
canTouch,
|
|
8154
8159
|
soundAlert,
|
|
8155
8160
|
setSoundAlert,
|
|
8156
|
-
hasOrderFilledMedia: Boolean(notification?.orderFilled?.media)
|
|
8161
|
+
hasOrderFilledMedia: Boolean(notification?.orderFilled?.media),
|
|
8162
|
+
orderPanelLayout,
|
|
8163
|
+
setOrderPanelLayout
|
|
8157
8164
|
};
|
|
8158
8165
|
};
|
|
8159
8166
|
var SettingDesktop = (props) => {
|
|
@@ -8242,6 +8249,74 @@ var SettingMobile = (props) => {
|
|
|
8242
8249
|
const onLanguageChange = () => {
|
|
8243
8250
|
setOpen(true);
|
|
8244
8251
|
};
|
|
8252
|
+
const renderItem = (position) => {
|
|
8253
|
+
const isSelected = props.orderPanelLayout === position;
|
|
8254
|
+
const handleClick = () => props.setOrderPanelLayout(position);
|
|
8255
|
+
const handleKeyDown = (e) => {
|
|
8256
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
8257
|
+
e.preventDefault();
|
|
8258
|
+
handleClick();
|
|
8259
|
+
}
|
|
8260
|
+
};
|
|
8261
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8262
|
+
ui.Flex,
|
|
8263
|
+
{
|
|
8264
|
+
direction: "column",
|
|
8265
|
+
gapY: 2,
|
|
8266
|
+
className: "oui-group oui-flex-1 oui-cursor-pointer",
|
|
8267
|
+
onClick: handleClick,
|
|
8268
|
+
onKeyDown: handleKeyDown,
|
|
8269
|
+
role: "button",
|
|
8270
|
+
tabIndex: 0,
|
|
8271
|
+
"aria-pressed": isSelected,
|
|
8272
|
+
"aria-label": `Layout ${position}`,
|
|
8273
|
+
children: [
|
|
8274
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
8275
|
+
ui.Flex,
|
|
8276
|
+
{
|
|
8277
|
+
direction: "column",
|
|
8278
|
+
className: ui.cn(
|
|
8279
|
+
"oui-h-[160px] oui-w-[120px] oui-shrink-0 oui-overflow-hidden oui-rounded-[10px] oui-border-4 oui-border-base-5 oui-bg-base-10 oui-p-0.5",
|
|
8280
|
+
"group-hover:oui-border-base-4",
|
|
8281
|
+
isSelected && "!oui-border-primary-light"
|
|
8282
|
+
),
|
|
8283
|
+
children: [
|
|
8284
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8285
|
+
ui.Flex,
|
|
8286
|
+
{
|
|
8287
|
+
direction: "row",
|
|
8288
|
+
itemAlign: "stretch",
|
|
8289
|
+
className: "oui-h-[152px] oui-shrink-0 oui-gap-0.5",
|
|
8290
|
+
children: position === "left" ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
8291
|
+
/* @__PURE__ */ jsxRuntime.jsx(OrderEntryStripIcon, {}),
|
|
8292
|
+
/* @__PURE__ */ jsxRuntime.jsx(EmptyBlockIcon, {})
|
|
8293
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
8294
|
+
/* @__PURE__ */ jsxRuntime.jsx(EmptyBlockIcon, {}),
|
|
8295
|
+
/* @__PURE__ */ jsxRuntime.jsx(OrderEntryStripIcon, {})
|
|
8296
|
+
] })
|
|
8297
|
+
}
|
|
8298
|
+
),
|
|
8299
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "oui-min-h-[4px] oui-flex-1 oui-bg-base-10" })
|
|
8300
|
+
]
|
|
8301
|
+
}
|
|
8302
|
+
),
|
|
8303
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8304
|
+
ui.Text,
|
|
8305
|
+
{
|
|
8306
|
+
size: "2xs",
|
|
8307
|
+
intensity: 54,
|
|
8308
|
+
className: ui.cn(
|
|
8309
|
+
"oui-text-center oui-text-base-contrast-54 group-hover:oui-text-base-contrast-80",
|
|
8310
|
+
isSelected && "oui-text-base-contrast-80"
|
|
8311
|
+
),
|
|
8312
|
+
children: position === "left" ? t("trading.layout.advanced.left") : t("trading.layout.advanced.right")
|
|
8313
|
+
}
|
|
8314
|
+
)
|
|
8315
|
+
]
|
|
8316
|
+
},
|
|
8317
|
+
position
|
|
8318
|
+
);
|
|
8319
|
+
};
|
|
8245
8320
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
8246
8321
|
/* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { mt: 1, p: 4, intensity: 900, r: "xl", itemAlign: "center", children: [
|
|
8247
8322
|
/* @__PURE__ */ jsxRuntime.jsx(uiScaffold.LanguageSwitcherWidget, { open, onOpenChange: setOpen }),
|
|
@@ -8279,7 +8354,7 @@ var SettingMobile = (props) => {
|
|
|
8279
8354
|
{
|
|
8280
8355
|
title: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "oui-text-sm", children: t("portfolio.setting.systemUpgrade") }),
|
|
8281
8356
|
id: "portfolio-apikey-manager",
|
|
8282
|
-
className: "oui-bg-base-9 oui-font-semibold
|
|
8357
|
+
className: "oui-mt-2 oui-bg-base-9 oui-font-semibold",
|
|
8283
8358
|
classNames: { root: "oui-p-4", content: "!oui-pt-3" },
|
|
8284
8359
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8285
8360
|
ui.Flex,
|
|
@@ -8289,7 +8364,7 @@ var SettingMobile = (props) => {
|
|
|
8289
8364
|
width: "100%",
|
|
8290
8365
|
itemAlign: "center",
|
|
8291
8366
|
pt: 3,
|
|
8292
|
-
className: "oui-
|
|
8367
|
+
className: "oui-border-t-2 oui-border-line-6 oui-font-semibold",
|
|
8293
8368
|
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8294
8369
|
ui.Flex,
|
|
8295
8370
|
{
|
|
@@ -8323,7 +8398,7 @@ var SettingMobile = (props) => {
|
|
|
8323
8398
|
{
|
|
8324
8399
|
title: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "oui-text-sm", children: t("portfolio.setting.soundAlerts") }),
|
|
8325
8400
|
id: "portfolio-sound-alert-setting",
|
|
8326
|
-
className: "oui-bg-base-9 oui-font-semibold
|
|
8401
|
+
className: "oui-mt-2 oui-bg-base-9 oui-font-semibold",
|
|
8327
8402
|
classNames: { root: "oui-p-4", content: "!oui-pt-3" },
|
|
8328
8403
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8329
8404
|
ui.Flex,
|
|
@@ -8333,7 +8408,7 @@ var SettingMobile = (props) => {
|
|
|
8333
8408
|
width: "100%",
|
|
8334
8409
|
itemAlign: "center",
|
|
8335
8410
|
pt: 3,
|
|
8336
|
-
className: "oui-
|
|
8411
|
+
className: "oui-border-t-2 oui-border-line-6 oui-font-semibold",
|
|
8337
8412
|
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8338
8413
|
ui.Flex,
|
|
8339
8414
|
{
|
|
@@ -8360,9 +8435,62 @@ var SettingMobile = (props) => {
|
|
|
8360
8435
|
}
|
|
8361
8436
|
)
|
|
8362
8437
|
}
|
|
8438
|
+
),
|
|
8439
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8440
|
+
ui.Card,
|
|
8441
|
+
{
|
|
8442
|
+
title: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "oui-text-sm", children: t("trading.layout") }),
|
|
8443
|
+
id: "portfolio-order-panel-setting",
|
|
8444
|
+
className: "oui-mt-2 oui-bg-base-9 oui-font-semibold",
|
|
8445
|
+
classNames: { root: "oui-p-4", content: "!oui-pt-3" },
|
|
8446
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8447
|
+
ui.Flex,
|
|
8448
|
+
{
|
|
8449
|
+
direction: "row",
|
|
8450
|
+
gap: 4,
|
|
8451
|
+
width: "100%",
|
|
8452
|
+
itemAlign: "center",
|
|
8453
|
+
pt: 3,
|
|
8454
|
+
className: "oui-border-t-2 oui-border-line-6 oui-font-semibold",
|
|
8455
|
+
children: [
|
|
8456
|
+
renderItem("left"),
|
|
8457
|
+
renderItem("right")
|
|
8458
|
+
]
|
|
8459
|
+
}
|
|
8460
|
+
)
|
|
8461
|
+
}
|
|
8363
8462
|
)
|
|
8364
8463
|
] });
|
|
8365
8464
|
};
|
|
8465
|
+
var EmptyBlockIcon = (props) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
8466
|
+
"svg",
|
|
8467
|
+
{
|
|
8468
|
+
width: "50",
|
|
8469
|
+
height: "80",
|
|
8470
|
+
viewBox: "0 0 50 80",
|
|
8471
|
+
fill: "none",
|
|
8472
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
8473
|
+
...props,
|
|
8474
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("rect", { width: "50", height: "80", rx: "2", fill: "#181C23" })
|
|
8475
|
+
}
|
|
8476
|
+
);
|
|
8477
|
+
var OrderEntryStripIcon = (props) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8478
|
+
"svg",
|
|
8479
|
+
{
|
|
8480
|
+
width: "50",
|
|
8481
|
+
height: "80",
|
|
8482
|
+
viewBox: "0 0 50 80",
|
|
8483
|
+
fill: "none",
|
|
8484
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
8485
|
+
...props,
|
|
8486
|
+
children: [
|
|
8487
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { width: "50", height: "80", rx: "2", fill: "#181C23" }),
|
|
8488
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "3", y: "3", width: "21", height: "11", rx: "2", fill: "#008676" }),
|
|
8489
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "26", y: "3", width: "21", height: "11", rx: "2", fill: "#D92D6B" }),
|
|
8490
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "3", y: "69", width: "44", height: "8", rx: "2", fill: "#008676" })
|
|
8491
|
+
]
|
|
8492
|
+
}
|
|
8493
|
+
);
|
|
8366
8494
|
var Setting = (props) => {
|
|
8367
8495
|
const { isMobile } = ui.useScreen();
|
|
8368
8496
|
if (isMobile) {
|