@c-rex/components 0.0.11 → 0.0.12
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/package.json +3 -2
- package/src/navbar/navbar.tsx +16 -10
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@c-rex/components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.12",
|
|
4
4
|
"files": [
|
|
5
5
|
"src"
|
|
6
6
|
],
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
|
-
},
|
|
9
|
+
},
|
|
10
10
|
"sideEffects": false,
|
|
11
11
|
"exports": {
|
|
12
12
|
"./autocomplete": {
|
|
@@ -88,6 +88,7 @@
|
|
|
88
88
|
"@c-rex/ui": "*",
|
|
89
89
|
"@c-rex/utils": "*",
|
|
90
90
|
"@c-rex/config": "*",
|
|
91
|
+
"@c-rex/constants": "*",
|
|
91
92
|
"next": "^14",
|
|
92
93
|
"react": "^18",
|
|
93
94
|
"react-dom": "^18",
|
package/src/navbar/navbar.tsx
CHANGED
|
@@ -3,6 +3,9 @@ import Link from "next/link";
|
|
|
3
3
|
import Image from "next/image";
|
|
4
4
|
import { SingOut, SingInBtn } from "./sing-in-out-btns";
|
|
5
5
|
import { getServerSession } from "next-auth";
|
|
6
|
+
import { getFromMemory } from "@c-rex/utils";
|
|
7
|
+
import { SDK_CONFIG_KEY } from "@c-rex/constants";
|
|
8
|
+
import { ConfigInterface } from "@c-rex/interfaces";
|
|
6
9
|
|
|
7
10
|
|
|
8
11
|
interface NavBarProps {
|
|
@@ -12,6 +15,7 @@ interface NavBarProps {
|
|
|
12
15
|
|
|
13
16
|
export const NavBar: FC<NavBarProps> = async () => {
|
|
14
17
|
const session = await getServerSession()
|
|
18
|
+
const configs: ConfigInterface = await getFromMemory(SDK_CONFIG_KEY)
|
|
15
19
|
|
|
16
20
|
return (
|
|
17
21
|
<header className="sticky top-0 z-40 flex w-full bg-background/60 backdrop-blur-xl transition-all bg-transparent border-b justify-center py-4">
|
|
@@ -53,16 +57,18 @@ export const NavBar: FC<NavBarProps> = async () => {
|
|
|
53
57
|
</nav>
|
|
54
58
|
</div>
|
|
55
59
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
60
|
+
{configs.OIDC.user.enabled && (
|
|
61
|
+
<div className="flex items-center space-x-3">
|
|
62
|
+
{session ? (
|
|
63
|
+
<>
|
|
64
|
+
<span>Welcome, {session.user?.name}</span>
|
|
65
|
+
<SingOut />
|
|
66
|
+
</>
|
|
67
|
+
) : (
|
|
68
|
+
<SingInBtn />
|
|
69
|
+
)}
|
|
70
|
+
</div>
|
|
71
|
+
)}
|
|
66
72
|
</div>
|
|
67
73
|
</header>
|
|
68
74
|
);
|