@lastbrain/app 0.1.29 → 0.1.30
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/layouts/AdminLayoutWithSidebar.d.ts.map +1 -1
- package/dist/layouts/AdminLayoutWithSidebar.js +5 -2
- package/dist/layouts/AuthLayoutWithSidebar.d.ts.map +1 -1
- package/dist/layouts/AuthLayoutWithSidebar.js +4 -2
- package/package.json +1 -1
- package/src/layouts/AdminLayoutWithSidebar.tsx +15 -3
- package/src/layouts/AuthLayoutWithSidebar.tsx +12 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdminLayoutWithSidebar.d.ts","sourceRoot":"","sources":["../../src/layouts/AdminLayoutWithSidebar.tsx"],"names":[],"mappings":"AAMA,UAAU,2BAA2B;IACnC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,sBAAsB,CAAC,EACrC,QAAQ,EACR,UAAU,EACV,SAAc,GACf,EAAE,2BAA2B,
|
|
1
|
+
{"version":3,"file":"AdminLayoutWithSidebar.d.ts","sourceRoot":"","sources":["../../src/layouts/AdminLayoutWithSidebar.tsx"],"names":[],"mappings":"AAMA,UAAU,2BAA2B;IACnC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,sBAAsB,CAAC,EACrC,QAAQ,EACR,UAAU,EACV,SAAc,GACf,EAAE,2BAA2B,2CA8B7B"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { AdminLayout } from "./AdminLayout.js";
|
|
4
|
-
import { AppAside } from "@lastbrain/ui";
|
|
4
|
+
import { AppAside, AppAsideSkeleton } from "@lastbrain/ui";
|
|
5
5
|
import { useAuthSession } from "../auth/useAuthSession.js";
|
|
6
6
|
export function AdminLayoutWithSidebar({ children, menuConfig, className = "", }) {
|
|
7
7
|
const { isSuperAdmin } = useAuthSession();
|
|
8
|
-
|
|
8
|
+
// Détecter si on est dans la section admin pour le skeleton
|
|
9
|
+
const isAdminSection = typeof window !== "undefined" &&
|
|
10
|
+
window.location.pathname.startsWith("/admin");
|
|
11
|
+
return (_jsxs("div", { className: "flex min-h-screen", children: [!menuConfig ? (_jsx(AppAsideSkeleton, { className: className, isAdminSection: isAdminSection })) : (_jsx(AppAside, { menuConfig: menuConfig, isSuperAdmin: isSuperAdmin, className: className })), _jsx("div", { className: "flex-1 lg:ml-72", children: _jsx(AdminLayout, { children: children }) })] }));
|
|
9
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthLayoutWithSidebar.d.ts","sourceRoot":"","sources":["../../src/layouts/AuthLayoutWithSidebar.tsx"],"names":[],"mappings":"AAMA,UAAU,0BAA0B;IAClC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,qBAAqB,CAAC,EACpC,QAAQ,EACR,UAAU,EACV,SAAc,GACf,EAAE,0BAA0B,
|
|
1
|
+
{"version":3,"file":"AuthLayoutWithSidebar.d.ts","sourceRoot":"","sources":["../../src/layouts/AuthLayoutWithSidebar.tsx"],"names":[],"mappings":"AAMA,UAAU,0BAA0B;IAClC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,qBAAqB,CAAC,EACpC,QAAQ,EACR,UAAU,EACV,SAAc,GACf,EAAE,0BAA0B,2CA2B5B"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { AuthLayout } from "./AuthLayout.js";
|
|
4
|
-
import { AppAside } from "@lastbrain/ui";
|
|
4
|
+
import { AppAside, AppAsideSkeleton } from "@lastbrain/ui";
|
|
5
5
|
import { useAuthSession } from "../auth/useAuthSession.js";
|
|
6
6
|
export function AuthLayoutWithSidebar({ children, menuConfig, className = "", }) {
|
|
7
7
|
const { isSuperAdmin } = useAuthSession();
|
|
8
|
-
|
|
8
|
+
// Pour la section auth, isAdminSection sera false
|
|
9
|
+
const isAdminSection = false;
|
|
10
|
+
return (_jsxs("div", { className: "flex min-h-screen", children: [!menuConfig ? (_jsx(AppAsideSkeleton, { className: className, isAdminSection: isAdminSection })) : (_jsx(AppAside, { menuConfig: menuConfig, isSuperAdmin: isSuperAdmin, className: className })), _jsx("div", { className: "flex-1 lg:ml-72", children: _jsx(AuthLayout, { children: children }) })] }));
|
|
9
11
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { AdminLayout } from "./AdminLayout.js";
|
|
4
|
-
import { AppAside } from "@lastbrain/ui";
|
|
4
|
+
import { AppAside, AppAsideSkeleton } from "@lastbrain/ui";
|
|
5
5
|
import { useAuthSession } from "../auth/useAuthSession.js";
|
|
6
6
|
|
|
7
7
|
interface AdminLayoutWithSidebarProps {
|
|
@@ -17,17 +17,29 @@ export function AdminLayoutWithSidebar({
|
|
|
17
17
|
}: AdminLayoutWithSidebarProps) {
|
|
18
18
|
const { isSuperAdmin } = useAuthSession();
|
|
19
19
|
|
|
20
|
+
// Détecter si on est dans la section admin pour le skeleton
|
|
21
|
+
const isAdminSection =
|
|
22
|
+
typeof window !== "undefined" &&
|
|
23
|
+
window.location.pathname.startsWith("/admin");
|
|
24
|
+
|
|
20
25
|
return (
|
|
21
26
|
<div className="flex min-h-screen">
|
|
22
|
-
{menuConfig
|
|
27
|
+
{/* Afficher le skeleton pendant le chargement ou si pas de menuConfig */}
|
|
28
|
+
{!menuConfig ? (
|
|
29
|
+
<AppAsideSkeleton
|
|
30
|
+
className={className}
|
|
31
|
+
isAdminSection={isAdminSection}
|
|
32
|
+
/>
|
|
33
|
+
) : (
|
|
23
34
|
<AppAside
|
|
24
35
|
menuConfig={menuConfig}
|
|
25
36
|
isSuperAdmin={isSuperAdmin}
|
|
26
37
|
className={className}
|
|
27
38
|
/>
|
|
28
39
|
)}
|
|
40
|
+
|
|
29
41
|
{/* Contenu principal avec marge pour la sidebar */}
|
|
30
|
-
<div className=
|
|
42
|
+
<div className="flex-1 lg:ml-72">
|
|
31
43
|
<AdminLayout>{children}</AdminLayout>
|
|
32
44
|
</div>
|
|
33
45
|
</div>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { AuthLayout } from "./AuthLayout.js";
|
|
4
|
-
import { AppAside } from "@lastbrain/ui";
|
|
4
|
+
import { AppAside, AppAsideSkeleton } from "@lastbrain/ui";
|
|
5
5
|
import { useAuthSession } from "../auth/useAuthSession.js";
|
|
6
6
|
|
|
7
7
|
interface AuthLayoutWithSidebarProps {
|
|
@@ -17,9 +17,18 @@ export function AuthLayoutWithSidebar({
|
|
|
17
17
|
}: AuthLayoutWithSidebarProps) {
|
|
18
18
|
const { isSuperAdmin } = useAuthSession();
|
|
19
19
|
|
|
20
|
+
// Pour la section auth, isAdminSection sera false
|
|
21
|
+
const isAdminSection = false;
|
|
22
|
+
|
|
20
23
|
return (
|
|
21
24
|
<div className="flex min-h-screen">
|
|
22
|
-
{menuConfig
|
|
25
|
+
{/* Afficher le skeleton pendant le chargement ou si pas de menuConfig */}
|
|
26
|
+
{!menuConfig ? (
|
|
27
|
+
<AppAsideSkeleton
|
|
28
|
+
className={className}
|
|
29
|
+
isAdminSection={isAdminSection}
|
|
30
|
+
/>
|
|
31
|
+
) : (
|
|
23
32
|
<AppAside
|
|
24
33
|
menuConfig={menuConfig}
|
|
25
34
|
isSuperAdmin={isSuperAdmin}
|
|
@@ -27,7 +36,7 @@ export function AuthLayoutWithSidebar({
|
|
|
27
36
|
/>
|
|
28
37
|
)}
|
|
29
38
|
{/* Contenu principal avec marge pour la sidebar */}
|
|
30
|
-
<div className=
|
|
39
|
+
<div className="flex-1 lg:ml-72">
|
|
31
40
|
<AuthLayout>{children}</AuthLayout>
|
|
32
41
|
</div>
|
|
33
42
|
</div>
|