@orderly.network/ui-scaffold 2.8.10 → 2.8.11-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 +10 -19
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -19
- package/dist/index.mjs.map +1 -1
- package/package.json +12 -12
package/dist/index.js
CHANGED
|
@@ -2684,8 +2684,7 @@ var QRCodeScanner = (props) => {
|
|
|
2684
2684
|
const tick = () => {
|
|
2685
2685
|
const video = videoRef.current;
|
|
2686
2686
|
const canvas = canvasRef.current;
|
|
2687
|
-
if (!video || !canvas)
|
|
2688
|
-
return;
|
|
2687
|
+
if (!video || !canvas) return;
|
|
2689
2688
|
const ctx = canvas.getContext("2d");
|
|
2690
2689
|
if (video.readyState === video.HAVE_ENOUGH_DATA) {
|
|
2691
2690
|
const videoWidth = video.videoWidth;
|
|
@@ -2727,8 +2726,7 @@ var QRCodeScanner = (props) => {
|
|
|
2727
2726
|
};
|
|
2728
2727
|
React6.useEffect(() => {
|
|
2729
2728
|
const video = videoRef.current;
|
|
2730
|
-
if (!open || !video)
|
|
2731
|
-
return;
|
|
2729
|
+
if (!open || !video) return;
|
|
2732
2730
|
navigator?.mediaDevices?.getUserMedia({
|
|
2733
2731
|
video: {
|
|
2734
2732
|
facingMode: "environment",
|
|
@@ -3188,8 +3186,7 @@ var QRCode = (props) => {
|
|
|
3188
3186
|
var QRCodeCanvas = (props) => {
|
|
3189
3187
|
const canvasRef = React6.useRef(null);
|
|
3190
3188
|
React6.useEffect(() => {
|
|
3191
|
-
if (!canvasRef.current || !props.content)
|
|
3192
|
-
return;
|
|
3189
|
+
if (!canvasRef.current || !props.content) return;
|
|
3193
3190
|
const qrcode = qr.qrcode(props.content);
|
|
3194
3191
|
const width = props.width;
|
|
3195
3192
|
const height = props.height;
|
|
@@ -3648,8 +3645,7 @@ var NotificationUI = (props) => {
|
|
|
3648
3645
|
const { dataSource, showAnnouncement } = props;
|
|
3649
3646
|
const { routerAdapter } = useScaffoldContext();
|
|
3650
3647
|
const onItemClick = (url) => {
|
|
3651
|
-
if (!url)
|
|
3652
|
-
return;
|
|
3648
|
+
if (!url) return;
|
|
3653
3649
|
routerAdapter?.onRouteChange({
|
|
3654
3650
|
href: url,
|
|
3655
3651
|
name: url,
|
|
@@ -4443,14 +4439,12 @@ var useMainNavScript = (props) => {
|
|
|
4443
4439
|
const { connectedChain } = hooks.useWalletConnector();
|
|
4444
4440
|
const { wrongNetwork, disabledConnect } = reactApp.useAppContext();
|
|
4445
4441
|
const [current, setCurrent] = React6.useState(() => {
|
|
4446
|
-
if (typeof props.initialMenu === "undefined")
|
|
4447
|
-
return [];
|
|
4442
|
+
if (typeof props.initialMenu === "undefined") return [];
|
|
4448
4443
|
return !Array.isArray(props.initialMenu) ? [props.initialMenu] : props.initialMenu;
|
|
4449
4444
|
});
|
|
4450
4445
|
const onItemClickHandler = (scope) => (item) => {
|
|
4451
4446
|
const lastItem = item[item.length - 1];
|
|
4452
|
-
if (!lastItem)
|
|
4453
|
-
return;
|
|
4447
|
+
if (!lastItem) return;
|
|
4454
4448
|
if (lastItem.target !== "_blank") {
|
|
4455
4449
|
setCurrent(item.map((item2) => item2.href));
|
|
4456
4450
|
}
|
|
@@ -5135,8 +5129,7 @@ var MessageCenter = (props) => {
|
|
|
5135
5129
|
const messageSize = React6.useMemo(() => messages.length, [messages]);
|
|
5136
5130
|
const [popoverOpen, setPopoverOpen] = React6.useState(false);
|
|
5137
5131
|
const onItemClick = (url) => {
|
|
5138
|
-
if (!url)
|
|
5139
|
-
return;
|
|
5132
|
+
if (!url) return;
|
|
5140
5133
|
routerAdapter?.onRouteChange({
|
|
5141
5134
|
href: url,
|
|
5142
5135
|
name: url,
|
|
@@ -5273,10 +5266,8 @@ var NavItem2 = (props) => {
|
|
|
5273
5266
|
}, [showButtonTooltip]);
|
|
5274
5267
|
const isActive = React6.useMemo(() => {
|
|
5275
5268
|
const current = currentPath?.[0];
|
|
5276
|
-
if (!current)
|
|
5277
|
-
|
|
5278
|
-
if (current === item.href)
|
|
5279
|
-
return true;
|
|
5269
|
+
if (!current) return false;
|
|
5270
|
+
if (current === item.href) return true;
|
|
5280
5271
|
return Array.isArray(item.activeHrefs) && item.activeHrefs.includes(current);
|
|
5281
5272
|
}, [currentPath, item.href, item.activeHrefs]);
|
|
5282
5273
|
const hasSubMenu = Array.isArray(item.children) || typeof item.customSubMenuRender === "function";
|
|
@@ -5867,5 +5858,5 @@ exports.SubAccountWidget = SubAccountWidget;
|
|
|
5867
5858
|
exports.useLanguageSwitcherScript = useLanguageSwitcherScript;
|
|
5868
5859
|
exports.useScaffoldContext = useScaffoldContext;
|
|
5869
5860
|
exports.useScanQRCodeScript = useScanQRCodeScript;
|
|
5870
|
-
//# sourceMappingURL=
|
|
5861
|
+
//# sourceMappingURL=index.js.map
|
|
5871
5862
|
//# sourceMappingURL=index.js.map
|