@lastbrain/module-auth 0.1.20 → 0.1.21
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountButton.d.ts","sourceRoot":"","sources":["../../src/components/AccountButton.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAGlD,UAAU,kBAAkB;IAC1B,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,WAAW,CAAC,EAAE,KAAK,CAAC;QAClB,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;KACd,CAAC,CAAC;IACH,QAAQ,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACvC;AASD,eAAO,MAAM,aAAa,GAAI,kCAI3B,kBAAkB,
|
|
1
|
+
{"version":3,"file":"AccountButton.d.ts","sourceRoot":"","sources":["../../src/components/AccountButton.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAGlD,UAAU,kBAAkB;IAC1B,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,WAAW,CAAC,EAAE,KAAK,CAAC;QAClB,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;KACd,CAAC,CAAC;IACH,QAAQ,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACvC;AASD,eAAO,MAAM,aAAa,GAAI,kCAI3B,kBAAkB,4CA8HpB,CAAC"}
|
|
@@ -14,10 +14,12 @@ const getIcon = (iconName) => {
|
|
|
14
14
|
export const AccountButton = ({ user, accountMenu = [], onLogout, }) => {
|
|
15
15
|
if (!user)
|
|
16
16
|
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "block md:hidden", children: [_jsx(Button, { as: Link, href: "/signin", radius: "full", isIconOnly: true, variant: "light", color: "primary", children: _jsx(LucideIcons.LogIn, { size: 16 }) }), _jsx(Button, { as: Link, href: "/signup", radius: "full", isIconOnly: true, variant: "flat", className: "ml-2", color: "secondary", children: _jsx(LucideIcons.UserPlus2, { size: 16 }) })] }), _jsxs("div", { className: "hidden md:block", children: [_jsx(Button, { as: Link, href: "/signin", startContent: _jsx(LucideIcons.LogIn, { size: 16 }), variant: "light", color: "primary", children: "Se connecter" }), _jsx(Button, { as: Link, href: "/signup", variant: "flat", className: "ml-2", color: "secondary", startContent: _jsx(LucideIcons.UserPlus2, { size: 16 }), children: "S'inscrire" })] })] }));
|
|
17
|
-
return (_jsxs(Dropdown, { children: [_jsx(DropdownTrigger, { children: _jsx(Avatar, { size: "sm", src:
|
|
18
|
-
|
|
17
|
+
return (_jsxs(Dropdown, { children: [_jsx(DropdownTrigger, { children: user?.user_metadata.avatar ? (_jsx(Avatar, { size: "sm", src: user?.user_metadata.avatar
|
|
18
|
+
? `/api/storage/${user?.user_metadata.avatar}`
|
|
19
|
+
: undefined, title: user.email, fallback: _jsx(LucideIcons.User2, { size: 18 }), classNames: {
|
|
20
|
+
base: "cursor-pointer bg-white/0",
|
|
19
21
|
icon: "text-default-700",
|
|
20
|
-
} }) }), _jsx(DropdownMenu, { items: [
|
|
22
|
+
} })) : (_jsx(Button, { size: "sm", variant: "flat", radius: "full", isIconOnly: true, children: _jsx(LucideIcons.User2, { size: 16 }) })) }), _jsx(DropdownMenu, { items: [
|
|
21
23
|
{
|
|
22
24
|
key: "hello",
|
|
23
25
|
label: `Bonjour ${user?.user_metadata?.full_name || user.email}`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lastbrain/module-auth",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.21",
|
|
4
4
|
"description": "Module d'authentification complet pour LastBrain avec Supabase",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
"directory": "packages/module-auth"
|
|
25
25
|
},
|
|
26
26
|
"publishConfig": {
|
|
27
|
-
"access": "public"
|
|
27
|
+
"access": "public",
|
|
28
|
+
"registry": "https://registry.npmjs.org"
|
|
28
29
|
},
|
|
29
30
|
"files": [
|
|
30
31
|
"dist",
|
|
@@ -92,16 +92,26 @@ export const AccountButton = ({
|
|
|
92
92
|
return (
|
|
93
93
|
<Dropdown>
|
|
94
94
|
<DropdownTrigger>
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
95
|
+
{user?.user_metadata.avatar ? (
|
|
96
|
+
<Avatar
|
|
97
|
+
size="sm"
|
|
98
|
+
src={
|
|
99
|
+
user?.user_metadata.avatar
|
|
100
|
+
? `/api/storage/${user?.user_metadata.avatar}`
|
|
101
|
+
: undefined
|
|
102
|
+
}
|
|
103
|
+
title={user.email}
|
|
104
|
+
fallback={<LucideIcons.User2 size={18} />}
|
|
105
|
+
classNames={{
|
|
106
|
+
base: "cursor-pointer bg-white/0",
|
|
107
|
+
icon: "text-default-700",
|
|
108
|
+
}}
|
|
109
|
+
/>
|
|
110
|
+
) : (
|
|
111
|
+
<Button size="sm" variant="flat" radius="full" isIconOnly>
|
|
112
|
+
<LucideIcons.User2 size={16} />
|
|
113
|
+
</Button>
|
|
114
|
+
)}
|
|
105
115
|
</DropdownTrigger>
|
|
106
116
|
|
|
107
117
|
<DropdownMenu
|