@vitnode/core 1.2.0-canary.21 → 1.2.0-canary.23
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/src/api/models/user/sign-up.d.ts.map +1 -1
- package/dist/src/api/models/user/sign-up.js +1 -2
- package/dist/src/api/models/user.d.ts.map +1 -1
- package/dist/src/api/modules/users/routes/sign-up.route.d.ts +10 -2
- package/dist/src/api/modules/users/routes/sign-up.route.d.ts.map +1 -1
- package/dist/src/api/modules/users/routes/sign-up.route.js +14 -4
- package/dist/src/api/modules/users/users.module.d.ts +10 -2
- package/dist/src/api/modules/users/users.module.d.ts.map +1 -1
- package/dist/src/app_admin/core/users/page.js +1 -1
- package/dist/src/components/form/auto-form.js +1 -1
- package/dist/src/components/form/fields/combobox-async.d.ts +21 -0
- package/dist/src/components/form/fields/combobox-async.d.ts.map +1 -0
- package/dist/src/components/form/fields/combobox-async.js +115 -0
- package/dist/src/components/form/fields/combobox.d.ts +2 -1
- package/dist/src/components/form/fields/combobox.d.ts.map +1 -1
- package/dist/src/components/form/fields/combobox.js +4 -5
- package/dist/src/components/table/content.js +2 -2
- package/dist/src/components/table/order-table-head.js +1 -1
- package/dist/src/components/table/pagination.js +3 -3
- package/dist/src/components/ui/alert-dialog.js +2 -2
- package/dist/src/components/ui/button.d.ts +1 -1
- package/dist/src/components/ui/button.d.ts.map +1 -1
- package/dist/src/components/ui/button.js +1 -0
- package/dist/src/components/ui/dialog.d.ts.map +1 -1
- package/dist/src/components/ui/dialog.js +1 -1
- package/dist/src/lib/fetcher/core.d.ts +15 -0
- package/dist/src/lib/fetcher/core.d.ts.map +1 -0
- package/dist/src/lib/fetcher/core.js +39 -0
- package/dist/src/lib/fetcher/helpers-server.d.ts +3 -0
- package/dist/src/lib/fetcher/helpers-server.d.ts.map +1 -0
- package/dist/src/lib/fetcher/helpers-server.js +18 -0
- package/dist/src/lib/fetcher/helpers.d.ts +0 -1
- package/dist/src/lib/fetcher/helpers.d.ts.map +1 -1
- package/dist/src/lib/fetcher/helpers.js +0 -17
- package/dist/src/lib/fetcher-client.d.ts +8 -0
- package/dist/src/lib/fetcher-client.d.ts.map +1 -0
- package/dist/src/lib/fetcher-client.js +11 -0
- package/dist/src/lib/fetcher.d.ts +2 -1
- package/dist/src/lib/fetcher.d.ts.map +1 -1
- package/dist/src/lib/fetcher.js +14 -33
- package/dist/src/lib/helpers/auto-form.d.ts.map +1 -1
- package/dist/src/lib/helpers/auto-form.js +28 -16
- package/dist/src/lib/helpers/auto-form.test.js +49 -0
- package/dist/src/views/admin/layouts/sidebar/nav/item.d.ts.map +1 -1
- package/dist/src/views/admin/layouts/sidebar/nav/item.js +38 -4
- package/dist/src/views/admin/views/core/dashboard/dashboard-admin-view.js +1 -1
- package/dist/src/views/admin/views/core/test.d.ts.map +1 -1
- package/dist/src/views/admin/views/core/test.js +108 -103
- package/dist/src/views/auth/sign-in/form/form.js +1 -1
- package/dist/src/views/auth/sign-in/form/{hooks/mutation-api.d.ts → mutation-api.d.ts} +1 -1
- package/dist/src/views/auth/sign-in/form/mutation-api.d.ts.map +1 -0
- package/dist/src/views/auth/sign-in/form/{hooks/mutation-api.js → mutation-api.js} +3 -3
- package/dist/src/views/auth/sign-in/form/use-form.d.ts.map +1 -0
- package/dist/src/views/auth/sign-up/email-confirmation-view.d.ts +4 -0
- package/dist/src/views/auth/sign-up/email-confirmation-view.d.ts.map +1 -0
- package/dist/src/views/auth/sign-up/email-confirmation-view.js +55 -0
- package/dist/src/views/auth/sign-up/form/form.js +1 -1
- package/dist/src/views/auth/sign-up/form/mutation-api.d.ts +14 -0
- package/dist/src/views/auth/sign-up/form/mutation-api.d.ts.map +1 -0
- package/dist/src/views/auth/sign-up/form/mutation-api.js +29 -0
- package/dist/src/views/auth/sign-up/form/use-form.d.ts.map +1 -0
- package/dist/src/views/auth/sign-up/form/{hooks/use-form.js → use-form.js} +7 -3
- package/dist/src/views/auth/sign-up/sign-up-view.d.ts.map +1 -1
- package/dist/src/views/auth/sign-up/sign-up-view.js +38 -35
- package/dist/src/views/auth/sign-up/wrapper.d.ts +8 -0
- package/dist/src/views/auth/sign-up/wrapper.d.ts.map +1 -0
- package/dist/src/views/auth/sign-up/wrapper.js +19 -0
- package/dist/src/views/auth/sso/buttons/sso-buttons.d.ts.map +1 -1
- package/dist/src/views/auth/sso/buttons/sso-buttons.js +5 -3
- package/dist/src/views/layouts/theme/header/header.d.ts.map +1 -1
- package/dist/src/views/layouts/theme/header/header.js +24 -21
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -2
- package/src/app_admin/core/users/page.tsx +1 -1
- package/src/locales/en.json +7 -0
- package/dist/src/views/auth/sign-in/form/hooks/mutation-api.d.ts.map +0 -1
- package/dist/src/views/auth/sign-in/form/hooks/use-form.d.ts.map +0 -1
- package/dist/src/views/auth/sign-up/form/hooks/mutation-api.d.ts +0 -6
- package/dist/src/views/auth/sign-up/form/hooks/mutation-api.d.ts.map +0 -1
- package/dist/src/views/auth/sign-up/form/hooks/mutation-api.js +0 -18
- package/dist/src/views/auth/sign-up/form/hooks/use-form.d.ts.map +0 -1
- /package/dist/src/views/auth/sign-in/form/{hooks/use-form.d.ts → use-form.d.ts} +0 -0
- /package/dist/src/views/auth/sign-in/form/{hooks/use-form.js → use-form.js} +0 -0
- /package/dist/src/views/auth/sign-up/form/{hooks/use-form.d.ts → use-form.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email-confirmation-view.d.ts","sourceRoot":"","sources":["../../../../../src/views/auth/sign-up/email-confirmation-view.tsx"],"names":[],"mappings":"AAWA,eAAO,MAAM,qBAAqB,GAAI,WAAW;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,4CA2BjE,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Mail, MailboxIcon } from "lucide-react";
|
|
3
|
+
import { useTranslations } from "next-intl";
|
|
4
|
+
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "../../../components/ui/card.js";
|
|
5
|
+
export const EmailConfirmationView = ({ email })=>{
|
|
6
|
+
const t = useTranslations('core.auth.sign_up.email_confirmation');
|
|
7
|
+
return /*#__PURE__*/ _jsxs(Card, {
|
|
8
|
+
className: "w-full max-w-md p-6",
|
|
9
|
+
children: [
|
|
10
|
+
/*#__PURE__*/ _jsxs(CardHeader, {
|
|
11
|
+
className: "text-center",
|
|
12
|
+
children: [
|
|
13
|
+
/*#__PURE__*/ _jsx("div", {
|
|
14
|
+
className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-green-100 dark:bg-green-900",
|
|
15
|
+
children: /*#__PURE__*/ _jsx(MailboxIcon, {
|
|
16
|
+
className: "h-8 w-8 text-green-600 dark:text-green-400"
|
|
17
|
+
})
|
|
18
|
+
}),
|
|
19
|
+
/*#__PURE__*/ _jsx(CardTitle, {
|
|
20
|
+
className: "text-2xl font-bold",
|
|
21
|
+
children: t('title')
|
|
22
|
+
}),
|
|
23
|
+
/*#__PURE__*/ _jsx(CardDescription, {
|
|
24
|
+
className: "text-base",
|
|
25
|
+
children: t('desc')
|
|
26
|
+
})
|
|
27
|
+
]
|
|
28
|
+
}),
|
|
29
|
+
/*#__PURE__*/ _jsxs(CardContent, {
|
|
30
|
+
className: "space-y-6",
|
|
31
|
+
children: [
|
|
32
|
+
/*#__PURE__*/ _jsx("div", {
|
|
33
|
+
className: "bg-muted rounded-lg p-4",
|
|
34
|
+
children: /*#__PURE__*/ _jsxs("div", {
|
|
35
|
+
className: "flex items-center gap-3",
|
|
36
|
+
children: [
|
|
37
|
+
/*#__PURE__*/ _jsx("span", {
|
|
38
|
+
className: "text-sm font-medium",
|
|
39
|
+
children: email
|
|
40
|
+
}),
|
|
41
|
+
/*#__PURE__*/ _jsx(Mail, {
|
|
42
|
+
className: "text-muted-foreground ml-auto size-5"
|
|
43
|
+
})
|
|
44
|
+
]
|
|
45
|
+
})
|
|
46
|
+
}),
|
|
47
|
+
/*#__PURE__*/ _jsx("p", {
|
|
48
|
+
className: "text-muted-foreground text-center text-sm",
|
|
49
|
+
children: t('check_spam')
|
|
50
|
+
})
|
|
51
|
+
]
|
|
52
|
+
})
|
|
53
|
+
]
|
|
54
|
+
});
|
|
55
|
+
};
|
|
@@ -7,7 +7,7 @@ import { AutoFormInput } from "../../../../components/form/fields/input.js";
|
|
|
7
7
|
import { Link } from "../../../../lib/navigation.js";
|
|
8
8
|
import { removeSpecialCharacters } from "../../../../lib/special-characters.js";
|
|
9
9
|
import { PasswordInput } from "../../components/password-input.js";
|
|
10
|
-
import { useFormSignUp } from "./
|
|
10
|
+
import { useFormSignUp } from "./use-form.js";
|
|
11
11
|
export const FormSignUp = ({ isEmail })=>{
|
|
12
12
|
const t = useTranslations('core.auth.sign_up');
|
|
13
13
|
const { onSubmit, formSchema } = useFormSignUp();
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import type { zodSignUpSchema } from '../../../../api/modules/users/routes/sign-up.route';
|
|
3
|
+
export declare const mutationApi: (input: z.infer<typeof zodSignUpSchema>) => Promise<{
|
|
4
|
+
error: string;
|
|
5
|
+
data?: undefined;
|
|
6
|
+
} | {
|
|
7
|
+
data: {
|
|
8
|
+
id: number;
|
|
9
|
+
email: string;
|
|
10
|
+
emailVerified: boolean;
|
|
11
|
+
};
|
|
12
|
+
error?: undefined;
|
|
13
|
+
}>;
|
|
14
|
+
//# sourceMappingURL=mutation-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mutation-api.d.ts","sourceRoot":"","sources":["../../../../../../src/views/auth/sign-up/form/mutation-api.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAI7B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAMhF,eAAO,MAAM,WAAW,GAAU,OAAO,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC;;;;;;;;;;EAsBvE,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use server';
|
|
2
|
+
import { revalidatePath } from "next/cache";
|
|
3
|
+
import { usersModule } from "../../../../api/modules/users/users.module.js";
|
|
4
|
+
import { fetcher } from "../../../../lib/fetcher.js";
|
|
5
|
+
import { redirect } from "../../../../lib/navigation.js";
|
|
6
|
+
export const mutationApi = async (input)=>{
|
|
7
|
+
const res = await fetcher(usersModule, {
|
|
8
|
+
path: '/sign_up',
|
|
9
|
+
method: 'post',
|
|
10
|
+
module: 'users',
|
|
11
|
+
allowSaveCookies: true,
|
|
12
|
+
args: {
|
|
13
|
+
body: input
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
if (res.status !== 201) {
|
|
17
|
+
return {
|
|
18
|
+
error: await res.text()
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
const data = await res.json();
|
|
22
|
+
if (data.emailVerified) {
|
|
23
|
+
revalidatePath('/[locale]/(main)', 'layout');
|
|
24
|
+
await redirect('/');
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
data
|
|
28
|
+
};
|
|
29
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-form.d.ts","sourceRoot":"","sources":["../../../../../../src/views/auth/sign-up/form/use-form.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAIrD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,aAAa;uBA+Bd,CAAC,CAAC,KAAK;;;;;;;;;;;;;;;;;;OAAmB,QAC5B,aAAa,CAAC,CAAC,CAAC,KAAK;;;;;;;;;;;;;;;;;;OAAmB,CAAC;;;;;;;;;;;;;;;;;;;;CA8ClD,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useTranslations } from "next-intl";
|
|
2
2
|
import { toast } from "sonner";
|
|
3
3
|
import { z } from "zod";
|
|
4
|
+
import { useWrapperSignUp } from "../wrapper.js";
|
|
4
5
|
import { mutationApi } from "./mutation-api.js";
|
|
5
6
|
export const useFormSignUp = ()=>{
|
|
6
7
|
const t = useTranslations('core.auth.sign_up');
|
|
@@ -20,10 +21,13 @@ export const useFormSignUp = ()=>{
|
|
|
20
21
|
terms: z.boolean().refine((value)=>value, t('terms.required')),
|
|
21
22
|
newsletter: z.boolean().optional()
|
|
22
23
|
});
|
|
24
|
+
const { setShowSendingEmail } = useWrapperSignUp();
|
|
23
25
|
const onSubmit = async (values, form)=>{
|
|
24
26
|
const mutation = await mutationApi(values);
|
|
25
|
-
if (
|
|
26
|
-
|
|
27
|
+
if (mutation.data) {
|
|
28
|
+
if (!mutation.data.emailVerified) {
|
|
29
|
+
setShowSendingEmail(mutation.data.email);
|
|
30
|
+
}
|
|
27
31
|
return;
|
|
28
32
|
}
|
|
29
33
|
const errorMessages = {
|
|
@@ -36,7 +40,7 @@ export const useFormSignUp = ()=>{
|
|
|
36
40
|
message: t('username.exists')
|
|
37
41
|
}
|
|
38
42
|
};
|
|
39
|
-
const errorConfig = errorMessages[mutation.
|
|
43
|
+
const errorConfig = errorMessages[mutation.error];
|
|
40
44
|
if (errorConfig) {
|
|
41
45
|
form.setError(errorConfig.field, {
|
|
42
46
|
type: 'manual',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sign-up-view.d.ts","sourceRoot":"","sources":["../../../../../src/views/auth/sign-up/sign-up-view.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sign-up-view.d.ts","sourceRoot":"","sources":["../../../../../src/views/auth/sign-up/sign-up-view.tsx"],"names":[],"mappings":"AAYA,eAAO,MAAM,UAAU,wDAwCtB,CAAC"}
|
|
@@ -7,6 +7,7 @@ import { Link } from "../../../lib/navigation.js";
|
|
|
7
7
|
import { I18nProvider } from "../../../components/i18n-provider.js";
|
|
8
8
|
import { SSOButtons, SSOButtonsSkeleton } from "../sso/buttons/sso-buttons.js";
|
|
9
9
|
import { FormSignUp } from "./form/form.js";
|
|
10
|
+
import { WrapperSignUp } from "./wrapper.js";
|
|
10
11
|
export const SignUpView = async ()=>{
|
|
11
12
|
const [t, tGlobal, { isEmail }] = await Promise.all([
|
|
12
13
|
getTranslations('core.auth.sign_up'),
|
|
@@ -17,44 +18,46 @@ export const SignUpView = async ()=>{
|
|
|
17
18
|
namespaces: "core.auth.sign_up",
|
|
18
19
|
children: /*#__PURE__*/ _jsx("div", {
|
|
19
20
|
className: "mx-auto flex min-h-[calc(100vh-4rem)] max-w-md flex-col justify-center px-4 py-16",
|
|
20
|
-
children: /*#__PURE__*/
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
21
|
+
children: /*#__PURE__*/ _jsx(WrapperSignUp, {
|
|
22
|
+
children: /*#__PURE__*/ _jsxs(Card, {
|
|
23
|
+
className: "bg-muted gap-0 p-0",
|
|
24
|
+
children: [
|
|
25
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
26
|
+
className: "bg-card rounded-xl p-6",
|
|
27
|
+
children: [
|
|
28
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
29
|
+
className: "mb-10 space-y-2 text-center",
|
|
30
|
+
children: [
|
|
31
|
+
/*#__PURE__*/ _jsx("h1", {
|
|
32
|
+
className: "text-2xl font-semibold leading-none tracking-tight",
|
|
33
|
+
children: tGlobal('register')
|
|
34
|
+
}),
|
|
35
|
+
/*#__PURE__*/ _jsx(CardDescription, {
|
|
36
|
+
children: t('desc')
|
|
37
|
+
})
|
|
38
|
+
]
|
|
39
|
+
}),
|
|
40
|
+
/*#__PURE__*/ _jsx(FormSignUp, {
|
|
41
|
+
isEmail: isEmail
|
|
42
|
+
}),
|
|
43
|
+
/*#__PURE__*/ _jsx(React.Suspense, {
|
|
44
|
+
fallback: /*#__PURE__*/ _jsx(SSOButtonsSkeleton, {}),
|
|
45
|
+
children: /*#__PURE__*/ _jsx(SSOButtons, {})
|
|
46
|
+
})
|
|
47
|
+
]
|
|
48
|
+
}),
|
|
49
|
+
/*#__PURE__*/ _jsx("div", {
|
|
50
|
+
className: "text-accent-foreground p-6 text-center text-sm",
|
|
51
|
+
children: t.rich('already_have_account', {
|
|
52
|
+
link: (text)=>/*#__PURE__*/ _jsx(Link, {
|
|
53
|
+
className: "font-semibold",
|
|
54
|
+
href: "/login",
|
|
55
|
+
children: text
|
|
35
56
|
})
|
|
36
|
-
]
|
|
37
|
-
}),
|
|
38
|
-
/*#__PURE__*/ _jsx(FormSignUp, {
|
|
39
|
-
isEmail: isEmail
|
|
40
|
-
}),
|
|
41
|
-
/*#__PURE__*/ _jsx(React.Suspense, {
|
|
42
|
-
fallback: /*#__PURE__*/ _jsx(SSOButtonsSkeleton, {}),
|
|
43
|
-
children: /*#__PURE__*/ _jsx(SSOButtons, {})
|
|
44
57
|
})
|
|
45
|
-
]
|
|
46
|
-
}),
|
|
47
|
-
/*#__PURE__*/ _jsx("div", {
|
|
48
|
-
className: "text-accent-foreground p-6 text-center text-sm",
|
|
49
|
-
children: t.rich('already_have_account', {
|
|
50
|
-
link: (text)=>/*#__PURE__*/ _jsx(Link, {
|
|
51
|
-
className: "font-semibold",
|
|
52
|
-
href: "/login",
|
|
53
|
-
children: text
|
|
54
|
-
})
|
|
55
58
|
})
|
|
56
|
-
|
|
57
|
-
|
|
59
|
+
]
|
|
60
|
+
})
|
|
58
61
|
})
|
|
59
62
|
})
|
|
60
63
|
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const useWrapperSignUp: () => {
|
|
3
|
+
setShowSendingEmail: React.Dispatch<React.SetStateAction<string>>;
|
|
4
|
+
};
|
|
5
|
+
export declare const WrapperSignUp: ({ children }: {
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=wrapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wrapper.d.ts","sourceRoot":"","sources":["../../../../../src/views/auth/sign-up/wrapper.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,eAAO,MAAM,gBAAgB;yBALN,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;CAKS,CAAC;AAE7E,eAAO,MAAM,aAAa,GAAI,cAAc;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,4CAQxE,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { EmailConfirmationView } from "./email-confirmation-view.js";
|
|
5
|
+
const WrapperSignUpContext = /*#__PURE__*/ React.createContext({
|
|
6
|
+
setShowSendingEmail: ()=>{}
|
|
7
|
+
});
|
|
8
|
+
export const useWrapperSignUp = ()=>React.useContext(WrapperSignUpContext);
|
|
9
|
+
export const WrapperSignUp = ({ children })=>{
|
|
10
|
+
const [sendingEmail, setShowSendingEmail] = React.useState('');
|
|
11
|
+
return /*#__PURE__*/ _jsx(WrapperSignUpContext.Provider, {
|
|
12
|
+
value: {
|
|
13
|
+
setShowSendingEmail
|
|
14
|
+
},
|
|
15
|
+
children: sendingEmail ? /*#__PURE__*/ _jsx(EmailConfirmationView, {
|
|
16
|
+
email: sendingEmail
|
|
17
|
+
}) : children
|
|
18
|
+
});
|
|
19
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sso-buttons.d.ts","sourceRoot":"","sources":["../../../../../../src/views/auth/sso/buttons/sso-buttons.tsx"],"names":[],"mappings":"AAOA,eAAO,MAAM,kBAAkB,+CAO9B,CAAC;AAEF,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"sso-buttons.d.ts","sourceRoot":"","sources":["../../../../../../src/views/auth/sso/buttons/sso-buttons.tsx"],"names":[],"mappings":"AAOA,eAAO,MAAM,kBAAkB,+CAO9B,CAAC;AAEF,eAAO,MAAM,UAAU,wDAiCtB,CAAC"}
|
|
@@ -17,8 +17,10 @@ export const SSOButtonsSkeleton = ()=>{
|
|
|
17
17
|
});
|
|
18
18
|
};
|
|
19
19
|
export const SSOButtons = async ()=>{
|
|
20
|
-
const t = await
|
|
21
|
-
|
|
20
|
+
const [t, { sso }] = await Promise.all([
|
|
21
|
+
getTranslations('core.auth.sso'),
|
|
22
|
+
getMiddlewareApi()
|
|
23
|
+
]);
|
|
22
24
|
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
23
25
|
children: [
|
|
24
26
|
/*#__PURE__*/ _jsxs("div", {
|
|
@@ -30,7 +32,7 @@ export const SSOButtons = async ()=>{
|
|
|
30
32
|
className: "w-full border-t"
|
|
31
33
|
})
|
|
32
34
|
}),
|
|
33
|
-
/*#__PURE__*/ _jsx("div", {
|
|
35
|
+
sso.length > 0 && /*#__PURE__*/ _jsx("div", {
|
|
34
36
|
className: "relative flex justify-center text-xs",
|
|
35
37
|
children: /*#__PURE__*/ _jsx("span", {
|
|
36
38
|
className: "bg-card text-muted-foreground px-4",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../../../../../src/views/layouts/theme/header/header.tsx"],"names":[],"mappings":"AASA,eAAO,MAAM,YAAY,GAAI,+BAI1B,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,GAAG;IAAE,IAAI,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../../../../../src/views/layouts/theme/header/header.tsx"],"names":[],"mappings":"AASA,eAAO,MAAM,YAAY,GAAI,+BAI1B,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,GAAG;IAAE,IAAI,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,4CAuB5D,CAAC"}
|
|
@@ -6,27 +6,30 @@ import { Link } from "../../../../lib/navigation.js";
|
|
|
6
6
|
import { cn } from "../../../../lib/utils.js";
|
|
7
7
|
import { UserHeader } from "./user/user.js";
|
|
8
8
|
export const HeaderLayout = ({ logo, className, ...props })=>{
|
|
9
|
-
return /*#__PURE__*/
|
|
10
|
-
className: cn('bg-
|
|
9
|
+
return /*#__PURE__*/ _jsx("header", {
|
|
10
|
+
className: cn('bg-card/75 sticky top-0 z-20 w-full border-b shadow-sm backdrop-blur', className),
|
|
11
11
|
...props,
|
|
12
|
-
children:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
12
|
+
children: /*#__PURE__*/ _jsxs("div", {
|
|
13
|
+
className: "container mx-auto flex h-14 items-center px-4 py-2",
|
|
14
|
+
children: [
|
|
15
|
+
/*#__PURE__*/ _jsx(Link, {
|
|
16
|
+
href: "/",
|
|
17
|
+
prefetch: true,
|
|
18
|
+
children: logo
|
|
19
|
+
}),
|
|
20
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
21
|
+
className: "ml-auto flex items-center gap-2",
|
|
22
|
+
children: [
|
|
23
|
+
/*#__PURE__*/ _jsx(ThemeSwitcher, {}),
|
|
24
|
+
/*#__PURE__*/ _jsx(Suspense, {
|
|
25
|
+
fallback: /*#__PURE__*/ _jsx(Skeleton, {
|
|
26
|
+
className: "h-9 w-32"
|
|
27
|
+
}),
|
|
28
|
+
children: /*#__PURE__*/ _jsx(UserHeader, {})
|
|
29
|
+
})
|
|
30
|
+
]
|
|
31
|
+
})
|
|
32
|
+
]
|
|
33
|
+
})
|
|
31
34
|
});
|
|
32
35
|
};
|