@gearbox-protocol/ui-kit 3.14.0-next.27 → 3.14.0-next.29
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/cjs/components/block-sync-pill/block-sync-pill.cjs +1 -1
- package/dist/cjs/components/block-sync-pill/block-sync-status.cjs +1 -0
- package/dist/cjs/components/layout/app-header/app-header.cjs +1 -1
- package/dist/esm/components/block-sync-pill/block-sync-pill.js +49 -50
- package/dist/esm/components/block-sync-pill/block-sync-status.js +12 -0
- package/dist/esm/components/layout/app-header/app-header.js +26 -24
- package/dist/types/components/block-sync-pill/block-sync-status.d.ts +29 -0
- package/dist/types/components/layout/app-header/app-header.d.ts +4 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("react"),E=require("../tooltip/simple-tooltip.cjs");require("../tooltip/tooltip.cjs");const M=require("../typed-intl/index.cjs"),g=require("../../utils/cn.cjs");require("../accordion/accordion.cjs");require("@gearbox-protocol/static");require("@fortawesome/free-solid-svg-icons");require("../icons/fa-icon.cjs");require("@gearbox-protocol/sdk");require("sonner");require("@gearbox-protocol/sdk/common-utils");require("luxon");require("../../utils/z-index.cjs");require("../alert-badge/alert-badge.cjs");require("../alert-dialog/alert-dialog.cjs");require("../alert-modal/alert-modal.cjs");require("../arc-loader/arc-loader.cjs");require("../asset-line/asset-line.cjs");require("../buttons/back-button/back-button.cjs");require("../buttons/button/button.cjs");require("../buttons/copy-button/copy-button.cjs");require("../buttons/external-button/external-button.cjs");require("../buttons/filter-button/filter-button.cjs");require("../buttons/navigation-button/navigation-button.cjs");require("../buttons/tab-button/tab-button.cjs");require("../token-icon/token-icon.cjs");require("wagmi");require("../auth/wallet-ui-context.cjs");require("../avatar/avatar.cjs");require("../badge/badge.cjs");require("../base-link/base-link.cjs");require("../navigation-context/navigation-context.cjs");require("../button-checkbox/button-checkbox.cjs");require("../card-grid/card-grid.cjs");require("../cards/card/card.cjs");require("../carousel/carousel.cjs");require("../checkbox/checkbox.cjs");require("../checkbox/checkbox-labeled.cjs");require("../checkbox-item/checkbox-item.cjs");require("../client-adapters/styled-button/styled-button.cjs");require("../client-adapters/styled-dialog-container/styled-dialog-container.cjs");require("../client-adapters/styled-rounded-image/styled-rounded-image.cjs");require("../colored-text/colored-text.cjs");require("../input/input.cjs");require("../with-title/with-title.cjs");require("../smart-number-input/balance-indicator.cjs");require("../smart-number-input/smart-number-input.cjs");require("../table/grid-table.cjs");require("../token-symbol/token-symbol.cjs");require("../typography/typography.cjs");require("../help-tip/help-tip.cjs");require("../description/description.cjs");require("../confirm-menu/confirm-menu.cjs");require("../dialog/dialog-modal-container.cjs");require("../text-button/text-button.cjs");require("../vertical-indicator/vertical-indicator.cjs");require("../points-icon/points-icon.cjs");require("../skeleton/skeleton.cjs");require("../vertical-list/vertical-list.cjs");require("../rounded-image/rounded-image.cjs");require("../progress/progress.cjs");require("../pool-indicator-icon/pool-indicator-icon.cjs");require("../composites/strategies-table/components/feature/feature.styles.cjs");require("viem");require("../icon-button/icon-button.cjs");require("../separate-line/separate-line.cjs");require("../tip-card/tip-card.cjs");require("../composites/strategies-table/components/rewards-tooltip/rewards-tooltip-root.cjs");require("../currency-button/currency-button.cjs");require("../detailed-apy/detailed-apy.cjs");require("../detailed-page-title/detailed-page-title.cjs");require("../detailed-page-title/detailed-page-title-copy-button.cjs");require("../detailed-page-title/detailed-page-title-explorer-dropdown.cjs");require("../modal/modal.cjs");require("@radix-ui/react-dialog");require("../dialog/dialog-container.cjs");require("../dialog/dialog-content.cjs");require("../dialog/dialog-description.cjs");require("../dialog/dialog-footer.cjs");require("../dialog/dialog-header.cjs");require("../dialog/dialog-title.cjs");require("../dialog/dialog-overlay.cjs");require("../label/label.cjs");require("../dropdown-menu/dropdown-menu.cjs");require("../dropdown-menu/dropdown-menu-checkbox-item.cjs");require("../dropdown-menu/dropdown-menu-content.cjs");require("../dropdown-menu/dropdown-menu-item.cjs");require("../dropdown-menu/dropdown-menu-label.cjs");require("../dropdown-menu/dropdown-menu-radio-item.cjs");require("../dropdown-menu/dropdown-menu-separator.cjs");require("../dropdown-menu/dropdown-menu-shortcut.cjs");require("../dropdown-menu/dropdown-menu-sub-content.cjs");require("../dropdown-menu/dropdown-menu-sub-trigger.cjs");require("../edit-input/edit-input.cjs");require("react-intl");require("../fadeout-loading/fadeout-loading.cjs");require("../filter/filter-block.cjs");require("../filter/filter-checkbox-item.cjs");require("../filter/filter-chip.cjs");require("../filter/filter-chips.cjs");require("../filter/filter-dropdown-item.cjs");require("../filter/filter-group.cjs");require("../filter/filter-label.cjs");require("../search-line/search-line.cjs");require("../tabs/tabs.cjs");require("../filter/filter-modal-item.cjs");require("../filter/filter-radio-item.cjs");require("../filter/filter-separator.cjs");require("../filter/variants.cjs");require("../graph/formatters.cjs");require("lightweight-charts");require("../graph/graph-view.cjs");require("../health-factor/health-factor.cjs");require("../horizontal-indicator/horizontal-indicator.cjs");require("../layout/app-footer/app-footer.cjs");require("../layout/app-header/app-header.cjs");require("../layout/col/col.cjs");require("../layout/container/container.cjs");require("../layout/footer/footer.cjs");require("../layout/grid/grid.cjs");require("../layout/header/header.cjs");require("../layout/layout/layout.cjs");require("../layout/main-aside-layout/main-aside-layout.cjs");require("../page-title/page-title.cjs");require("../layout/social-icons/social-icons.cjs");require("../legal-agreement/legal-agreement-theme.cjs");require("../link/link.cjs");require("../../utils/reactochart-compat.cjs");require("../status-elements/status-elements.cjs");require("../loader/loader.cjs");require("../loading/loading.cjs");require("../loading-bar/loading-bar.cjs");require("react-markdown");require("remark-gfm");require("../navbar/navbar.cjs");require("../navbar/navbar-indicator-context.cjs");require("../app-bar/app-bar.cjs");require("../navitem/navitem.cjs");require("../simple-dropdown/simple-dropdown.cjs");require("../progress-bar/progress-bar.cjs");require("../radio-group/radio-group.cjs");require("../search-bar/search-bar.cjs");require("../segmented-control/segmented-control.cjs");require("../select/select.cjs");require("../separator/separator.cjs");require("../simple-accordion/simple-accordion.cjs");require("../simple-dropdown/simple-dropdown-menu-item.cjs");require("../slider/slider.cjs");require("../slider/slider-context.cjs");require("@radix-ui/react-slider");require("../spinner/spinner.cjs");require("../spinner-loader/spinner-loader.cjs");require("../split-list/split-list.cjs");require("../stat-badge/stat-badge.cjs");const R=require("../status-dot/status-dot.cjs");require("../stepper/stepper.cjs");require("../switch/switch.cjs");require("../table/table.cjs");require("../table/grid-table-loader.cjs");require("../textarea/textarea.cjs");require("../theme-provider.cjs");require("../time-to-liquidation/time-to-liquidation.cjs");require("../toggle/toggle.cjs");require("../with-filter-button/with-filter-button.cjs");const U=require("./block-sync-status.cjs"),$=300*1e3,F=2.5;function O({blockByChain:t,explorerAddresses:y,networkById:f,syncIntervalMs:b=$,staleMultiplier:j=F,statusLabel:T="Status",className:_}){const{formatMessage:s}=M.useIntlTyped(),[c,k]=o.useState(Date.now());o.useEffect(()=>{const q=()=>{k(Date.now())},r=window.setInterval(q,1e3);return()=>{clearInterval(r)}},[]);const l=b*j,{state:u,isSyncing:h}=o.useMemo(()=>U.getBlockSyncStatus({blockByChain:t,now:c,staleAfterMs:l}),[t,c,l]),v=u==="error"?"alert":u==="loading"?"default":"success",L=u==="loading"||u==="synced"&&h,a=()=>e.jsxs("span",{className:g.cn("inline-flex items-center gap-1.5 rounded-md border border-border px-2 py-1 text-xs",u==="error"?"text-destructive":"text-muted-foreground",_),children:[e.jsx(R.StatusDot,{variant:v,size:"xs",pulse:L}),T]}),d=(()=>{if(!t)return null;const q=Object.entries(t).filter(r=>!!r[1]);return q.length===0?null:e.jsx("div",{className:"flex flex-col text-left text-xs",children:q.map(([r,N],P)=>{const{lastSyncBlock:p,error:w}=N,n=p?.block||0n,m=p?.localTimestamp,i=y[Number(r)],x=typeof i=="string"?i:i&&typeof i=="object"&&"url"in i?i.url:void 0,D=f[Number(r)]||"Unknown",S=`[${n.toString()}]`,I=P===q.length-1,A=n>0n&&!!m;return e.jsxs("div",{className:g.cn(!I&&"mb-2"),children:[e.jsxs("span",{children:[D," "]}),x&&n>0?e.jsx("a",{href:`${x}/block/${n}`,target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-foreground",children:S}):e.jsx("span",{children:S}),w?e.jsx("span",{className:"text-destructive",children:s({messageId:"components.blockSyncPill.syncError"})}):A?e.jsx("span",{children:s({messageId:"components.blockSyncPill.syncedAt"},{time:new Date(m).toLocaleTimeString()})}):e.jsx("span",{children:s({messageId:"components.blockSyncPill.syncing"})})]},r)})})})();return d?e.jsx(E.SimpleTooltip,{title:a(),children:d}):e.jsx("div",{className:"select-none",children:a()})}exports.BlockSyncPill=O;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function m({blockByChain:l,now:o,staleAfterMs:a}){const s=l?Object.values(l).filter(t=>!!t):[],i=s.some(t=>!!t.error),r=s.some(t=>!!t.loading),n=s.filter(t=>t.lastSyncBlock.block>0n&&t.lastSyncBlock.localTimestamp).map(t=>t.lastSyncBlock.localTimestamp),c=n.length?Math.min(...n):0,S=c>0&&o-c>a;let e;return i||S?e="error":c===0?e="loading":e="synced",{state:e,isSyncing:r}}exports.getBlockSyncStatus=m;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),b=require("react"),s=require("../../app-bar/app-bar.cjs"),i=require("../../base-link/base-link.cjs"),c=require("../../navbar-logo/navbar-logo.cjs"),S=require("../../../utils/cn.cjs"),o=require("../../../utils/static.cjs");function N(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(a,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return a.default=t,Object.freeze(a)}const L=N(b);function w({href:t}){return e.jsx(i.BaseLink,{size:"unset",variant:"unset",color:"main",href:t,className:"inline-flex",children:e.jsx(c.NavBarLogo,{src:o.getStatic("/logo/logo_monochrome_white.png"),srcSet:`${o.getStatic("/logo/logo_monochrome_white.png")} 1x, ${o.getStatic("/logo/logo_monochrome_white@2x.png")} 2x, ${o.getStatic("/logo/logo_monochrome_white@2x.png")} 3x`,alt:"Logo",style:{height:"32px"},className:"w-auto cursor-pointer"})})}function v({href:t}){return e.jsx(i.BaseLink,{size:"unset",variant:"unset",color:"main",href:t,className:"inline-flex",children:e.jsx(c.NavBarLogo,{src:o.getStatic("/logo/sign_monochrome_white.png"),srcSet:`${o.getStatic("/logo/sign_monochrome_white.png")} 1x, ${o.getStatic("/logo/sign_monochrome_white@2x.png")} 2x, ${o.getStatic("/logo/sign_monochrome_white@2x.png")} 3x`,alt:"Logo",style:{height:"34px",marginLeft:"4px",marginTop:"4px"},className:"w-auto cursor-pointer"})})}const l=L.forwardRef(({homeHref:t="/",desktopLogo:a,mobileLogo:n,mobileMenu:r,tabs:g,actions:p,wallet:d,extraMenu:m,leftTestId:u,centerTestId:h,rightTestId:x,className:_,...f},j)=>e.jsxs(s.AppBar,{ref:j,className:S.cn("!h-14 md:px-4 lg:px-10",_),...f,children:[e.jsxs(s.AppBarSidePanel,{"data-testid":u,children:[r&&e.jsx("div",{className:"block lg:hidden",children:r}),e.jsx("div",{className:"hidden lg:block",children:a??e.jsx(w,{href:t})}),e.jsx("div",{className:"block lg:hidden",children:n??e.jsx(v,{href:t})})]}),e.jsx(s.AppBarCenter,{"data-testid":h,className:"md:px-0 lg:px-3",children:e.jsx(s.AppBarCenterContent,{className:"md:hidden lg:block",children:g})}),e.jsxs(s.AppBarSidePanel,{"data-testid":x,className:"ml-auto",children:[p,d,m]})]}));l.displayName="AppHeader";exports.AppHeader=l;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { SimpleTooltip as
|
|
1
|
+
import { jsx as t, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import { useState as U, useEffect as j, useMemo as R } from "react";
|
|
3
|
+
import { SimpleTooltip as $ } from "../tooltip/simple-tooltip.js";
|
|
4
4
|
import "../tooltip/tooltip.js";
|
|
5
|
-
import { useIntlTyped as
|
|
6
|
-
import { cn as
|
|
5
|
+
import { useIntlTyped as F } from "../typed-intl/index.js";
|
|
6
|
+
import { cn as S } from "../../utils/cn.js";
|
|
7
7
|
import "../accordion/accordion.js";
|
|
8
8
|
import "@gearbox-protocol/static";
|
|
9
9
|
import "@fortawesome/free-solid-svg-icons";
|
|
@@ -154,7 +154,7 @@ import "../spinner/spinner.js";
|
|
|
154
154
|
import "../spinner-loader/spinner-loader.js";
|
|
155
155
|
import "../split-list/split-list.js";
|
|
156
156
|
import "../stat-badge/stat-badge.js";
|
|
157
|
-
import { StatusDot as
|
|
157
|
+
import { StatusDot as V } from "../status-dot/status-dot.js";
|
|
158
158
|
import "../stepper/stepper.js";
|
|
159
159
|
import "../switch/switch.js";
|
|
160
160
|
import "../table/table.js";
|
|
@@ -164,77 +164,76 @@ import "../theme-provider.js";
|
|
|
164
164
|
import "../time-to-liquidation/time-to-liquidation.js";
|
|
165
165
|
import "../toggle/toggle.js";
|
|
166
166
|
import "../with-filter-button/with-filter-button.js";
|
|
167
|
-
|
|
167
|
+
import { getBlockSyncStatus as z } from "./block-sync-status.js";
|
|
168
|
+
const C = 300 * 1e3, O = 2.5;
|
|
168
169
|
function Qo({
|
|
169
|
-
blockByChain:
|
|
170
|
-
explorerAddresses:
|
|
171
|
-
networkById:
|
|
172
|
-
syncIntervalMs:
|
|
173
|
-
staleMultiplier:
|
|
174
|
-
statusLabel:
|
|
175
|
-
className:
|
|
170
|
+
blockByChain: p,
|
|
171
|
+
explorerAddresses: y,
|
|
172
|
+
networkById: T,
|
|
173
|
+
syncIntervalMs: b = C,
|
|
174
|
+
staleMultiplier: h = O,
|
|
175
|
+
statusLabel: k = "Status",
|
|
176
|
+
className: v
|
|
176
177
|
}) {
|
|
177
|
-
const { formatMessage:
|
|
178
|
-
|
|
179
|
-
const
|
|
180
|
-
|
|
181
|
-
},
|
|
178
|
+
const { formatMessage: n } = F(), [c, L] = U(Date.now());
|
|
179
|
+
j(() => {
|
|
180
|
+
const m = () => {
|
|
181
|
+
L(Date.now());
|
|
182
|
+
}, r = window.setInterval(m, 1e3);
|
|
182
183
|
return () => {
|
|
183
|
-
clearInterval(
|
|
184
|
+
clearInterval(r);
|
|
184
185
|
};
|
|
185
186
|
}, []);
|
|
186
|
-
const
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
return o || l ? "error" : n === 0 ? "loading" : "synced";
|
|
191
|
-
}, [m, u, f]), w = m ? Object.values(m).some((t) => t?.loading) : !1, I = e === "error" ? "alert" : e === "loading" ? "default" : "success", j = e === "loading" || e === "synced" && w, S = () => /* @__PURE__ */ d(
|
|
187
|
+
const l = b * h, { state: i, isSyncing: N } = R(
|
|
188
|
+
() => z({ blockByChain: p, now: c, staleAfterMs: l }),
|
|
189
|
+
[p, c, l]
|
|
190
|
+
), w = i === "error" ? "alert" : i === "loading" ? "default" : "success", A = i === "loading" || i === "synced" && N, a = () => /* @__PURE__ */ s(
|
|
192
191
|
"span",
|
|
193
192
|
{
|
|
194
|
-
className:
|
|
193
|
+
className: S(
|
|
195
194
|
"inline-flex items-center gap-1.5 rounded-md border border-border px-2 py-1 text-xs",
|
|
196
|
-
|
|
197
|
-
|
|
195
|
+
i === "error" ? "text-destructive" : "text-muted-foreground",
|
|
196
|
+
v
|
|
198
197
|
),
|
|
199
198
|
children: [
|
|
200
|
-
/* @__PURE__ */
|
|
201
|
-
|
|
199
|
+
/* @__PURE__ */ t(V, { variant: w, size: "xs", pulse: A }),
|
|
200
|
+
k
|
|
202
201
|
]
|
|
203
202
|
}
|
|
204
|
-
),
|
|
205
|
-
if (!
|
|
206
|
-
const
|
|
207
|
-
(
|
|
203
|
+
), d = (() => {
|
|
204
|
+
if (!p) return null;
|
|
205
|
+
const m = Object.entries(p).filter(
|
|
206
|
+
(r) => !!r[1]
|
|
208
207
|
);
|
|
209
|
-
return
|
|
210
|
-
const { lastSyncBlock:
|
|
211
|
-
return /* @__PURE__ */
|
|
212
|
-
/* @__PURE__ */
|
|
213
|
-
|
|
208
|
+
return m.length === 0 ? null : /* @__PURE__ */ t("div", { className: "flex flex-col text-left text-xs", children: m.map(([r, E], I) => {
|
|
209
|
+
const { lastSyncBlock: u, error: D } = E, e = u?.block || 0n, f = u?.localTimestamp, o = y[Number(r)], g = typeof o == "string" ? o : o && typeof o == "object" && "url" in o ? o.url : void 0, P = T[Number(r)] || "Unknown", x = `[${e.toString()}]`, _ = I === m.length - 1, M = e > 0n && !!f;
|
|
210
|
+
return /* @__PURE__ */ s("div", { className: S(!_ && "mb-2"), children: [
|
|
211
|
+
/* @__PURE__ */ s("span", { children: [
|
|
212
|
+
P,
|
|
214
213
|
" "
|
|
215
214
|
] }),
|
|
216
|
-
|
|
215
|
+
g && e > 0 ? /* @__PURE__ */ t(
|
|
217
216
|
"a",
|
|
218
217
|
{
|
|
219
|
-
href: `${
|
|
218
|
+
href: `${g}/block/${e}`,
|
|
220
219
|
target: "_blank",
|
|
221
220
|
rel: "noopener noreferrer",
|
|
222
221
|
className: "underline hover:text-foreground",
|
|
223
|
-
children:
|
|
222
|
+
children: x
|
|
224
223
|
}
|
|
225
|
-
) : /* @__PURE__ */
|
|
226
|
-
|
|
224
|
+
) : /* @__PURE__ */ t("span", { children: x }),
|
|
225
|
+
D ? /* @__PURE__ */ t("span", { className: "text-destructive", children: n({
|
|
227
226
|
messageId: "components.blockSyncPill.syncError"
|
|
228
|
-
}) }) :
|
|
227
|
+
}) }) : M ? /* @__PURE__ */ t("span", { children: n(
|
|
229
228
|
{ messageId: "components.blockSyncPill.syncedAt" },
|
|
230
|
-
{ time: new Date(
|
|
231
|
-
) }) : /* @__PURE__ */
|
|
229
|
+
{ time: new Date(f).toLocaleTimeString() }
|
|
230
|
+
) }) : /* @__PURE__ */ t("span", { children: n({
|
|
232
231
|
messageId: "components.blockSyncPill.syncing"
|
|
233
232
|
}) })
|
|
234
|
-
] },
|
|
233
|
+
] }, r);
|
|
235
234
|
}) });
|
|
236
235
|
})();
|
|
237
|
-
return
|
|
236
|
+
return d ? /* @__PURE__ */ t($, { title: a(), children: d }) : /* @__PURE__ */ t("div", { className: "select-none", children: a() });
|
|
238
237
|
}
|
|
239
238
|
export {
|
|
240
239
|
Qo as BlockSyncPill
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
function S({
|
|
2
|
+
blockByChain: c,
|
|
3
|
+
now: o,
|
|
4
|
+
staleAfterMs: a
|
|
5
|
+
}) {
|
|
6
|
+
const e = c ? Object.values(c).filter((t) => !!t) : [], i = e.some((t) => !!t.error), r = e.some((t) => !!t.loading), l = e.filter((t) => t.lastSyncBlock.block > 0n && t.lastSyncBlock.localTimestamp).map((t) => t.lastSyncBlock.localTimestamp), n = l.length ? Math.min(...l) : 0, m = n > 0 && o - n > a;
|
|
7
|
+
let s;
|
|
8
|
+
return i || m ? s = "error" : n === 0 ? s = "loading" : s = "synced", { state: s, isSyncing: r };
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
S as getBlockSyncStatus
|
|
12
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsxs as n, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import * as
|
|
3
|
-
import { AppBar as
|
|
2
|
+
import * as w from "react";
|
|
3
|
+
import { AppBar as L, AppBarSidePanel as i, AppBarCenter as k, AppBarCenterContent as v } from "../../app-bar/app-bar.js";
|
|
4
4
|
import { BaseLink as a } from "../../base-link/base-link.js";
|
|
5
5
|
import { NavBarLogo as l } from "../../navbar-logo/navbar-logo.js";
|
|
6
|
-
import { cn as
|
|
6
|
+
import { cn as A } from "../../../utils/cn.js";
|
|
7
7
|
import { getStatic as e } from "../../../utils/static.js";
|
|
8
|
-
function
|
|
8
|
+
function B({ href: r }) {
|
|
9
9
|
return /* @__PURE__ */ o(
|
|
10
10
|
a,
|
|
11
11
|
{
|
|
@@ -31,7 +31,7 @@ function A({ href: r }) {
|
|
|
31
31
|
}
|
|
32
32
|
);
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function $({ href: r }) {
|
|
35
35
|
return /* @__PURE__ */ o(
|
|
36
36
|
a,
|
|
37
37
|
{
|
|
@@ -57,7 +57,7 @@ function B({ href: r }) {
|
|
|
57
57
|
}
|
|
58
58
|
);
|
|
59
59
|
}
|
|
60
|
-
const
|
|
60
|
+
const b = w.forwardRef(
|
|
61
61
|
({
|
|
62
62
|
homeHref: r = "/",
|
|
63
63
|
desktopLogo: s,
|
|
@@ -66,33 +66,35 @@ const $ = N.forwardRef(
|
|
|
66
66
|
tabs: c,
|
|
67
67
|
actions: p,
|
|
68
68
|
wallet: g,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
69
|
+
extraMenu: h,
|
|
70
|
+
leftTestId: d,
|
|
71
|
+
centerTestId: x,
|
|
72
|
+
rightTestId: f,
|
|
73
|
+
className: _,
|
|
74
|
+
...u
|
|
75
|
+
}, N) => /* @__PURE__ */ n(
|
|
76
|
+
L,
|
|
76
77
|
{
|
|
77
|
-
ref:
|
|
78
|
-
className:
|
|
79
|
-
...
|
|
78
|
+
ref: N,
|
|
79
|
+
className: A("!h-14 md:px-4 lg:px-10", _),
|
|
80
|
+
...u,
|
|
80
81
|
children: [
|
|
81
|
-
/* @__PURE__ */ n(i, { "data-testid":
|
|
82
|
+
/* @__PURE__ */ n(i, { "data-testid": d, children: [
|
|
82
83
|
t && /* @__PURE__ */ o("div", { className: "block lg:hidden", children: t }),
|
|
83
|
-
/* @__PURE__ */ o("div", { className: "hidden lg:block", children: s ?? /* @__PURE__ */ o(
|
|
84
|
-
/* @__PURE__ */ o("div", { className: "block lg:hidden", children: m ?? /* @__PURE__ */ o(
|
|
84
|
+
/* @__PURE__ */ o("div", { className: "hidden lg:block", children: s ?? /* @__PURE__ */ o(B, { href: r }) }),
|
|
85
|
+
/* @__PURE__ */ o("div", { className: "block lg:hidden", children: m ?? /* @__PURE__ */ o($, { href: r }) })
|
|
85
86
|
] }),
|
|
86
|
-
/* @__PURE__ */ o(
|
|
87
|
-
/* @__PURE__ */ n(i, { "data-testid":
|
|
87
|
+
/* @__PURE__ */ o(k, { "data-testid": x, className: "md:px-0 lg:px-3", children: /* @__PURE__ */ o(v, { className: "md:hidden lg:block", children: c }) }),
|
|
88
|
+
/* @__PURE__ */ n(i, { "data-testid": f, className: "ml-auto", children: [
|
|
88
89
|
p,
|
|
89
|
-
g
|
|
90
|
+
g,
|
|
91
|
+
h
|
|
90
92
|
] })
|
|
91
93
|
]
|
|
92
94
|
}
|
|
93
95
|
)
|
|
94
96
|
);
|
|
95
|
-
|
|
97
|
+
b.displayName = "AppHeader";
|
|
96
98
|
export {
|
|
97
|
-
|
|
99
|
+
b as AppHeader
|
|
98
100
|
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { BlockByChain } from '../../types/footer';
|
|
2
|
+
/**
|
|
3
|
+
* Liveness state of the data-refresh loop, derived from per-chain sync info:
|
|
4
|
+
* - `loading` — nothing has successfully synced yet (initial state);
|
|
5
|
+
* - `synced` — at least one chain synced and none are stale/failing;
|
|
6
|
+
* - `error` — a chain reported an error, or the oldest sync is stale.
|
|
7
|
+
*/
|
|
8
|
+
export type BlockSyncState = "loading" | "synced" | "error";
|
|
9
|
+
export interface BlockSyncStatus {
|
|
10
|
+
state: BlockSyncState;
|
|
11
|
+
/** True while any chain has a refresh in flight. */
|
|
12
|
+
isSyncing: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface GetBlockSyncStatusProps {
|
|
15
|
+
blockByChain: BlockByChain | undefined;
|
|
16
|
+
/** Reference "now" timestamp (ms) used to evaluate staleness. */
|
|
17
|
+
now: number;
|
|
18
|
+
/** Age (ms) after which the oldest sync is considered stale. */
|
|
19
|
+
staleAfterMs: number;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Pure derivation of the {@link BlockSyncState} from chain sync info.
|
|
23
|
+
*
|
|
24
|
+
* A chain counts as "synced" only when it has both a real block (`> 0`) and a
|
|
25
|
+
* local sync timestamp. Staleness is measured against the **oldest** synced
|
|
26
|
+
* chain, so a single lagging chain is enough to flag the whole indicator.
|
|
27
|
+
* Errors take priority over everything else.
|
|
28
|
+
*/
|
|
29
|
+
export declare function getBlockSyncStatus({ blockByChain, now, staleAfterMs, }: GetBlockSyncStatusProps): BlockSyncStatus;
|
|
@@ -30,6 +30,10 @@ export interface AppHeaderProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
30
30
|
* Wallet / connect button area, rendered on the right.
|
|
31
31
|
*/
|
|
32
32
|
wallet?: React.ReactNode;
|
|
33
|
+
/**
|
|
34
|
+
* Optional dots menu placed after the wallet (e.g. settings, docs links).
|
|
35
|
+
*/
|
|
36
|
+
extraMenu?: React.ReactNode;
|
|
33
37
|
/**
|
|
34
38
|
* Optional `data-testid` applied to the left side panel.
|
|
35
39
|
*/
|