@sqrzro/admin 2.1.0-bz.19 → 2.1.0-bz.20

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,9 +1,10 @@
1
1
  /// <reference types="react" />
2
2
  export interface AppLayoutProps {
3
3
  children: React.ReactNode;
4
+ logoutButton?: React.ReactNode;
4
5
  user?: {
5
6
  name: string;
6
7
  } | null;
7
8
  }
8
- declare function AppLayout({ children, user }: Readonly<AppLayoutProps>): Promise<JSX.Element>;
9
+ declare function AppLayout({ children, logoutButton, user, }: Readonly<AppLayoutProps>): Promise<JSX.Element>;
9
10
  export default AppLayout;
@@ -4,11 +4,11 @@ import { getConfig } from '../../services/ConfigService';
4
4
  import { getLayout } from '../../services/SettingsService';
5
5
  import AppNavigation from '../AppNavigation';
6
6
  import MePanel from '../MePanel';
7
- async function AppLayout({ children, user }) {
7
+ async function AppLayout({ children, logoutButton, user, }) {
8
8
  const config = getConfig();
9
9
  const layout = await getLayout();
10
10
  return (_jsxs("div", { className: tw('', layout === 'sidebar' ? 'grid grid-cols-[12rem_1fr]' : null), children: [_jsx("header", { className: "bg-slate-800", children: _jsxs("div", { className: tw('flex items-center', layout === 'sidebar'
11
11
  ? 'h-screen flex-col'
12
- : 'h-16 border-b border-slate-700 px-4'), children: [_jsxs(Link, { className: tw(layout === 'sidebar' ? 'my-7 h-12 w-12' : 'h-9 w-9'), href: "/", children: [config.logo?.(), _jsx("span", { className: "sr-only", children: config.app.name })] }), _jsx(AppNavigation, { layout: layout }), _jsx(MePanel, { layout: layout, user: user })] }) }), _jsx("main", { className: "mb-10 block", children: children })] }));
12
+ : 'h-16 border-b border-slate-700 px-4'), children: [_jsxs(Link, { className: tw(layout === 'sidebar' ? 'my-7 h-12 w-12' : 'h-9 w-9'), href: "/", children: [config.logo?.(), _jsx("span", { className: "sr-only", children: config.app.name })] }), _jsx(AppNavigation, { layout: layout }), _jsx(MePanel, { layout: layout, logoutButton: logoutButton, user: user })] }) }), _jsx("main", { className: "mb-10 block", children: children })] }));
13
13
  }
14
14
  export default AppLayout;
@@ -1,3 +1,6 @@
1
1
  /// <reference types="react" />
2
- declare function MeActions(): React.ReactElement;
2
+ interface MeActionsProps {
3
+ logoutButton?: React.ReactNode;
4
+ }
5
+ declare function MeActions({ logoutButton }: Readonly<MeActionsProps>): React.ReactElement;
3
6
  export default MeActions;
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Link } from '@sqrzro/components';
3
- function MeActions() {
4
- return (_jsxs("ul", { className: "flex gap-2 text-xs text-slate-300", children: [_jsx("li", { children: _jsx(Link, { href: "/settings", children: "Settings" }) }), _jsx("li", {})] }));
3
+ function MeActions({ logoutButton }) {
4
+ return (_jsxs("ul", { className: "flex gap-2 text-xs text-slate-300", children: [_jsx("li", { children: _jsx(Link, { href: "/settings", children: "Settings" }) }), _jsx("li", { children: logoutButton })] }));
5
5
  }
6
6
  export default MeActions;
@@ -1,9 +1,10 @@
1
1
  /// <reference types="react" />
2
2
  interface MePanelProps {
3
3
  layout?: string;
4
+ logoutButton?: React.ReactNode;
4
5
  user?: {
5
6
  name: string;
6
7
  } | null;
7
8
  }
8
- declare function MePanel({ layout, user }: Readonly<MePanelProps>): React.ReactElement;
9
+ declare function MePanel({ layout, logoutButton, user }: Readonly<MePanelProps>): React.ReactElement;
9
10
  export default MePanel;
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { tw } from '@sqrzro/components';
3
3
  import MeActions from '../MeActions';
4
- function MePanel({ layout, user }) {
5
- return (_jsxs("div", { className: tw('flex gap-3', layout === 'sidebar' ? 'w-full p-4' : 'ml-auto items-center'), children: [_jsxs("div", { className: tw('flex flex-col gap-0.5 text-white', layout === 'sidebar' ? '' : 'items-end'), children: [_jsx("strong", { children: user?.name }), _jsx(MeActions, {})] }), layout === 'sidebar' ? null : (_jsx("div", { className: "h-9 w-9 flex-none rounded-full border-4 border-slate-500" }))] }));
4
+ function MePanel({ layout, logoutButton, user }) {
5
+ return (_jsxs("div", { className: tw('flex gap-3', layout === 'sidebar' ? 'w-full p-4' : 'ml-auto items-center'), children: [_jsxs("div", { className: tw('flex flex-col gap-0.5 text-white', layout === 'sidebar' ? '' : 'items-end'), children: [_jsx("strong", { children: user?.name }), _jsx(MeActions, { logoutButton: logoutButton })] }), layout === 'sidebar' ? null : (_jsx("div", { className: "h-9 w-9 flex-none rounded-full border-4 border-slate-500" }))] }));
6
6
  }
7
7
  export default MePanel;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sqrzro/admin",
3
3
  "type": "module",
4
- "version": "2.1.0-bz.19",
4
+ "version": "2.1.0-bz.20",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "license": "ISC",