@ichaingo/header 1.4.36 → 1.4.37

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.
@@ -1,16 +1,16 @@
1
1
  'use client';
2
2
  import { jsx as r } from "react/jsx-runtime";
3
- import { useState as m, useMemo as c, useEffect as p } from "react";
4
- import s from "@ichaingo/link";
3
+ import { useState as m, useMemo as c, useEffect as s } from "react";
4
+ import p from "@ichaingo/link";
5
5
  import l from "@ichaingo/translation";
6
- import f from "@ichaingo/better-link";
7
- import { useLocale as g } from "next-intl";
8
- import u from "@ichaingo/avatar";
6
+ import u from "@ichaingo/better-link";
7
+ import { useLocale as f } from "next-intl";
8
+ import g from "@ichaingo/avatar";
9
9
  function v({
10
10
  userInfo: t
11
11
  }) {
12
- const { gotoLogin: e } = f(), [i, a] = m(""), o = g(), n = c(() => t == null ? void 0 : t.id, [t]);
13
- return p(() => {
12
+ const { gotoLogin: e } = u(), [i, a] = m(""), o = f(), n = c(() => t == null ? void 0 : t.id, [t]);
13
+ return s(() => {
14
14
  a(e({
15
15
  locale: o,
16
16
  redirect: window.location.href
@@ -18,9 +18,9 @@ function v({
18
18
  }, [o, e]), n ? (
19
19
  // userInfo?.profileUrl
20
20
  // https://images.ichatgo.ai/user-profile/100000201.png
21
- /* @__PURE__ */ r(u, { userInfo: t, className: "w-8 h-8" })
21
+ /* @__PURE__ */ r(g, { userInfo: t, className: "w-8 h-8" })
22
22
  ) : /* @__PURE__ */ r(
23
- s,
23
+ p,
24
24
  {
25
25
  href: i,
26
26
  className: "cursor-pointer text-sm text-white bg-primary py-2 px-3 rounded-lg",
@@ -1,33 +1,29 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import a from "@ichaingo/link";
3
- import { useLocale as m } from "next-intl";
4
- import c from "@ichaingo/better-link";
1
+ import { jsxs as s, jsx as e } from "react/jsx-runtime";
5
2
  import p from "@ichaingo/translation";
6
- import { twMerge as f } from "tailwind-merge";
7
- import { useState as l, useEffect as u } from "react";
8
- function U({ onClick: t = () => {
9
- }, className: n }) {
10
- const r = m(), { gotoLogin: e } = c(), [i, s] = l("");
11
- return u(() => {
12
- s(e({
13
- locale: r,
14
- redirect: window.location.href
15
- }));
16
- }, [r, e]), /* @__PURE__ */ o(
17
- a,
3
+ import { twMerge as a } from "tailwind-merge";
4
+ import { useLogin as m, OpenLoginType as u } from "@ichaingo/with-login";
5
+ import { useCallback as g } from "react";
6
+ function y({ onClick: r = () => {
7
+ }, className: t }) {
8
+ const { openLogin: o, LoginModal: n } = m({}), i = g(() => {
9
+ o(u.LOGIN), r == null || r();
10
+ }, [o, r]);
11
+ return /* @__PURE__ */ s(
12
+ "div",
18
13
  {
19
- href: i,
20
- onClick: t,
21
- baseUrl: process.env.NEXT_PUBLIC_AUTH_URL,
22
- replace: !0,
23
- className: f(
14
+ onClick: i,
15
+ style: { cursor: "pointer" },
16
+ className: a(
24
17
  "cursor-pointer text-sm text-white bg-primary py-2 px-3 rounded-lg",
25
- n
18
+ t
26
19
  ),
27
- children: /* @__PURE__ */ o(p, { value: "signIn", parentKey: "account" })
20
+ children: [
21
+ /* @__PURE__ */ e(p, { value: "signIn", parentKey: "account" }),
22
+ /* @__PURE__ */ e(n, {})
23
+ ]
28
24
  }
29
25
  );
30
26
  }
31
27
  export {
32
- U as default
28
+ y as default
33
29
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ichaingo/header",
3
- "version": "1.4.36",
3
+ "version": "1.4.37",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -29,18 +29,19 @@
29
29
  "rollup-plugin-preserve-use-client": "^1.0.0",
30
30
  "tailwind-merge": "^2.5.5",
31
31
  "next": "15.1.6",
32
- "@ichaingo/auth": "1.4.36",
33
- "@ichaingo/translation": "1.4.36",
34
- "@ichaingo/image": "1.4.36",
35
- "@ichaingo/avatar": "1.4.36",
36
- "@ichaingo/link": "1.4.36",
37
- "@ichaingo/ui": "1.4.36",
38
- "@ichaingo/i18n": "1.4.36",
39
- "@ichaingo/better-link": "1.4.36",
40
- "@ichaingo/theme-toggle": "1.4.36",
41
- "@ichaingo/providers": "1.4.36",
42
- "@ichaingo/request": "1.4.36",
43
- "@ichaingo/iconfont": "1.4.36"
32
+ "@ichaingo/avatar": "1.4.37",
33
+ "@ichaingo/auth": "1.4.37",
34
+ "@ichaingo/image": "1.4.37",
35
+ "@ichaingo/i18n": "1.4.37",
36
+ "@ichaingo/better-link": "1.4.37",
37
+ "@ichaingo/link": "1.4.37",
38
+ "@ichaingo/providers": "1.4.37",
39
+ "@ichaingo/translation": "1.4.37",
40
+ "@ichaingo/theme-toggle": "1.4.37",
41
+ "@ichaingo/ui": "1.4.37",
42
+ "@ichaingo/iconfont": "1.4.37",
43
+ "@ichaingo/request": "1.4.37",
44
+ "@ichaingo/with-login": "1.4.37"
44
45
  },
45
46
  "devDependencies": {
46
47
  "@types/js-cookie": "^3.0.6"