@ichaingo/header 1.5.26 → 1.5.28
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/lib/Setting/SettingBody.js +28 -32
- package/dist/lib/Setting/index.js +13 -9
- package/dist/lib/User/Pc.js +15 -11
- package/package.json +14 -14
|
@@ -1,57 +1,53 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { useLocale as h, useTranslations as
|
|
2
|
+
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import { useLocale as h, useTranslations as d } from "next-intl";
|
|
4
4
|
import { useSearchParams as p, usePathname as x } from "next/navigation";
|
|
5
|
-
import { Accordion as b, AccordionItem as w, AccordionTrigger as y, AccordionContent as
|
|
6
|
-
import { twMerge as
|
|
7
|
-
import { useCallback as
|
|
5
|
+
import { Accordion as b, AccordionItem as w, AccordionTrigger as y, AccordionContent as N } from "@ichaingo/ui/accordion";
|
|
6
|
+
import { twMerge as j } from "tailwind-merge";
|
|
7
|
+
import { useCallback as v } from "react";
|
|
8
8
|
import k from "@ichaingo/link";
|
|
9
9
|
import $ from "@ichaingo/theme-toggle";
|
|
10
|
-
function U({ onClick:
|
|
10
|
+
function U({ onClick: f = () => {
|
|
11
11
|
} }) {
|
|
12
|
-
var
|
|
13
|
-
const a = h(),
|
|
12
|
+
var i;
|
|
13
|
+
const a = h(), r = p(), t = d("lang"), s = d("setting"), o = [
|
|
14
14
|
{ name: t("en"), lang: "en" },
|
|
15
15
|
{ name: t("ja"), lang: "ja" },
|
|
16
16
|
{ name: t("ko"), lang: "ko" },
|
|
17
17
|
{ name: t("zh-hant"), lang: "zh-hant" },
|
|
18
18
|
{ name: t("zh-hans"), lang: "zh-hans" }
|
|
19
|
-
],
|
|
20
|
-
(
|
|
21
|
-
const
|
|
22
|
-
return
|
|
19
|
+
], c = x(), u = v(
|
|
20
|
+
(n) => {
|
|
21
|
+
const m = c.replace(new RegExp(`/${a}(/|$)`), `/${n}$1`), g = r.toString();
|
|
22
|
+
return g ? `${m}?${g}` : m;
|
|
23
23
|
},
|
|
24
|
-
[
|
|
24
|
+
[c, a, r]
|
|
25
25
|
);
|
|
26
|
-
return /* @__PURE__ */
|
|
27
|
-
/* @__PURE__ */
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}, children: /* @__PURE__ */ r(w, { value: a, className: "border-0", children: [
|
|
32
|
-
/* @__PURE__ */ n(y, { className: "p-2 bg-background rounded-lg h-11 md:h-auto text-gray-500 w-full flex py-2 justify-between items-center hover:no-underline focus-visible:ring-0 focus-visible:ring-offset-0", children: /* @__PURE__ */ r("div", { className: "flex w-full justify-between items-center", children: [
|
|
33
|
-
/* @__PURE__ */ n("span", { className: "text-title", children: c("language") }),
|
|
34
|
-
/* @__PURE__ */ n("span", { className: "text-title", children: (g = i.find((e) => e.lang === a)) == null ? void 0 : g.name })
|
|
26
|
+
return /* @__PURE__ */ l("div", { className: "text-sm gap-2 flex flex-col justify-start items-start md:py-2", children: [
|
|
27
|
+
/* @__PURE__ */ e("div", { className: "flex w-full justify-between items-center", children: /* @__PURE__ */ e(b, { type: "single", className: "flex-1", collapsible: !0, children: /* @__PURE__ */ l(w, { value: a, className: "border-0", children: [
|
|
28
|
+
/* @__PURE__ */ e(y, { className: "p-2 bg-background rounded-lg h-11 md:h-auto text-gray-500 w-full flex py-2 justify-between items-center hover:no-underline focus-visible:ring-0 focus-visible:ring-offset-0", children: /* @__PURE__ */ l("div", { className: "flex w-full justify-between items-center", children: [
|
|
29
|
+
/* @__PURE__ */ e("span", { className: "text-title", children: s("language") }),
|
|
30
|
+
/* @__PURE__ */ e("span", { className: "text-title", children: (i = o.find((n) => n.lang === a)) == null ? void 0 : i.name })
|
|
35
31
|
] }) }),
|
|
36
|
-
/* @__PURE__ */
|
|
32
|
+
/* @__PURE__ */ e(N, { className: "bg-background mt-3 rounded-lg flex flex-col gap-2", children: o.map((n) => /* @__PURE__ */ e(
|
|
37
33
|
k,
|
|
38
34
|
{
|
|
39
35
|
prefetch: !1,
|
|
40
36
|
withLocale: !1,
|
|
41
|
-
className:
|
|
37
|
+
className: j(
|
|
42
38
|
"p-2 rounded-lg flex w-full justify-between items-center",
|
|
43
|
-
a ===
|
|
39
|
+
a === n.lang ? "text-primary" : ""
|
|
44
40
|
),
|
|
45
|
-
href: u(
|
|
46
|
-
onClick:
|
|
47
|
-
children:
|
|
41
|
+
href: u(n.lang),
|
|
42
|
+
onClick: f,
|
|
43
|
+
children: n.name
|
|
48
44
|
},
|
|
49
|
-
|
|
45
|
+
n.lang
|
|
50
46
|
)) })
|
|
51
47
|
] }) }) }),
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
/* @__PURE__ */
|
|
54
|
-
/* @__PURE__ */
|
|
48
|
+
/* @__PURE__ */ l("div", { className: "bg-background p-2 rounded-lg h-11 md:h-auto flex w-full justify-between items-center", children: [
|
|
49
|
+
/* @__PURE__ */ e("div", { children: s("theme") }),
|
|
50
|
+
/* @__PURE__ */ e($, {})
|
|
55
51
|
] })
|
|
56
52
|
] });
|
|
57
53
|
}
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
function
|
|
1
|
+
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import i from "@ichaingo/iconfont";
|
|
3
|
+
import l from "@ichaingo/tooltip";
|
|
4
|
+
import o from "./SettingBody.js";
|
|
5
|
+
function g({ onClick: r = () => {
|
|
6
6
|
} }) {
|
|
7
|
-
return /* @__PURE__ */
|
|
8
|
-
/* @__PURE__ */ e("div", { className: "hidden md:flex items-center bg-module hover:bg-stroke rounded-lg p-1.5 cursor-pointer", children: /* @__PURE__ */ e(
|
|
9
|
-
|
|
7
|
+
return /* @__PURE__ */ n("div", { className: "w-full md:w-auto order-3 md:order-0", children: [
|
|
8
|
+
/* @__PURE__ */ e("div", { className: "hidden md:flex items-center bg-module hover:bg-stroke rounded-lg p-1.5 cursor-pointer", children: /* @__PURE__ */ e(l, { side: "bottom", onChange: (t) => {
|
|
9
|
+
document.querySelectorAll("iframe").forEach((d) => {
|
|
10
|
+
d.style.pointerEvents = t ? "none" : "auto";
|
|
11
|
+
});
|
|
12
|
+
}, needClick: !0, contentClassName: "bg-module w-70 rounded-lg bg-module text-title border border-stroke", trigger: /* @__PURE__ */ e(i, { type: "icon-centersetup", className: "text-2xl" }), arrowClassName: "fill-module", children: /* @__PURE__ */ e(o, { onClick: r }) }) }),
|
|
13
|
+
/* @__PURE__ */ e("div", { className: "md:hidden", children: /* @__PURE__ */ e(o, {}) })
|
|
10
14
|
] });
|
|
11
15
|
}
|
|
12
16
|
export {
|
|
13
|
-
|
|
17
|
+
g as default
|
|
14
18
|
};
|
package/dist/lib/User/Pc.js
CHANGED
|
@@ -1,27 +1,31 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as l, jsxs as r } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
3
|
+
import m from "@ichaingo/link";
|
|
4
|
+
import d from "@ichaingo/translation";
|
|
5
|
+
import n from "./MainTrigger.js";
|
|
6
6
|
import c from "./Logout.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
function
|
|
7
|
+
import s from "@ichaingo/avatar";
|
|
8
|
+
import p from "@ichaingo/tooltip";
|
|
9
|
+
function y({
|
|
10
10
|
list: t,
|
|
11
11
|
userInfo: e,
|
|
12
|
-
onClick:
|
|
12
|
+
onClick: o
|
|
13
13
|
}) {
|
|
14
|
-
return /* @__PURE__ */ l(
|
|
14
|
+
return /* @__PURE__ */ l(p, { onChange: (a) => {
|
|
15
|
+
document.querySelectorAll("iframe").forEach((i) => {
|
|
16
|
+
i.style.pointerEvents = a ? "none" : "auto";
|
|
17
|
+
});
|
|
18
|
+
}, trigger: /* @__PURE__ */ l(n, { userInfo: e }), arrowClassName: "fill-module", contentClassName: "text-title w-75 p-0 border-transparent outline-none ", children: /* @__PURE__ */ r("div", { className: "flex flex-col gap-2 p-3 bg-module rounded-md", children: [
|
|
15
19
|
/* @__PURE__ */ l("div", { className: "flex flex-col gap-3 w-full bg-background rounded-lg p-2", children: /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
16
|
-
/* @__PURE__ */ l(
|
|
20
|
+
/* @__PURE__ */ l(s, { userInfo: e, className: "w-8 h-8" }),
|
|
17
21
|
/* @__PURE__ */ r("div", { className: "flex flex-col overflow-hidden", children: [
|
|
18
22
|
/* @__PURE__ */ l("div", { className: "text-sm font-medium", children: (e == null ? void 0 : e.username) || "--" }),
|
|
19
23
|
/* @__PURE__ */ l("div", { className: "text-xs text-muted-foreground w-full truncate", children: (e == null ? void 0 : e.email) || (e == null ? void 0 : e.walletAddress) })
|
|
20
24
|
] })
|
|
21
25
|
] }) }),
|
|
22
|
-
t.map((a) => /* @__PURE__ */ l("div", { className: "px-0 py-0 focus-visible:border-none focus-visible:outline-none", children: /* @__PURE__ */ l("div", { className: "flex items-center gap-2 w-full", children: a.name === "logout" ? /* @__PURE__ */ l(c, { className: "flex-1 flex py-3 border-t border-stroke w-full px-2 hover:bg-background" }) : /* @__PURE__ */ l(
|
|
26
|
+
t.map((a) => /* @__PURE__ */ l("div", { className: "px-0 py-0 focus-visible:border-none focus-visible:outline-none", children: /* @__PURE__ */ l("div", { className: "flex items-center gap-2 w-full", children: a.name === "logout" ? /* @__PURE__ */ l(c, { className: "flex-1 flex py-3 border-t border-stroke w-full px-2 hover:bg-background" }) : /* @__PURE__ */ l(m, { href: `/${a.href}`, baseUrl: process.env.NEXT_PUBLIC_AUTH_URL, className: "flex-1 flex py-3 h-full w-full px-2 hover:bg-background hover:text-primary rounded-lg ", onClick: o, children: /* @__PURE__ */ l(d, { value: a.name, parentKey: "account" }) }) }) }, a.name))
|
|
23
27
|
] }) });
|
|
24
28
|
}
|
|
25
29
|
export {
|
|
26
|
-
|
|
30
|
+
y as default
|
|
27
31
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ichaingo/header",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.28",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -32,18 +32,18 @@
|
|
|
32
32
|
"tailwind-merge": "3.3.1",
|
|
33
33
|
"next": "15.5.6",
|
|
34
34
|
"antd": "6.1.1",
|
|
35
|
-
"@ichaingo/
|
|
36
|
-
"@ichaingo/
|
|
37
|
-
"@ichaingo/image": "1.5.
|
|
38
|
-
"@ichaingo/better-link": "1.5.
|
|
39
|
-
"@ichaingo/link": "1.5.
|
|
40
|
-
"@ichaingo/
|
|
41
|
-
"@ichaingo/
|
|
42
|
-
"@ichaingo/
|
|
43
|
-
"@ichaingo/
|
|
44
|
-
"@ichaingo/
|
|
45
|
-
"@ichaingo/
|
|
46
|
-
"@ichaingo/
|
|
47
|
-
"@ichaingo/
|
|
35
|
+
"@ichaingo/avatar": "1.5.28",
|
|
36
|
+
"@ichaingo/auth": "1.5.28",
|
|
37
|
+
"@ichaingo/image": "1.5.28",
|
|
38
|
+
"@ichaingo/better-link": "1.5.28",
|
|
39
|
+
"@ichaingo/link": "1.5.28",
|
|
40
|
+
"@ichaingo/ui": "1.5.28",
|
|
41
|
+
"@ichaingo/iconfont": "1.5.28",
|
|
42
|
+
"@ichaingo/translation": "1.5.28",
|
|
43
|
+
"@ichaingo/theme-toggle": "1.5.28",
|
|
44
|
+
"@ichaingo/with-login": "1.5.28",
|
|
45
|
+
"@ichaingo/request": "1.5.28",
|
|
46
|
+
"@ichaingo/tooltip": "1.5.28",
|
|
47
|
+
"@ichaingo/token": "1.5.28"
|
|
48
48
|
}
|
|
49
49
|
}
|