rujira.ui 1.0.1 → 1.0.3
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/lib/esm/wallets/providers/ton.js +1 -1
- package/package.json +3 -2
- package/src/wallets/providers/ton.ts +1 -1
- package/lib/cjs/assets/tokens/index.js +0 -21
- package/lib/cjs/components/AssetLabel.js +0 -9
- package/lib/cjs/components/balance/OmniBalance.js +0 -28
- package/lib/cjs/components/bridges/BuyModal.js +0 -8
- package/lib/cjs/components/bridges/DepositModal.js +0 -131
- package/lib/cjs/components/buttons/Button.js +0 -52
- package/lib/cjs/components/buttons/Popout.js +0 -63
- package/lib/cjs/components/buttons/TxButton.js +0 -171
- package/lib/cjs/components/buttons/__Popout.js +0 -39
- package/lib/cjs/components/cards/Card.js +0 -12
- package/lib/cjs/components/cards/GradientCard.js +0 -12
- package/lib/cjs/components/cards/ShareCard.js +0 -16
- package/lib/cjs/components/chart/RangeLiquidityChart.js +0 -118
- package/lib/cjs/components/footer/Footer.js +0 -15
- package/lib/cjs/components/header/Accounts.js +0 -129
- package/lib/cjs/components/header/Header.js +0 -197
- package/lib/cjs/components/header/Pending.js +0 -47
- package/lib/cjs/components/header/QuickLauncher.js +0 -15
- package/lib/cjs/components/header/ResolveLink.js +0 -17
- package/lib/cjs/components/icons/IconDenom.js +0 -391
- package/lib/cjs/components/icons/Icons.js +0 -350
- package/lib/cjs/components/icons/NetworkIcon.js +0 -44
- package/lib/cjs/components/icons/Networks.js +0 -145
- package/lib/cjs/components/icons/Wallets.js +0 -140
- package/lib/cjs/components/inputs/Checkbox.js +0 -15
- package/lib/cjs/components/inputs/DecimalInput.js +0 -53
- package/lib/cjs/components/inputs/DenomInput.js +0 -29
- package/lib/cjs/components/inputs/Input.js +0 -29
- package/lib/cjs/components/inputs/Numeric.js +0 -24
- package/lib/cjs/components/inputs/Radio.js +0 -15
- package/lib/cjs/components/inputs/Select.js +0 -32
- package/lib/cjs/components/inputs/SwapSelect.js +0 -85
- package/lib/cjs/components/inputs/Textarea.js +0 -28
- package/lib/cjs/components/inputs/Toggle.js +0 -17
- package/lib/cjs/components/loader/Loader.js +0 -9
- package/lib/cjs/components/logos/RujiraLogo.js +0 -10
- package/lib/cjs/components/notices/Warning.js +0 -14
- package/lib/cjs/components/numbers/Decimal.js +0 -30
- package/lib/cjs/components/numbers/Fiat.js +0 -22
- package/lib/cjs/components/pagination/Pagination.js +0 -15
- package/lib/cjs/components/progress/Progress.js +0 -13
- package/lib/cjs/components/slider/Slider.js +0 -9
- package/lib/cjs/components/table/SortItem.js +0 -52
- package/lib/cjs/context/GlobalModal.js +0 -48
- package/lib/cjs/helpers/index.js +0 -167
- package/lib/cjs/helpers/number.js +0 -8
- package/lib/cjs/hooks/useClickOutside.js +0 -22
- package/lib/cjs/hooks/useEventCallback.js +0 -14
- package/lib/cjs/hooks/useEventListener.js +0 -57
- package/lib/cjs/hooks/useIsTouchDevice.js +0 -20
- package/lib/cjs/hooks/useIsomorphicLayoutEffect.js +0 -18
- package/lib/cjs/hooks/useLocalStorage.js +0 -123
- package/lib/cjs/hooks/useQueryParam.js +0 -36
- package/lib/cjs/hooks/useWindowSize.js +0 -51
- package/lib/cjs/i18n/I18nProvider.js +0 -54
- package/lib/cjs/i18n/TranslationProvider.js +0 -10
- package/lib/cjs/i18n/config.js +0 -101
- package/lib/cjs/i18n/index.js +0 -16
- package/lib/cjs/i18n/locales/de/borrow.json +0 -50
- package/lib/cjs/i18n/locales/de/common.json +0 -107
- package/lib/cjs/i18n/locales/de/ecosystem.json +0 -56
- package/lib/cjs/i18n/locales/de/header.json +0 -86
- package/lib/cjs/i18n/locales/de/index.json +0 -57
- package/lib/cjs/i18n/locales/de/leagues.json +0 -20
- package/lib/cjs/i18n/locales/de/merge.json +0 -41
- package/lib/cjs/i18n/locales/de/portfolio.json +0 -97
- package/lib/cjs/i18n/locales/de/strategies.json +0 -159
- package/lib/cjs/i18n/locales/de/swap.json +0 -30
- package/lib/cjs/i18n/locales/de/trade.json +0 -188
- package/lib/cjs/i18n/locales/en/borrow.json +0 -50
- package/lib/cjs/i18n/locales/en/common.json +0 -107
- package/lib/cjs/i18n/locales/en/ecosystem.json +0 -56
- package/lib/cjs/i18n/locales/en/header.json +0 -86
- package/lib/cjs/i18n/locales/en/index.json +0 -57
- package/lib/cjs/i18n/locales/en/leagues.json +0 -20
- package/lib/cjs/i18n/locales/en/merge.json +0 -41
- package/lib/cjs/i18n/locales/en/portfolio.json +0 -97
- package/lib/cjs/i18n/locales/en/strategies.json +0 -159
- package/lib/cjs/i18n/locales/en/swap.json +0 -30
- package/lib/cjs/i18n/locales/en/trade.json +0 -188
- package/lib/cjs/i18n/useTranslation.js +0 -21
- package/lib/cjs/index.js +0 -70
- package/lib/cjs/package.json +0 -3
- package/lib/cjs/wallets/config/gaia.js +0 -51
- package/lib/cjs/wallets/config/index.js +0 -9
- package/lib/cjs/wallets/config/kujira.js +0 -62
- package/lib/cjs/wallets/config/noble.js +0 -47
- package/lib/cjs/wallets/config/osmo.js +0 -51
- package/lib/cjs/wallets/config/thor.js +0 -50
- package/lib/cjs/wallets/index.js +0 -19
- package/lib/cjs/wallets/providers/brave.js +0 -4
- package/lib/cjs/wallets/providers/coinbase.js +0 -4
- package/lib/cjs/wallets/providers/cosmos.js +0 -152
- package/lib/cjs/wallets/providers/ctrl.js +0 -125
- package/lib/cjs/wallets/providers/daodao.js +0 -12
- package/lib/cjs/wallets/providers/eip1193.js +0 -155
- package/lib/cjs/wallets/providers/eip6963.js +0 -20
- package/lib/cjs/wallets/providers/eip712.js +0 -63
- package/lib/cjs/wallets/providers/index.js +0 -62
- package/lib/cjs/wallets/providers/keplr.js +0 -82
- package/lib/cjs/wallets/providers/leap.js +0 -36
- package/lib/cjs/wallets/providers/ledger/Modal.js +0 -23
- package/lib/cjs/wallets/providers/ledger.js +0 -93
- package/lib/cjs/wallets/providers/metamask.js +0 -4
- package/lib/cjs/wallets/providers/okx.js +0 -79
- package/lib/cjs/wallets/providers/rabby.js +0 -4
- package/lib/cjs/wallets/providers/station.js +0 -6
- package/lib/cjs/wallets/providers/ton.js +0 -57
- package/lib/cjs/wallets/providers/tronlink.js +0 -58
- package/lib/cjs/wallets/providers/trust.js +0 -4
- package/lib/cjs/wallets/providers/utils.js +0 -32
- package/lib/cjs/wallets/providers/utxo.js +0 -107
- package/lib/cjs/wallets/providers/vulticonnect.js +0 -157
- package/lib/cjs/wallets/providers/vultisig.js +0 -45
- package/lib/cjs/wallets/providers/xaman.js +0 -70
- package/lib/cjs/wallets/storage.js +0 -58
- package/lib/esm/package.json +0 -3
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RangeLiquidityChart = exports.yToPrice = exports.priceToY = exports.clamp = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
require("./RangeLiquidityChart.css");
|
|
7
|
-
const clamp = (v, a, b) => Math.max(a, Math.min(b, v));
|
|
8
|
-
exports.clamp = clamp;
|
|
9
|
-
const priceToY = (price, min, max, height) => {
|
|
10
|
-
// y = 0 at top
|
|
11
|
-
if (max === min)
|
|
12
|
-
return height / 2;
|
|
13
|
-
const p = (price - min) / (max - min);
|
|
14
|
-
return height - p * height;
|
|
15
|
-
};
|
|
16
|
-
exports.priceToY = priceToY;
|
|
17
|
-
const yToPrice = (y, min, max, height) => {
|
|
18
|
-
const p = (0, exports.clamp)(1 - y / height, 0, 1);
|
|
19
|
-
return min + p * (max - min);
|
|
20
|
-
};
|
|
21
|
-
exports.yToPrice = yToPrice;
|
|
22
|
-
const RangeLiquidityChart = ({ width = 900, height = 160, series, leftBuckets = [], rightBuckets = [], minPrice, maxPrice, initialRange, onRangeChange, }) => {
|
|
23
|
-
const svgRef = (0, react_1.useRef)(null);
|
|
24
|
-
const prices = series.map((s) => s.price);
|
|
25
|
-
const minP = minPrice ?? Math.min(...prices);
|
|
26
|
-
const maxP = maxPrice ?? Math.max(...prices);
|
|
27
|
-
const padding = { left: 36, right: 72, top: 12, bottom: 26 };
|
|
28
|
-
const innerW = width - padding.left - padding.right;
|
|
29
|
-
const innerH = height - padding.top - padding.bottom;
|
|
30
|
-
// range state in price units
|
|
31
|
-
const [range, setRange] = (0, react_1.useState)(() => {
|
|
32
|
-
if (initialRange)
|
|
33
|
-
return initialRange;
|
|
34
|
-
// default: center 30% of price span
|
|
35
|
-
const span = maxP - minP;
|
|
36
|
-
return { min: minP + span * 0.35, max: minP + span * 0.65 };
|
|
37
|
-
});
|
|
38
|
-
(0, react_1.useEffect)(() => onRangeChange?.(range), [range, onRangeChange]);
|
|
39
|
-
// line path
|
|
40
|
-
const step = series.length > 1 ? innerW / (series.length - 1) : 0;
|
|
41
|
-
const path = series
|
|
42
|
-
.map((p, i) => {
|
|
43
|
-
const x = padding.left + i * step;
|
|
44
|
-
const y = padding.top + (0, exports.priceToY)(p.price, minP, maxP, innerH);
|
|
45
|
-
return `${i === 0 ? "M" : "L"}${x.toFixed(2)},${y.toFixed(2)}`;
|
|
46
|
-
})
|
|
47
|
-
.join(" ");
|
|
48
|
-
// current price marker at last point
|
|
49
|
-
const last = series[series.length - 1];
|
|
50
|
-
const currentX = padding.left + (series.length - 1) * step;
|
|
51
|
-
const currentY = padding.top + (0, exports.priceToY)(last.price, minP, maxP, innerH);
|
|
52
|
-
// histograms
|
|
53
|
-
const maxBucket = Math.max(1, ...leftBuckets.map((b) => b.value), ...rightBuckets.map((b) => b.value));
|
|
54
|
-
const barWidth = 10;
|
|
55
|
-
// slider interactions
|
|
56
|
-
const dragging = (0, react_1.useRef)(null);
|
|
57
|
-
const onPointerDownHandle = (which, e) => {
|
|
58
|
-
dragging.current = which;
|
|
59
|
-
e.target.setPointerCapture(e.pointerId);
|
|
60
|
-
};
|
|
61
|
-
const onPointerUp = (e) => {
|
|
62
|
-
if (dragging.current) {
|
|
63
|
-
try {
|
|
64
|
-
e.target.releasePointerCapture(e.pointerId);
|
|
65
|
-
}
|
|
66
|
-
catch { }
|
|
67
|
-
}
|
|
68
|
-
dragging.current = null;
|
|
69
|
-
};
|
|
70
|
-
const onPointerMove = (e) => {
|
|
71
|
-
if (!dragging.current || !svgRef.current)
|
|
72
|
-
return;
|
|
73
|
-
const rect = svgRef.current.getBoundingClientRect();
|
|
74
|
-
const y = (0, exports.clamp)(e.clientY - rect.top - padding.top, 0, innerH);
|
|
75
|
-
const price = (0, exports.yToPrice)(y, minP, maxP, innerH);
|
|
76
|
-
if (dragging.current === "min") {
|
|
77
|
-
const v = Math.min(price, range.max - (maxP - minP) * 0.001);
|
|
78
|
-
setRange((r) => ({ ...r, min: (0, exports.clamp)(v, minP, maxP) }));
|
|
79
|
-
}
|
|
80
|
-
else if (dragging.current === "max") {
|
|
81
|
-
const v = Math.max(price, range.min + (maxP - minP) * 0.001);
|
|
82
|
-
setRange((r) => ({ ...r, max: (0, exports.clamp)(v, minP, maxP) }));
|
|
83
|
-
}
|
|
84
|
-
else if (dragging.current === "band") {
|
|
85
|
-
// band drag: compute delta from start
|
|
86
|
-
// Not implemented: simple noop for now
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
// computed y positions for handles
|
|
90
|
-
const yMin = padding.top + (0, exports.priceToY)(range.min, minP, maxP, innerH);
|
|
91
|
-
const yMax = padding.top + (0, exports.priceToY)(range.max, minP, maxP, innerH);
|
|
92
|
-
// build histogram bars
|
|
93
|
-
const leftBars = leftBuckets.map((b) => {
|
|
94
|
-
const y = padding.top + (0, exports.priceToY)(b.price, minP, maxP, innerH);
|
|
95
|
-
const h = Math.max(2, (b.value / maxBucket) * innerH * 0.5);
|
|
96
|
-
return {
|
|
97
|
-
x: padding.left - 8 - barWidth,
|
|
98
|
-
y: y - h / 2,
|
|
99
|
-
w: barWidth,
|
|
100
|
-
h,
|
|
101
|
-
value: b.value,
|
|
102
|
-
};
|
|
103
|
-
});
|
|
104
|
-
const rightBars = rightBuckets.map((b) => {
|
|
105
|
-
const y = padding.top + (0, exports.priceToY)(b.price, minP, maxP, innerH);
|
|
106
|
-
const h = Math.max(2, (b.value / maxBucket) * innerH * 0.5);
|
|
107
|
-
return {
|
|
108
|
-
x: padding.left + innerW + 8,
|
|
109
|
-
y: y - h / 2,
|
|
110
|
-
w: barWidth,
|
|
111
|
-
h,
|
|
112
|
-
value: b.value,
|
|
113
|
-
};
|
|
114
|
-
});
|
|
115
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: "rlc-root", style: { width }, children: (0, jsx_runtime_1.jsxs)("svg", { ref: svgRef, width: width, height: height, onPointerMove: onPointerMove, onPointerUp: onPointerUp, onPointerCancel: onPointerUp, className: "rlc-svg", children: [(0, jsx_runtime_1.jsx)("defs", { children: (0, jsx_runtime_1.jsxs)("linearGradient", { id: "priceGrad", x1: "0", x2: "0", y1: "0", y2: "1", children: [(0, jsx_runtime_1.jsx)("stop", { offset: "0%", stopColor: "#ff55d1", stopOpacity: "0.22" }), (0, jsx_runtime_1.jsx)("stop", { offset: "100%", stopColor: "#ff55d1", stopOpacity: "0.02" })] }) }), (0, jsx_runtime_1.jsx)("rect", { x: padding.left, y: yMax, width: innerW, height: Math.max(1, yMin - yMax), fill: "#ff49c8", opacity: 0.18 }), (0, jsx_runtime_1.jsx)("g", { className: "rlc-bars left", children: leftBars.map((b, i) => ((0, jsx_runtime_1.jsx)("rect", { className: "rlc-bar", x: b.x, y: b.y, width: b.w, height: b.h, rx: 4 }, i))) }), (0, jsx_runtime_1.jsx)("g", { className: "rlc-bars right", children: rightBars.map((b, i) => ((0, jsx_runtime_1.jsx)("rect", { className: "rlc-bar", x: b.x, y: b.y, width: b.w, height: b.h, rx: 4 }, i))) }), (0, jsx_runtime_1.jsx)("path", { d: path, className: "rlc-line", fill: "none", stroke: "#ff57d8", strokeWidth: 2 }), (0, jsx_runtime_1.jsx)("circle", { cx: currentX, cy: currentY, r: 4.5, fill: "#ff7cd9", stroke: "#fff", strokeWidth: 1 }), (0, jsx_runtime_1.jsxs)("g", { className: "rlc-slider", transform: `translate(${padding.left + innerW + 40},0)`, children: [(0, jsx_runtime_1.jsx)("rect", { x: -12, y: padding.top, width: 24, height: innerH, rx: 12, fill: "#2b2b2b", opacity: 0.14 }), (0, jsx_runtime_1.jsx)("rect", { x: -12, y: yMax, width: 24, height: Math.max(4, yMin - yMax), rx: 8, fill: "#ff49c8", opacity: 0.9 }), (0, jsx_runtime_1.jsx)("g", { className: "rlc-handle rlc-handle-min", transform: `translate(0,${yMin})`, onPointerDown: (e) => onPointerDownHandle("min", e), children: (0, jsx_runtime_1.jsx)("circle", { cx: 0, cy: 0, r: 10, fill: "#fff", stroke: "#ff49c8", strokeWidth: 3 }) }), (0, jsx_runtime_1.jsx)("g", { className: "rlc-handle rlc-handle-max", transform: `translate(0,${yMax})`, onPointerDown: (e) => onPointerDownHandle("max", e), children: (0, jsx_runtime_1.jsx)("circle", { cx: 0, cy: 0, r: 10, fill: "#fff", stroke: "#ff49c8", strokeWidth: 3 }) })] })] }) }));
|
|
116
|
-
};
|
|
117
|
-
exports.RangeLiquidityChart = RangeLiquidityChart;
|
|
118
|
-
exports.default = exports.RangeLiquidityChart;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Footer = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const clsx_1 = require("clsx");
|
|
6
|
-
const ResolveLink_1 = require("../header/ResolveLink");
|
|
7
|
-
const Icons_1 = require("../icons/Icons");
|
|
8
|
-
const RujiraLogo_1 = require("../logos/RujiraLogo");
|
|
9
|
-
const Footer = ({ className, domain = "", routerElement, }) => {
|
|
10
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: (0, clsx_1.default)({
|
|
11
|
-
rujira__footer: true,
|
|
12
|
-
[`${className}`]: className,
|
|
13
|
-
}), children: (0, jsx_runtime_1.jsxs)("div", { className: "rujira__inner", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex wrap pad-tight", children: [(0, jsx_runtime_1.jsxs)("div", { className: "col-12 col-xs-6 col-lg-3", children: [(0, jsx_runtime_1.jsx)("h4", { className: "fs-14 lh-18 fw-600 color-white", children: "Everyone" }), (0, jsx_runtime_1.jsxs)("nav", { className: "flex dir-c", children: [(0, jsx_runtime_1.jsx)(ResolveLink_1.ResolveLink, { as: routerElement, domain: domain, to: "merge", children: "Merge" }), (0, jsx_runtime_1.jsx)("a", { href: "https://docs.rujira.network", target: "_blank", children: "Documentation" }), (0, jsx_runtime_1.jsx)("a", { href: "https://docs.rujira.network/resources/branding", target: "_blank", children: "Brand Assets" }), (0, jsx_runtime_1.jsx)("a", { href: "https://thorchain.net", target: "_blank", children: "Blockchain Explorer" }), (0, jsx_runtime_1.jsx)(ResolveLink_1.ResolveLink, { as: routerElement, domain: domain, to: "privacypolicy", children: "Privacy Policy" }), (0, jsx_runtime_1.jsx)(ResolveLink_1.ResolveLink, { as: routerElement, domain: domain, to: "tou", children: "Terms of Use" })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "col-12 col-xs-6 col-lg-3 mt-3 mt-xs-0", children: [(0, jsx_runtime_1.jsx)("h4", { className: "fs-14 lh-18 fw-600 color-white", children: "Developers" }), (0, jsx_runtime_1.jsxs)("nav", { className: "flex dir-c", children: [(0, jsx_runtime_1.jsx)(ResolveLink_1.ResolveLink, { as: routerElement, domain: domain, to: "developer/tools", children: "Developer Tools" }), (0, jsx_runtime_1.jsx)("a", { href: "https://docs.rujira.network/developers/getting-started", target: "_blank", children: "Documentation" }), (0, jsx_runtime_1.jsx)("a", { href: "https://gitlab.com/thorchain/rujira", target: "_blank", children: "GitLab" }), (0, jsx_runtime_1.jsx)("a", { href: "https://gitlab.com/thorchain/rujira-ui", target: "_blank", children: "Rujira.ui" })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "col-12 col-xs-6 col-lg-3 mt-3 mt-lg-0", children: [(0, jsx_runtime_1.jsx)("h4", { className: "fs-14 lh-18 fw-600 color-white", children: "Ecosystem" }), (0, jsx_runtime_1.jsx)("nav", { className: "flex dir-c", children: (0, jsx_runtime_1.jsx)(ResolveLink_1.ResolveLink, { as: routerElement, domain: domain, to: "ecosystem", children: "Built on Rujira" }) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "col-12 col-xs-6 col-lg-3 mt-3 mt-lg-0", children: [(0, jsx_runtime_1.jsx)("h4", { className: "fs-14 lh-18 fw-600 color-white", children: "Community" }), (0, jsx_runtime_1.jsxs)("nav", { className: "flex wrap mt-1", children: [(0, jsx_runtime_1.jsx)("a", { href: "https://x.com/RujiraNetwork", target: "_blank", className: "block px-0.5", children: (0, jsx_runtime_1.jsx)(Icons_1.X, { className: "h-3 w-a" }) }), (0, jsx_runtime_1.jsx)("a", { href: "https://t.me/Rujira_Community", target: "_blank", className: "block px-0.5", children: (0, jsx_runtime_1.jsx)(Icons_1.Telegram, { className: "h-3 w-a" }) }), (0, jsx_runtime_1.jsx)("a", { href: "https://discord.gg/XPvsxhWKfb", target: "_blank", className: "block px-0.5", children: (0, jsx_runtime_1.jsx)(Icons_1.Discord, { className: "h-3 w-a" }) }), (0, jsx_runtime_1.jsx)("a", { href: "https://medium.com/rujiranetwork", target: "_blank", className: "block px-0.5", children: (0, jsx_runtime_1.jsx)(Icons_1.Medium, { className: "h-3 w-a" }) })] }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 lh-16 fw-500 color-grey my-2", children: "Powered by THORChain" })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "mt-4 flex wrap ai-c", children: [(0, jsx_runtime_1.jsx)(RujiraLogo_1.RujiraLogo, { animate: true, textColor: "#fff", className: "block w-a h-4 mr-3" }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 lh-16 fw-500 color-grey my-2", children: "All Rujira brand is in public domain. No rights reserved." })] })] }) }));
|
|
14
|
-
};
|
|
15
|
-
exports.Footer = Footer;
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Wallets = exports.Accounts = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const clsx_1 = require("clsx");
|
|
6
|
-
const react_1 = require("motion/react");
|
|
7
|
-
const react_2 = require("react");
|
|
8
|
-
const react_hot_toast_1 = require("react-hot-toast");
|
|
9
|
-
const react_router_dom_1 = require("react-router-dom");
|
|
10
|
-
const react_tooltip_1 = require("react-tooltip");
|
|
11
|
-
const rujira_js_1 = require("rujira.js");
|
|
12
|
-
const __1 = require("../..");
|
|
13
|
-
const combined_png_1 = require("../../assets/images/combined.png");
|
|
14
|
-
const connect_gif_1 = require("../../assets/images/connect.gif");
|
|
15
|
-
const connect_png_1 = require("../../assets/images/connect.png");
|
|
16
|
-
const GlobalModal_1 = require("../../context/GlobalModal");
|
|
17
|
-
const i18n_1 = require("../../i18n");
|
|
18
|
-
const Icons_1 = require("../icons/Icons");
|
|
19
|
-
const NetworkIcon_1 = require("../icons/NetworkIcon");
|
|
20
|
-
const Fiat_1 = require("../numbers/Fiat");
|
|
21
|
-
const ResolveLink_1 = require("./ResolveLink");
|
|
22
|
-
let referral = localStorage.getItem("referral");
|
|
23
|
-
const Accounts = ({ provider, routingElement, wallets, ProviderIcon, getValue, customActions, }) => {
|
|
24
|
-
const { t } = (0, i18n_1.useTranslation)("header");
|
|
25
|
-
const { accounts: allAccounts, disconnectAll, selected } = provider;
|
|
26
|
-
const [showBlur, setShowBlur] = (0, react_2.useState)(false);
|
|
27
|
-
const { hideModal, showModal } = (0, GlobalModal_1.useGlobalModalContext)();
|
|
28
|
-
const [showBalance, setShowBalance] = (0, __1.useLocalStorage)("rujira-show-balance", "true");
|
|
29
|
-
const accounts = allAccounts?.filter((a) => (0, rujira_js_1.isThor)(a.address));
|
|
30
|
-
const ReferralModal = () => {
|
|
31
|
-
showModal({
|
|
32
|
-
title: t("referAndEarn"),
|
|
33
|
-
backgroundClose: true,
|
|
34
|
-
children: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("p", { className: "p balance", children: t("referralDescription") }), (0, jsx_runtime_1.jsx)("div", { className: "pointer", onClick: () => {
|
|
35
|
-
react_hot_toast_1.default.success(t("referralCopied"));
|
|
36
|
-
navigator.clipboard.writeText(`https://rujira.network/?ref=${referral}`);
|
|
37
|
-
}, children: (0, jsx_runtime_1.jsx)(__1.Input, { value: `https://rujira.network/?ref=${referral}`, readOnly: true, label: t("clickToCopy") }) }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 color-grey mt-2", children: t("referralValidUntil") }), (0, jsx_runtime_1.jsx)("div", { className: "modal__footer mt-4 px-3 py-2 text-right", children: (0, jsx_runtime_1.jsx)(__1.Button, { label: t("close"), onClick: hideModal }) })] })),
|
|
38
|
-
});
|
|
39
|
-
};
|
|
40
|
-
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: !accounts || accounts.length === 0 ? ((0, jsx_runtime_1.jsx)(ConnectAnimation, { children: (0, jsx_runtime_1.jsx)(exports.Wallets, { provider: provider, routingElement: routingElement, wallets: wallets }) })) : ((0, jsx_runtime_1.jsxs)(MyAccount, { routingElement: routingElement, provider: provider, value: selected
|
|
41
|
-
? getValue({
|
|
42
|
-
address: selected.address,
|
|
43
|
-
network: "THOR",
|
|
44
|
-
})
|
|
45
|
-
: false, onHide: () => setShowBlur(false), children: [selected ? ((0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, to: "portfolio", className: "balance", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex ai-b", children: showBalance === "true" ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Fiat_1.Fiat, { amount: getValue({
|
|
46
|
-
address: selected.address,
|
|
47
|
-
network: "THOR",
|
|
48
|
-
}), decimals: 12, symbol: "~$", padSymbol: false, className: "color-white fs-26 condensed" }), (0, jsx_runtime_1.jsx)("button", { className: "transparent ml-1 color-grey hover-white", onClick: (e) => {
|
|
49
|
-
e.stopPropagation();
|
|
50
|
-
e.preventDefault();
|
|
51
|
-
setShowBalance("false");
|
|
52
|
-
return false;
|
|
53
|
-
}, style: { marginRight: "-1rem" }, children: (0, jsx_runtime_1.jsx)(Icons_1.Eye, { className: "w-2 h-2" }) })] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { className: "fiat color-grey fs-22", style: { fontFamily: "monospace" }, children: "****" }), (0, jsx_runtime_1.jsx)("button", { className: "transparent ml-1 color-grey hover-white", onClick: (e) => {
|
|
54
|
-
e.stopPropagation();
|
|
55
|
-
e.preventDefault();
|
|
56
|
-
setShowBalance("true");
|
|
57
|
-
return false;
|
|
58
|
-
}, style: { marginRight: "-1rem" }, children: (0, jsx_runtime_1.jsx)(Icons_1.EyeSlash, { className: "w-2 h-2" }) })] })) }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 condensed color-grey mt-0.5", children: t("viewPortfolio") })] })) : null, accounts.map((account) => ((0, jsx_runtime_1.jsx)(AddressC, { provider: provider, ProviderIcon: ProviderIcon, account: account, selected: selected?.address === account.address &&
|
|
59
|
-
selected.provider === account.provider }, account.address + account.provider))), (0, jsx_runtime_1.jsxs)("nav", { className: "actions", children: [referral && ((0, jsx_runtime_1.jsxs)("button", { className: "action transparent", onClick: ReferralModal, children: [(0, jsx_runtime_1.jsx)(Icons_1.Users, {}), (0, jsx_runtime_1.jsx)("span", { children: t("referralLink") })] })), (0, jsx_runtime_1.jsxs)(react_router_dom_1.Link, { className: "action transparent", to: "connect", children: [(0, jsx_runtime_1.jsx)(Icons_1.Plus, {}), (0, jsx_runtime_1.jsx)("span", { children: t("connectAnotherWallet") })] }), customActions &&
|
|
60
|
-
customActions.map((e, index) => (0, react_2.cloneElement)(e, { key: index })), (0, jsx_runtime_1.jsxs)("button", { className: "action transparent", onClick: disconnectAll, children: [(0, jsx_runtime_1.jsx)(Icons_1.LinkDisconnect, {}), (0, jsx_runtime_1.jsx)("span", { children: t("disconnectAll") })] })] }), showBlur && (0, jsx_runtime_1.jsx)("div", { className: "blur" })] })) }));
|
|
61
|
-
};
|
|
62
|
-
exports.Accounts = Accounts;
|
|
63
|
-
/* const Component = forwardRef<HTMLAnchorElement, ComponentProps<typeof Link>>((props, ref) => {
|
|
64
|
-
return <Link {...props} ref={ref} />;
|
|
65
|
-
}); */
|
|
66
|
-
const ConnectAnimation = ({ children }) => {
|
|
67
|
-
const { t } = (0, i18n_1.useTranslation)("header");
|
|
68
|
-
const [show, setShow] = (0, react_2.useState)(false);
|
|
69
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "relative py-q1 no-underline", onMouseOver: () => setShow(true), onMouseOut: () => setShow(false), children: [(0, jsx_runtime_1.jsxs)("div", { className: "rujira-header__connect", children: [(0, jsx_runtime_1.jsx)("div", { className: "fs-14 fw-500 fs-15 condensed", children: t("connect") }), (0, jsx_runtime_1.jsx)("img", { className: "w-3 h-3 filter-white", src: show ? connect_gif_1.default : connect_png_1.default, alt: "Connect" })] }), (0, jsx_runtime_1.jsx)(react_1.AnimatePresence, { children: show && ((0, jsx_runtime_1.jsxs)(react_1.motion.div, { className: "rujira-header__popup right condensed w-32 text-center p-2", initial: { opacity: 0, marginTop: -4 }, animate: { opacity: 1, marginTop: 4 }, exit: { opacity: 0, marginTop: -4 }, children: [(0, jsx_runtime_1.jsx)("p", { className: "color-white", children: t("connectYourWallet") }), (0, jsx_runtime_1.jsx)("small", { className: "color-grey mb-1", children: t("createOrConnectWallet") }), children] })) })] }));
|
|
70
|
-
};
|
|
71
|
-
const Wallets = ({ modalLayout = false, provider, routingElement, wallets, }) => {
|
|
72
|
-
const { t } = (0, i18n_1.useTranslation)("header");
|
|
73
|
-
const { connect, isAvaialable } = provider;
|
|
74
|
-
const { hideModal } = (0, GlobalModal_1.useGlobalModalContext)();
|
|
75
|
-
const [first, ...rest] = wallets;
|
|
76
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "rujira-header__wallets", children: [(0, jsx_runtime_1.jsx)("div", { className: (0, clsx_1.default)({
|
|
77
|
-
"flex w-full ai-c jc-c wrap": true,
|
|
78
|
-
"mb-1": modalLayout,
|
|
79
|
-
}), children: (0, jsx_runtime_1.jsx)("button", { id: "connect-station", "data-tooltip-content": "Coming Soon...", "data-tooltip-id": "wallet-tip", className: (0, clsx_1.default)({
|
|
80
|
-
"transparent block pointer medium": true,
|
|
81
|
-
"desaturate opacity-10": !first?.provider,
|
|
82
|
-
}), disabled: !first?.provider, onClick: () => {
|
|
83
|
-
first?.provider && connect(first?.provider).then(hideModal);
|
|
84
|
-
}, children: first?.icon }) }), (0, jsx_runtime_1.jsx)("div", { className: "flex w-full ai-c jc-c wrap", children: rest.map((x) => {
|
|
85
|
-
const disabled = x.provider ? !isAvaialable(x.provider) : true;
|
|
86
|
-
return ((0, jsx_runtime_1.jsx)("button", { id: `connect-${x.label}`, "data-tooltip-content": x.label, "data-tooltip-id": "wallet-tip", className: (0, clsx_1.default)({
|
|
87
|
-
"transparent block pointer": true,
|
|
88
|
-
medium: modalLayout,
|
|
89
|
-
"desaturate opacity-10": disabled,
|
|
90
|
-
}), onClick: () => {
|
|
91
|
-
if (disabled && x.url) {
|
|
92
|
-
window.open(x.url, "_blank");
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
x.provider && connect(x.provider).then(hideModal);
|
|
96
|
-
}, children: x.icon }, x.label));
|
|
97
|
-
}) }), (0, jsx_runtime_1.jsx)("hr", { className: (0, clsx_1.default)({
|
|
98
|
-
hr: true,
|
|
99
|
-
"mt-0 mb-1": !modalLayout,
|
|
100
|
-
"my-2": modalLayout,
|
|
101
|
-
}) }), (0, jsx_runtime_1.jsx)(ResolveLink_1.ResolveLink, { as: routingElement, to: "ecosystem/wallets", onClick: hideModal, children: t("needHelpDeciding") })] }), (0, jsx_runtime_1.jsx)(react_tooltip_1.Tooltip, { id: "wallet-tip", className: "tooltip" })] }));
|
|
102
|
-
};
|
|
103
|
-
exports.Wallets = Wallets;
|
|
104
|
-
const MyAccount = ({ provider, children, onHide, routingElement, value, }) => {
|
|
105
|
-
const [show, setShow] = (0, react_2.useState)(false);
|
|
106
|
-
const { accounts, selected } = provider;
|
|
107
|
-
const [showBalance] = (0, __1.useLocalStorage)("rujira-show-balance", "true");
|
|
108
|
-
(0, react_2.useEffect)(() => {
|
|
109
|
-
onHide();
|
|
110
|
-
}, [show]);
|
|
111
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "relative py-q1", onMouseEnter: () => setShow(true), onMouseLeave: () => setShow(false), children: [(0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, to: "portfolio", className: "rujira-header__pfp", children: [value !== false && showBalance === "true" && ((0, jsx_runtime_1.jsx)(Fiat_1.Fiat, { amount: value, symbol: "~$", decimals: 12, padSymbol: false })), selected && (0, jsx_runtime_1.jsx)(NetworkIcon_1.NetworkIcon, { network: "THOR" }), accounts?.length && !selected && (0, jsx_runtime_1.jsx)("img", { src: combined_png_1.default, alt: "combined" }), provider.isLoading && (0, jsx_runtime_1.jsx)(__1.Spinner, {})] }), (0, jsx_runtime_1.jsx)(react_1.AnimatePresence, { children: show && ((0, jsx_runtime_1.jsx)(react_1.motion.div, { className: "rujira-header__popup right condensed p-1.5 br-2", initial: { opacity: 0, marginTop: -4, right: -8 }, animate: { opacity: 1, marginTop: 4, right: -8 }, exit: { opacity: 0, marginTop: -4, right: -8 }, children: children })) })] }));
|
|
112
|
-
};
|
|
113
|
-
const AddressC = ({ account, selected, provider, ProviderIcon, }) => {
|
|
114
|
-
const { t } = (0, i18n_1.useTranslation)("header");
|
|
115
|
-
const { select, disconnect } = provider;
|
|
116
|
-
const [hover, setHover] = (0, react_2.useState)(false);
|
|
117
|
-
return ((0, jsx_runtime_1.jsxs)("div", { onMouseOver: () => setHover(true), onMouseOut: () => setHover(false), className: (0, clsx_1.default)({
|
|
118
|
-
"flex ai-c px-1 address": true,
|
|
119
|
-
"address--selected": selected,
|
|
120
|
-
}), children: [(0, jsx_runtime_1.jsx)(NetworkIcon_1.NetworkIcon, { network: "THOR", className: "address__wallet", selected: selected || hover }), (0, jsx_runtime_1.jsx)("p", { className: "address__address pointer", onClick: () => {
|
|
121
|
-
if (selected) {
|
|
122
|
-
react_hot_toast_1.default.success(t("addressCopied"));
|
|
123
|
-
navigator.clipboard.writeText(account.address);
|
|
124
|
-
}
|
|
125
|
-
else {
|
|
126
|
-
select(account);
|
|
127
|
-
}
|
|
128
|
-
}, children: hover && selected ? (t("copyAddress")) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [account.address.substring(0, 8), " ... ", account.address.slice(-8)] })) }), hover ? ((0, jsx_runtime_1.jsx)(Icons_1.LinkDisconnect, { className: "address__disconnect", onClick: () => disconnect(account.provider) })) : ((0, jsx_runtime_1.jsx)(ProviderIcon, { className: "address__disconnect", provider: account.provider, selected: selected }))] }));
|
|
129
|
-
};
|
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.MobileNav = exports.MainNav = exports.Logo = exports.Container = exports.Header = void 0;
|
|
18
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
-
const clsx_1 = require("clsx");
|
|
20
|
-
const react_1 = require("motion/react");
|
|
21
|
-
const react_2 = require("react");
|
|
22
|
-
const vaul_1 = require("vaul");
|
|
23
|
-
const deposit_gif_1 = require("../../assets/images/deposit.gif");
|
|
24
|
-
const deposit_png_1 = require("../../assets/images/deposit.png");
|
|
25
|
-
const GlobalModal_1 = require("../../context/GlobalModal");
|
|
26
|
-
const useWindowSize_1 = require("../../hooks/useWindowSize");
|
|
27
|
-
const i18n_1 = require("../../i18n");
|
|
28
|
-
const Icons_1 = require("../icons/Icons");
|
|
29
|
-
const RujiraLogo_1 = require("../logos/RujiraLogo");
|
|
30
|
-
const Accounts_1 = require("./Accounts");
|
|
31
|
-
const Pending_1 = require("./Pending");
|
|
32
|
-
const ResolveLink_1 = require("./ResolveLink");
|
|
33
|
-
__exportStar(require("./Accounts"), exports);
|
|
34
|
-
__exportStar(require("./QuickLauncher"), exports);
|
|
35
|
-
const Header = ({ accountProvider, className, domain = "", routingElement, wallets, ProviderIcon, onDeposit, deposits, getAccountValue, customActions, }) => {
|
|
36
|
-
const { t } = (0, i18n_1.useTranslation)("header");
|
|
37
|
-
const [hover, setHover] = (0, react_2.useState)(false);
|
|
38
|
-
const [isScrolled, setIsScrolled] = (0, react_2.useState)(false);
|
|
39
|
-
const [scrollY, setScrollY] = (0, react_2.useState)(0);
|
|
40
|
-
const { accounts } = accountProvider;
|
|
41
|
-
const { showModal } = (0, GlobalModal_1.useGlobalModalContext)();
|
|
42
|
-
(0, react_2.useEffect)(() => {
|
|
43
|
-
const handleScroll = () => {
|
|
44
|
-
setIsScrolled(window.scrollY > 56);
|
|
45
|
-
setScrollY(window.scrollY <= 56 ? window.scrollY : 56);
|
|
46
|
-
};
|
|
47
|
-
window.addEventListener("scroll", handleScroll);
|
|
48
|
-
return () => {
|
|
49
|
-
window.removeEventListener("scroll", handleScroll);
|
|
50
|
-
};
|
|
51
|
-
}, []);
|
|
52
|
-
const ConnectModal = () => {
|
|
53
|
-
showModal({
|
|
54
|
-
title: t("connectYourAccount"),
|
|
55
|
-
backgroundClose: true,
|
|
56
|
-
children: ((0, jsx_runtime_1.jsx)(i18n_1.TranslationProvider, { namespace: "header", children: (0, jsx_runtime_1.jsx)(Accounts_1.Wallets, { modalLayout: true, provider: accountProvider, wallets: wallets }) })),
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
return ((0, jsx_runtime_1.jsxs)(exports.Container, { style: { backgroundColor: `rgba(15, 17, 23, ${(scrollY / 56) * 0.9})` }, className: (0, clsx_1.default)({
|
|
60
|
-
[`${className}`]: className,
|
|
61
|
-
"rujira-header--scrolled": isScrolled,
|
|
62
|
-
}), children: [(0, jsx_runtime_1.jsx)(ResolveLink_1.ResolveLink, { as: routingElement, to: ".", children: (0, jsx_runtime_1.jsx)(exports.Logo, {}) }), (0, jsx_runtime_1.jsx)(exports.MainNav, { domain: domain, accountProvider: accountProvider, routingElement: routingElement }), (0, jsx_runtime_1.jsxs)("div", { className: "ml-a mr-0 flex ai-c gradient-card-container", children: [deposits && (0, jsx_runtime_1.jsx)(Pending_1.PendingDeposits, { ...deposits }), onDeposit && ((0, jsx_runtime_1.jsxs)("button", { id: "deposit", className: "transparent rujira-header__deposit condensed", onMouseOver: () => setHover(true), onMouseOut: () => setHover(false), onClick: () => {
|
|
63
|
-
accounts?.length === 0 ? ConnectModal() : onDeposit();
|
|
64
|
-
}, children: [(0, jsx_runtime_1.jsx)("img", { src: hover ? deposit_gif_1.default : deposit_png_1.default, alt: "Deposit" }), (0, jsx_runtime_1.jsx)("span", { children: t("deposit") })] })), (0, jsx_runtime_1.jsx)(Accounts_1.Accounts, { provider: accountProvider, ProviderIcon: ProviderIcon, routingElement: routingElement, wallets: wallets, getValue: getAccountValue,
|
|
65
|
-
//hideNetworkSwitch={hideNetworkSwitch}
|
|
66
|
-
customActions: customActions })] }), (0, jsx_runtime_1.jsx)(exports.MobileNav, { domain: domain, routingElement: routingElement, accountProvider: accountProvider })] }));
|
|
67
|
-
};
|
|
68
|
-
exports.Header = Header;
|
|
69
|
-
const Container = ({ children, className, style = {} }) => {
|
|
70
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: (0, clsx_1.default)({
|
|
71
|
-
"rujira-header": true,
|
|
72
|
-
[`${className}`]: className,
|
|
73
|
-
}), style: style, children: children }));
|
|
74
|
-
};
|
|
75
|
-
exports.Container = Container;
|
|
76
|
-
const Logo = () => {
|
|
77
|
-
const size = (0, useWindowSize_1.useWindowSize)();
|
|
78
|
-
return ((0, jsx_runtime_1.jsx)(RujiraLogo_1.RujiraLogo, { textColor: "#fff", className: "rujira-header__logo", showText: size.width >= 520, animate: true }));
|
|
79
|
-
};
|
|
80
|
-
exports.Logo = Logo;
|
|
81
|
-
const MainNav = ({ domain,
|
|
82
|
-
//accountProvider,
|
|
83
|
-
routingElement, }) => {
|
|
84
|
-
const { t } = (0, i18n_1.useTranslation)("header");
|
|
85
|
-
//const { accounts } = accountProvider;
|
|
86
|
-
const [showTrade, setShowTrade] = (0, react_2.useState)(false);
|
|
87
|
-
const [showEarn, setShowEarn] = (0, react_2.useState)(false);
|
|
88
|
-
const [showBorrow, setShowBorrow] = (0, react_2.useState)(false);
|
|
89
|
-
const [showUtilities, setShowUtilities] = (0, react_2.useState)(false);
|
|
90
|
-
const [showEntertainment, setShowEntertainment] = (0, react_2.useState)(false);
|
|
91
|
-
const [showLearn, setShowLearn] = (0, react_2.useState)(false);
|
|
92
|
-
const trade = (0, react_2.useRef)(null);
|
|
93
|
-
const earn = (0, react_2.useRef)(null);
|
|
94
|
-
const borrow = (0, react_2.useRef)(null);
|
|
95
|
-
const utilities = (0, react_2.useRef)(null);
|
|
96
|
-
const entertainment = (0, react_2.useRef)(null);
|
|
97
|
-
const learn = (0, react_2.useRef)(null);
|
|
98
|
-
(0, react_2.useEffect)(() => {
|
|
99
|
-
if (showTrade ||
|
|
100
|
-
showBorrow ||
|
|
101
|
-
showUtilities ||
|
|
102
|
-
showEarn ||
|
|
103
|
-
showEntertainment ||
|
|
104
|
-
showLearn) {
|
|
105
|
-
let popup = null;
|
|
106
|
-
if (showTrade) {
|
|
107
|
-
popup = trade.current;
|
|
108
|
-
}
|
|
109
|
-
else if (showEarn) {
|
|
110
|
-
popup = earn.current;
|
|
111
|
-
}
|
|
112
|
-
else if (showBorrow) {
|
|
113
|
-
popup = borrow.current;
|
|
114
|
-
}
|
|
115
|
-
else if (showUtilities) {
|
|
116
|
-
popup = utilities.current;
|
|
117
|
-
}
|
|
118
|
-
else if (showEntertainment) {
|
|
119
|
-
popup = entertainment.current;
|
|
120
|
-
}
|
|
121
|
-
else if (showLearn) {
|
|
122
|
-
popup = learn.current;
|
|
123
|
-
}
|
|
124
|
-
if (popup) {
|
|
125
|
-
const box = popup.getBoundingClientRect();
|
|
126
|
-
const body = document.body;
|
|
127
|
-
const docEl = document.documentElement;
|
|
128
|
-
const scrollLeft = window.scrollX || docEl.scrollLeft || body.scrollLeft;
|
|
129
|
-
const clientLeft = docEl.clientLeft || body.clientLeft || 0;
|
|
130
|
-
const left = box.left + scrollLeft - clientLeft;
|
|
131
|
-
if (left + box.width > window.innerWidth - 20) {
|
|
132
|
-
const diff = Math.round(left + box.width - window.innerWidth + 20);
|
|
133
|
-
popup.style.transform = "translateX(-" + diff + "px)";
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
}, [
|
|
138
|
-
showTrade,
|
|
139
|
-
showBorrow,
|
|
140
|
-
showUtilities,
|
|
141
|
-
showEarn,
|
|
142
|
-
showEntertainment,
|
|
143
|
-
showLearn,
|
|
144
|
-
]);
|
|
145
|
-
return ((0, jsx_runtime_1.jsxs)("nav", { className: "rujira-header__nav", children: [(0, jsx_runtime_1.jsxs)("span", { onMouseOver: () => setShowTrade(true), onMouseOut: () => setShowTrade(false), children: [t("trade"), (0, jsx_runtime_1.jsx)(Icons_1.AngleDown, {}), (0, jsx_runtime_1.jsx)(react_1.AnimatePresence, { children: showTrade && ((0, jsx_runtime_1.jsx)(SubTrade, { useRef: trade, domain: domain, routingElement: routingElement })) })] }), (0, jsx_runtime_1.jsxs)("span", { onMouseOver: () => setShowEarn(true), onMouseOut: () => setShowEarn(false), children: [t("earn"), (0, jsx_runtime_1.jsx)(Icons_1.AngleDown, {}), (0, jsx_runtime_1.jsx)(react_1.AnimatePresence, { children: showEarn && ((0, jsx_runtime_1.jsx)(SubEarn, { useRef: earn, domain: domain, routingElement: routingElement })) })] }), (0, jsx_runtime_1.jsxs)("span", { onMouseOver: () => setShowBorrow(true), onMouseOut: () => setShowBorrow(false), children: [t("borrow"), (0, jsx_runtime_1.jsx)(Icons_1.AngleDown, {}), (0, jsx_runtime_1.jsx)(react_1.AnimatePresence, { children: showBorrow && ((0, jsx_runtime_1.jsx)(SubBorrow, { useRef: borrow, domain: domain, routingElement: routingElement })) })] }), (0, jsx_runtime_1.jsxs)("span", { onMouseOver: () => setShowUtilities(true), onMouseOut: () => setShowUtilities(false), children: [t("utilities"), (0, jsx_runtime_1.jsx)(Icons_1.AngleDown, {}), (0, jsx_runtime_1.jsx)(react_1.AnimatePresence, { children: showUtilities && ((0, jsx_runtime_1.jsx)(SubUtilities, { useRef: utilities, domain: domain, routingElement: routingElement })) })] }), (0, jsx_runtime_1.jsxs)("span", { onMouseOver: () => setShowEntertainment(true), onMouseOut: () => setShowEntertainment(false), children: [t("entertainment"), (0, jsx_runtime_1.jsx)(Icons_1.AngleDown, {}), (0, jsx_runtime_1.jsx)(react_1.AnimatePresence, { children: showEntertainment && ((0, jsx_runtime_1.jsx)(SubEntertainment, { useRef: entertainment, domain: domain, routingElement: routingElement })) })] }), (0, jsx_runtime_1.jsxs)("span", { onMouseOver: () => setShowLearn(true), onMouseOut: () => setShowLearn(false), children: [t("learnAndHelp"), (0, jsx_runtime_1.jsx)(Icons_1.AngleDown, {}), (0, jsx_runtime_1.jsx)(react_1.AnimatePresence, { children: showLearn && ((0, jsx_runtime_1.jsx)(SubLearn, { useRef: learn, domain: domain, routingElement: routingElement })) })] })] }));
|
|
146
|
-
};
|
|
147
|
-
exports.MainNav = MainNav;
|
|
148
|
-
const MobileNav = ({ domain, routingElement, accountProvider, }) => {
|
|
149
|
-
const { t } = (0, i18n_1.useTranslation)("header");
|
|
150
|
-
const [showDrawer, setShowDrawer] = (0, react_2.useState)(false);
|
|
151
|
-
const { accounts } = accountProvider;
|
|
152
|
-
/*const mobile = useRef<HTMLDivElement | null>(null);
|
|
153
|
-
|
|
154
|
-
useEffect(() => {
|
|
155
|
-
if (showMobile) {
|
|
156
|
-
document.body.style.overflow = "hidden";
|
|
157
|
-
} else {
|
|
158
|
-
document.body.style.overflow = "auto";
|
|
159
|
-
}
|
|
160
|
-
}, [showMobile]);*/
|
|
161
|
-
let url = location.href;
|
|
162
|
-
document.body.addEventListener("click", () => {
|
|
163
|
-
requestAnimationFrame(() => {
|
|
164
|
-
if (url !== location.href) {
|
|
165
|
-
setShowDrawer(false);
|
|
166
|
-
url = location.href;
|
|
167
|
-
}
|
|
168
|
-
});
|
|
169
|
-
}, true);
|
|
170
|
-
return ((0, jsx_runtime_1.jsxs)(vaul_1.Drawer.Root, { direction: "left", open: showDrawer, onOpenChange: (open) => setShowDrawer(open), children: [(0, jsx_runtime_1.jsx)("button", { className: "rujira-header__hamburger", onClick: () => setShowDrawer(true), children: (0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 448 512", children: (0, jsx_runtime_1.jsx)("path", { d: "M0 64H448v48H0V64zM0 224H448v48H0V224zM448 384v48H0V384H448z", fill: "currentColor" }) }) }), (0, jsx_runtime_1.jsxs)(vaul_1.Drawer.Portal, { children: [(0, jsx_runtime_1.jsx)(vaul_1.Drawer.Overlay, { className: "drawer__overlay" }), (0, jsx_runtime_1.jsxs)(vaul_1.Drawer.Content, { className: "drawer__content drawer__content--left", children: [(0, jsx_runtime_1.jsx)(vaul_1.Drawer.Description, { className: "visually-hidden", children: "Main navigation menu" }), (0, jsx_runtime_1.jsx)(vaul_1.Drawer.Title, { className: "visually-hidden", children: "Main Menu" }), (0, jsx_runtime_1.jsxs)("div", { className: "drawer__card mobile-drawer", children: [(0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, domain: domain, to: ".", className: "flex ai-c", children: [(0, jsx_runtime_1.jsx)(Icons_1.Home, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("h4", { className: "fs-14 fw-600", children: t("home") }) })] }), accounts && accounts.length > 0 && ((0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, domain: domain, to: "portfolio", className: "flex ai-c mt-2", children: [(0, jsx_runtime_1.jsx)(Icons_1.Coins, { className: "color-grey h-3.5 w-a block mr-2 no-shrink" }), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("h4", { className: "fs-14 fw-600", children: t("portfolio") }) })] })), (0, jsx_runtime_1.jsx)("h4", { children: t("trade") }), (0, jsx_runtime_1.jsx)(SubTrade, { useRef: (0, react_2.useRef)(null), domain: domain, routingElement: routingElement, className: "" }), (0, jsx_runtime_1.jsx)("h4", { children: t("earn") }), (0, jsx_runtime_1.jsx)(SubEarn, { useRef: (0, react_2.useRef)(null), domain: domain, routingElement: routingElement, className: "" }), (0, jsx_runtime_1.jsx)("h4", { children: t("borrow") }), (0, jsx_runtime_1.jsx)(SubBorrow, { useRef: (0, react_2.useRef)(null), domain: domain, routingElement: routingElement, className: "" }), (0, jsx_runtime_1.jsx)("h4", { children: t("utilities") }), (0, jsx_runtime_1.jsx)(SubUtilities, { useRef: (0, react_2.useRef)(null), domain: domain, routingElement: routingElement, className: "" }), (0, jsx_runtime_1.jsx)("h4", { children: t("entertainment") }), (0, jsx_runtime_1.jsx)(SubEntertainment, { useRef: (0, react_2.useRef)(null), domain: domain, routingElement: routingElement, className: "" }), (0, jsx_runtime_1.jsx)("h4", { children: t("learnAndHelp") }), (0, jsx_runtime_1.jsx)(SubLearn, { useRef: (0, react_2.useRef)(null), domain: domain, routingElement: routingElement, className: "" })] })] })] })] }));
|
|
171
|
-
};
|
|
172
|
-
exports.MobileNav = MobileNav;
|
|
173
|
-
const Popup = ({ children, useRef, className = "rujira-header__popup sub-nav fw-400 p-2", }) => ((0, jsx_runtime_1.jsx)(react_1.motion.div, { ref: useRef, className: className, initial: { opacity: 0, marginTop: -4 }, animate: { opacity: 1, marginTop: 0 }, exit: { opacity: 0, marginTop: -4 }, children: children }));
|
|
174
|
-
const SubTrade = ({ domain, routingElement, useRef, className }) => {
|
|
175
|
-
const { t } = (0, i18n_1.useTranslation)("header");
|
|
176
|
-
return ((0, jsx_runtime_1.jsx)(Popup, { useRef: useRef, className: className, children: (0, jsx_runtime_1.jsxs)("div", { className: "grid w-60 mt-1", children: [(0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, domain: domain, to: "swap", className: "flex ai-s", children: [(0, jsx_runtime_1.jsx)(Icons_1.Swap, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h4", { className: "fs-14 fw-600", children: t("tokenSwap") }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("tokenSwapDesc") })] })] }), (0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, domain: domain, to: "trade", className: "flex ai-s", children: [(0, jsx_runtime_1.jsx)(Icons_1.Chart, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h4", { className: "fs-14 fw-600", children: t("spotTrading") }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("spotTradingDesc") })] })] }), (0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, domain: domain, to: "/perps/trade", className: "flex ai-s", children: [(0, jsx_runtime_1.jsx)(Icons_1.ChartUpDown, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h4", { className: "fs-14 fw-600", children: t("perps") }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("perpsDesc") })] })] }), (0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, domain: domain, to: "index", className: "flex ai-s", children: [(0, jsx_runtime_1.jsx)(Icons_1.PieChart, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h4", { className: "fs-14 fw-600", children: t("index") }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("indexDesc") })] })] }), (0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, domain: domain, to: "options", className: "flex ai-s", children: [(0, jsx_runtime_1.jsx)(Icons_1.ChartUp, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h4", { className: "fs-14 fw-600 flex ai-c", children: t("options") }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("optionsDesc") })] })] })] }) }));
|
|
177
|
-
};
|
|
178
|
-
const SubEarn = ({ domain, routingElement, useRef, className }) => {
|
|
179
|
-
const { t } = (0, i18n_1.useTranslation)("header");
|
|
180
|
-
return ((0, jsx_runtime_1.jsx)(Popup, { useRef: useRef, className: className, children: (0, jsx_runtime_1.jsxs)("div", { className: "grid w-60 mt-1", children: [(0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, domain: domain, to: "strategies/staking/RUJI", className: "flex ai-s", children: [(0, jsx_runtime_1.jsx)(Icons_1.Stake, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h4", { className: "fs-14 fw-600", children: t("stake") }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("stakeDesc") })] })] }), (0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, domain: domain, to: "strategies", className: "flex ai-s", children: [(0, jsx_runtime_1.jsx)(Icons_1.Building, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h4", { className: "fs-14 fw-600", children: t("strategies") }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("strategiesDesc") })] })] }), (0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, domain: domain, to: "liquidate", className: "flex", children: [(0, jsx_runtime_1.jsx)(Icons_1.Gavel, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h4", { className: "fs-14 fw-600", children: t("liquidate") }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("liquidateDesc") })] })] }), (0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, domain: domain, to: "launchpad", className: "flex ai-s", children: [(0, jsx_runtime_1.jsx)(Icons_1.Seedling, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h4", { className: "fs-14 fw-600 flex ai-c", children: t("launchpad") }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("launchpadDesc") })] })] })] }) }));
|
|
181
|
-
};
|
|
182
|
-
const SubBorrow = ({ domain, routingElement, useRef, className }) => {
|
|
183
|
-
const { t } = (0, i18n_1.useTranslation)("header");
|
|
184
|
-
return ((0, jsx_runtime_1.jsx)(Popup, { useRef: useRef, className: className, children: (0, jsx_runtime_1.jsxs)("div", { className: "grid w-60 mt-1", children: [(0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, domain: domain, to: "borrow", className: "flex ai-s", children: [(0, jsx_runtime_1.jsx)(Icons_1.MoneyTransfer, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h4", { className: "fs-14 fw-600 flex ai-c", children: t("borrowMenu") }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("borrowDesc") })] })] }), (0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, domain: domain, to: "mint", className: "flex ai-s", children: [(0, jsx_runtime_1.jsx)(Icons_1.Deposit, { className: "color-grey h-a w-3 block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h4", { className: "fs-14 fw-600", children: t("mintStablecoin") }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("mintStablecoinDesc") })] })] })] }) }));
|
|
185
|
-
};
|
|
186
|
-
const SubUtilities = ({ domain, routingElement, useRef, className, }) => {
|
|
187
|
-
const { t } = (0, i18n_1.useTranslation)("header");
|
|
188
|
-
return ((0, jsx_runtime_1.jsx)(Popup, { useRef: useRef, className: className, children: (0, jsx_runtime_1.jsxs)("div", { className: "grid w-60 mt-1", children: [(0, jsx_runtime_1.jsxs)("a", { href: "https://ai.autorujira.app/", target: "_blank", className: "flex ai-s", children: [(0, jsx_runtime_1.jsx)(Icons_1.Terminal, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("h4", { className: "fs-14 fw-600", children: [t("rujiAi"), (0, jsx_runtime_1.jsx)(Icons_1.External, { className: "h-1.5 w-a ml-1" })] }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("rujiAiDesc") })] })] }), (0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, domain: domain, to: "dashboard", className: "flex ai-s", children: [(0, jsx_runtime_1.jsx)(Icons_1.ChartMixed, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h4", { className: "fs-14 fw-600", children: t("analytics") }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("analyticsDesc") })] })] }), (0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, domain: domain, to: "buy", className: "flex", children: [(0, jsx_runtime_1.jsx)(Icons_1.CreditCard, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h4", { className: "fs-14 fw-600", children: t("buyCrypto") }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("buyCryptoDesc") })] })] }), (0, jsx_runtime_1.jsxs)("a", { href: "https://daodao.zone", target: "_blank", className: "flex ai-s", children: [(0, jsx_runtime_1.jsx)(Icons_1.Users, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("h4", { className: "fs-14 fw-600 flex ai-c", children: [t("daodao"), " ", (0, jsx_runtime_1.jsx)(Icons_1.External, { className: "h-1.5 w-a ml-1" })] }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("daodaoDesc") })] })] })] }) }));
|
|
189
|
-
};
|
|
190
|
-
const SubEntertainment = ({ domain, routingElement, useRef, className, }) => {
|
|
191
|
-
const { t } = (0, i18n_1.useTranslation)("header");
|
|
192
|
-
return ((0, jsx_runtime_1.jsx)(Popup, { useRef: useRef, className: className, children: (0, jsx_runtime_1.jsxs)("div", { className: "grid w-60 mt-1", children: [(0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, domain: domain, to: "leaderboard", className: "flex ai-s", children: [(0, jsx_runtime_1.jsx)(Icons_1.Trophy, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h4", { className: "fs-14 fw-600", children: t("leagues") }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("leaguesDesc") })] })] }), (0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, domain: domain, to: "games", className: "flex ai-s", children: [(0, jsx_runtime_1.jsx)(Icons_1.Gamepad, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h4", { className: "fs-14 fw-600", children: t("games") }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("gamesDesc") })] })] }), (0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, domain: domain, to: "predict", className: "flex", children: [(0, jsx_runtime_1.jsx)(Icons_1.ChartUser, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h4", { className: "fs-14 fw-600", children: t("predict") }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("predictDesc") })] })] }), (0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, domain: domain, to: "omniverse", className: "flex", children: [(0, jsx_runtime_1.jsx)(Icons_1.Nodes, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h4", { className: "fs-14 fw-600", children: t("omniverse") }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("omniverseDesc") })] })] }), (0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, domain: domain, to: "nfts", className: "flex ai-s", children: [(0, jsx_runtime_1.jsx)(Icons_1.NFT, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h4", { className: "fs-14 fw-600 flex ai-c", children: t("collections") }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("collectionsDesc") })] })] })] }) }));
|
|
193
|
-
};
|
|
194
|
-
const SubLearn = ({ domain, routingElement, useRef, className }) => {
|
|
195
|
-
const { t } = (0, i18n_1.useTranslation)("header");
|
|
196
|
-
return ((0, jsx_runtime_1.jsx)(Popup, { useRef: useRef, className: className, children: (0, jsx_runtime_1.jsxs)("div", { className: "grid w-60 mt-1", children: [(0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, domain: domain, to: "getstarted", className: "flex ai-s", children: [(0, jsx_runtime_1.jsx)(Icons_1.Graduate, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h4", { className: "fs-14 fw-600", children: t("getStarted") }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("getStartedDesc") })] })] }), (0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, domain: domain, to: "ecosystem", className: "flex ai-s", children: [(0, jsx_runtime_1.jsx)(Icons_1.Earth, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h4", { className: "fs-14 fw-600", children: t("ecosystem") }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("ecosystemDesc") })] })] }), (0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, domain: domain, to: "education", className: "flex ai-s", children: [(0, jsx_runtime_1.jsx)(Icons_1.Book, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h4", { className: "fs-14 fw-600", children: t("education") }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("educationDesc") })] })] }), (0, jsx_runtime_1.jsxs)("a", { href: "https://docs.rujira.network/", target: "_blank", className: "flex ai-s", children: [(0, jsx_runtime_1.jsx)(Icons_1.Code, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("h4", { className: "fs-14 fw-600 flex ai-c", children: [t("documentation"), " ", (0, jsx_runtime_1.jsx)(Icons_1.External, { className: "h-1.5 w-a ml-1" })] }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("documentationDesc") })] })] }), (0, jsx_runtime_1.jsxs)("a", { href: " https://docs.rujira.network/developers/getting-started", target: "_blank", className: "flex ai-s", children: [(0, jsx_runtime_1.jsx)(Icons_1.Terminal, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("h4", { className: "fs-14 fw-600 flex ai-c", children: [t("developers"), (0, jsx_runtime_1.jsx)(Icons_1.External, { className: "h-1.5 w-a ml-1" })] }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("developersDesc") })] })] }), (0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, domain: domain, to: "support", className: "flex", children: [(0, jsx_runtime_1.jsx)(Icons_1.Support, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h4", { className: "fs-14 fw-600", children: t("support") }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("supportDesc") })] })] }), (0, jsx_runtime_1.jsxs)("a", { href: "https://medium.com/rujiranetwork", target: "_blank", className: "flex ai-s", children: [(0, jsx_runtime_1.jsx)(Icons_1.Medium, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("h4", { className: "fs-14 fw-600 flex ai-c", children: [t("articles"), " ", (0, jsx_runtime_1.jsx)(Icons_1.External, { className: "h-1.5 w-a ml-1" })] }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("articlesDesc") })] })] })] }) }));
|
|
197
|
-
};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PendingDeposits = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("motion/react");
|
|
6
|
-
const react_2 = require("react");
|
|
7
|
-
const clsx_1 = require("clsx");
|
|
8
|
-
const rujira_js_1 = require("rujira.js");
|
|
9
|
-
const alert_gif_1 = require("../../assets/images/alert.gif");
|
|
10
|
-
const alert_png_1 = require("../../assets/images/alert.png");
|
|
11
|
-
const helpers_1 = require("../../helpers");
|
|
12
|
-
const Icons_1 = require("../icons/Icons");
|
|
13
|
-
const NetworkIcon_1 = require("../icons/NetworkIcon");
|
|
14
|
-
const PendingDeposits = ({ deposits, dismissDeposit, clearAll, }) => {
|
|
15
|
-
const [showMenu, setShowMenu] = (0, react_2.useState)(false);
|
|
16
|
-
if (!deposits.length)
|
|
17
|
-
return null;
|
|
18
|
-
const isAlert = !!deposits.find((x) => x.status === "succeeded");
|
|
19
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, clsx_1.default)({
|
|
20
|
-
"rujira-header__pending": true,
|
|
21
|
-
"rujira-header__alert": isAlert,
|
|
22
|
-
}), onMouseOver: () => setShowMenu(true), onMouseLeave: () => setShowMenu(false), children: [(0, jsx_runtime_1.jsx)("img", { src: isAlert ? alert_gif_1.default : alert_png_1.default, alt: "Pending transactions" }), (0, jsx_runtime_1.jsx)(react_1.AnimatePresence, { children: showMenu && ((0, jsx_runtime_1.jsxs)(react_1.motion.div, { className: "rujira-header__popup sub-nav fw-400 px-2 py-1.5", initial: { opacity: 0, marginTop: -4 }, animate: { opacity: 1, marginTop: 0 }, exit: { opacity: 0, marginTop: -4 }, children: [deposits.length > 0 && ((0, jsx_runtime_1.jsx)("div", { className: "text-right mb-1.5", children: (0, jsx_runtime_1.jsx)("a", { className: "tag tag--md hover-white", onClick: clearAll, children: "clear all" }) })), deposits.sort(sorter).map((x) => ((0, jsx_runtime_1.jsx)(Deposit, { deposit: x, dismiss: () => dismissDeposit(x.hash) }, x.hash)))] })) })] }));
|
|
23
|
-
};
|
|
24
|
-
exports.PendingDeposits = PendingDeposits;
|
|
25
|
-
const Deposit = ({ deposit, dismiss, }) => {
|
|
26
|
-
const { hash, status, network, timestamp, message } = deposit;
|
|
27
|
-
const [elapsed, setElapsed] = (0, react_2.useState)((new Date().getTime() - timestamp.getTime()) / 1000);
|
|
28
|
-
(0, react_2.useEffect)(() => {
|
|
29
|
-
const int = setInterval(() => {
|
|
30
|
-
setElapsed((new Date().getTime() - timestamp.getTime()) / 1000);
|
|
31
|
-
}, 1000);
|
|
32
|
-
return () => clearInterval(int);
|
|
33
|
-
}, []);
|
|
34
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "flex rujira-header__pending-tx mb-2", children: [(0, jsx_runtime_1.jsx)(NetworkIcon_1.NetworkIcon, { network: network, className: "w-3 h-3 mr-1" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex dir-c grow", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex", children: [(0, jsx_runtime_1.jsxs)("div", { className: "fs-14 condensed color-white", children: [(0, helpers_1.nFormatter)(deposit.coin.amount, 6, 8), " ", deposit.coin.symbol] }), (0, jsx_runtime_1.jsxs)("div", { className: "ar flex", children: [status === "pending" && ((0, jsx_runtime_1.jsx)("div", { className: "fs-12 condensed color-grey mr-2 wrap-reset", children: (0, jsx_runtime_1.jsx)("span", { className: "color-white", children: elapsed < 60
|
|
35
|
-
? `${elapsed}s`
|
|
36
|
-
: elapsed < 3600
|
|
37
|
-
? `${Math.floor(elapsed / 60)}m ${Math.floor(elapsed % 60)}s`
|
|
38
|
-
: elapsed < 36000
|
|
39
|
-
? `${Math.floor(elapsed / 3600)}h ${Math.floor((elapsed % 3600) / 60)}m ${Math.floor(elapsed % 60)}s`
|
|
40
|
-
: "> 10h" }) })), (0, jsx_runtime_1.jsxs)("div", { className: (0, clsx_1.default)({
|
|
41
|
-
"tag tag--sm": true,
|
|
42
|
-
"tag--orange": status === "pending",
|
|
43
|
-
"tag--teal": status === "succeeded",
|
|
44
|
-
"tag--red": ["refunded", "failed"].includes(status),
|
|
45
|
-
}), children: [(0, jsx_runtime_1.jsx)("b", {}), " ", status] })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex mt-0.5", children: [(0, jsx_runtime_1.jsxs)("span", { className: "fs-13 condensed color-grey no-underline mr-3", children: [timestamp.toLocaleTimeString(), " ", timestamp.toLocaleDateString()] }), (0, jsx_runtime_1.jsxs)("a", { href: (0, rujira_js_1.networkTxLink)({ network, txHash: hash }), target: "_blank", className: "fs-13 condensed color-grey no-underline hover-white ar", children: [hash.slice(0, 4), "...", hash.slice(-6)] })] }), message && ((0, jsx_runtime_1.jsx)("div", { className: "flex mt-0.5", children: (0, jsx_runtime_1.jsx)("span", { className: "fs-13 condensed color-orange no-underline mr-3", children: message }) }))] }), status !== "pending" && ((0, jsx_runtime_1.jsx)("button", { className: "transparent ml-1.5 mr-0 color-grey hover-white pointer", onClick: dismiss, children: (0, jsx_runtime_1.jsx)(Icons_1.Xmark, { className: "w-2 h-2" }) }))] }));
|
|
46
|
-
};
|
|
47
|
-
const sorter = (a, b) => b.timestamp.getTime() - a.timestamp.getTime();
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.QuickLauncher = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("motion/react");
|
|
6
|
-
const react_2 = require("react");
|
|
7
|
-
const i18n_1 = require("../../i18n");
|
|
8
|
-
const Icons_1 = require("../icons/Icons");
|
|
9
|
-
const ResolveLink_1 = require("./ResolveLink");
|
|
10
|
-
const QuickLauncher = ({ domain, routingElement, }) => {
|
|
11
|
-
const { t } = (0, i18n_1.useTranslation)("header");
|
|
12
|
-
const [showMenu, setShowMenu] = (0, react_2.useState)(false);
|
|
13
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "rujira-header__quick", onMouseOver: () => setShowMenu(true), onMouseOut: () => setShowMenu(false), children: [(0, jsx_runtime_1.jsx)(Icons_1.Grid, {}), (0, jsx_runtime_1.jsx)(react_1.AnimatePresence, { children: showMenu && ((0, jsx_runtime_1.jsxs)(react_1.motion.div, { className: "rujira-header__popup sub-nav fw-400 px-2 py-1.5", initial: { opacity: 0, marginTop: -4 }, animate: { opacity: 1, marginTop: 0 }, exit: { opacity: 0, marginTop: -4 }, children: [(0, jsx_runtime_1.jsx)(ResolveLink_1.ResolveLink, { domain: domain, as: routingElement, to: "buy", children: (0, jsx_runtime_1.jsx)("span", { className: "fs-12 fw-500", children: t("buyCrypto") }) }), (0, jsx_runtime_1.jsx)(ResolveLink_1.ResolveLink, { domain: domain, as: routingElement, to: "swap", children: (0, jsx_runtime_1.jsx)("span", { className: "fs-12 fw-500", children: t("tokenSwap") }) }), (0, jsx_runtime_1.jsx)(ResolveLink_1.ResolveLink, { domain: domain, as: routingElement, to: "trade", children: (0, jsx_runtime_1.jsx)("span", { className: "fs-12 fw-500", children: t("spotTrading") }) }), (0, jsx_runtime_1.jsx)(ResolveLink_1.ResolveLink, { domain: domain, as: routingElement, to: "options", children: (0, jsx_runtime_1.jsx)("span", { className: "fs-12 fw-500", children: t("options") }) }), (0, jsx_runtime_1.jsx)(ResolveLink_1.ResolveLink, { domain: domain, as: routingElement, to: "/perps", children: (0, jsx_runtime_1.jsx)("span", { className: "fs-12 fw-500", children: t("perps") }) }), (0, jsx_runtime_1.jsx)(ResolveLink_1.ResolveLink, { domain: domain, as: routingElement, to: "strategies/staking/RUJI", children: (0, jsx_runtime_1.jsx)("span", { className: "fs-12 fw-500", children: t("stake") }) }), (0, jsx_runtime_1.jsx)(ResolveLink_1.ResolveLink, { domain: domain, as: routingElement, to: "lp", children: (0, jsx_runtime_1.jsx)("span", { className: "fs-12 fw-500", children: t("liquidityPools") }) }), (0, jsx_runtime_1.jsx)(ResolveLink_1.ResolveLink, { domain: domain, as: routingElement, to: "money-market", children: (0, jsx_runtime_1.jsx)("span", { className: "fs-12 fw-500", children: t("lendAndBorrow") }) }), (0, jsx_runtime_1.jsx)(ResolveLink_1.ResolveLink, { domain: domain, as: routingElement, to: "liquidate", children: (0, jsx_runtime_1.jsx)("span", { className: "fs-12 fw-500", children: t("liquidate") }) }), (0, jsx_runtime_1.jsx)(ResolveLink_1.ResolveLink, { domain: domain, as: routingElement, to: "ventures", children: (0, jsx_runtime_1.jsx)("span", { className: "fs-12 fw-500", children: t("ventures") }) }), (0, jsx_runtime_1.jsx)(ResolveLink_1.ResolveLink, { domain: domain, as: routingElement, to: "nfts", children: (0, jsx_runtime_1.jsx)("span", { className: "fs-12 fw-500", children: t("collections") }) })] })) })] }));
|
|
14
|
-
};
|
|
15
|
-
exports.QuickLauncher = QuickLauncher;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ResolveLink = exports.UnwrappedAnyComponent = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
const fixedForwardRef = react_1.forwardRef;
|
|
7
|
-
const UnwrappedAnyComponent = (props, ref) => {
|
|
8
|
-
const { as: Comp = "a", children, domain, ...rest } = props;
|
|
9
|
-
if (!domain ||
|
|
10
|
-
window.location.hostname === "rujira.network" ||
|
|
11
|
-
domain === "") {
|
|
12
|
-
return ((0, jsx_runtime_1.jsx)(Comp, { ...rest, ref: ref, children: children }));
|
|
13
|
-
}
|
|
14
|
-
return ((0, jsx_runtime_1.jsx)("a", { href: props.to || props.href, ...rest, children: children }));
|
|
15
|
-
};
|
|
16
|
-
exports.UnwrappedAnyComponent = UnwrappedAnyComponent;
|
|
17
|
-
exports.ResolveLink = fixedForwardRef(exports.UnwrappedAnyComponent);
|