11'use client' ;
22
33import React from 'react' ;
4+ import Image from 'next/image' ;
45import Link from 'next/link' ;
56import { useMetaKeyPress } from '@/hooks/use-meta-key-press' ;
67import { Session } from 'next-auth' ;
78import { signIn , signOut , useSession } from 'next-auth/react' ;
89import {
910 Avatar ,
1011 Button ,
11- CommandDialog ,
12- CommandEmpty ,
13- CommandGroup ,
14- CommandInput ,
15- CommandItem ,
16- CommandList ,
1712 Divider ,
18- Icon ,
1913 IconButton ,
2014 Popover ,
21- SearchInput ,
2215 Spinner ,
2316 Text ,
2417} from 'opub-ui' ;
2518
26- import { Icons } from '@/components/icons' ;
2719import Sidebar from './sidebar' ;
2820
2921const profileLinks = [
@@ -55,25 +47,54 @@ export function MainNav({ hideSearch = false }) {
5547 return < LogginOutPage /> ;
5648 }
5749
50+ const Navigation = [
51+ {
52+ title : 'All Data' ,
53+ href : '/datasets' ,
54+ } ,
55+ {
56+ title : 'Sectors' ,
57+ href : '/categories' ,
58+ } ,
59+ {
60+ title : 'Use Cases' ,
61+ href : '#' ,
62+ } ,
63+ {
64+ title : 'Publishers' ,
65+ href : '#' ,
66+ } ,
67+ {
68+ title : 'Tools' ,
69+ href : '#' ,
70+ } ,
71+ ] ;
72+
5873 return (
5974 < nav >
6075 < div className = "flex items-center justify-between gap-4" >
61- < div className = "flex gap-1" >
76+ < div className = "flex items-center gap-1" >
6277 < div className = "lg:hidden" >
63- < Sidebar />
78+ < Sidebar
79+ data = { Navigation }
80+ session = { session }
81+ status = { status }
82+ keycloakSessionLogOut = { keycloakSessionLogOut }
83+ signIn = { signIn }
84+ />
6485 </ div >
6586 < Link href = "/" >
6687 < div className = "flex items-center gap-2" >
67- < Icon source = { Icons . logo } size = { 24 } color = "success " />
68- < Text variant = "headingLg " className = "text-surfaceDefault" as = "h1" >
88+ < Image src = { '/ logo.png' } width = { 38 } height = { 38 } alt = "logo " />
89+ < Text variant = "headingXl " className = "text-surfaceDefault" as = "h1" >
6990 CivicDataSpace
7091 </ Text >
7192 </ div >
7293 </ Link >
7394 </ div >
7495
75- < div className = "flex items-center gap-4 " >
76- { ! hideSearch && (
96+ < div className = "flex items-center gap-8 " >
97+ { /* { !hideSearch && (
7798 <SearchInput
7899 placeholder="Search"
79100 name="Search"
@@ -113,35 +134,26 @@ export function MainNav({ hideSearch = false }) {
113134 }
114135 />
115136 )}
116- < div className = "hidden min-w-[102px] lg:block" >
117- < Link href = { '/datasets' } >
118- < Text
119- variant = "headingSm"
120- as = "h1"
121- className = " text-surfaceDefault"
122- >
123- Dataset Listing
124- </ Text >
125- </ Link >
126- </ div >
127-
128- < div className = "hidden min-w-[102px] lg:block" >
129- < Link href = { '/categories' } >
130- < Text
131- variant = "headingSm"
132- as = "h1"
133- className = " text-surfaceDefault"
134- >
135- Categories
136- </ Text >
137- </ Link >
137+ */ }
138+ < div className = "flex items-center gap-5" >
139+ { Navigation . map ( ( item , index ) => (
140+ < div className = "hidden lg:block" key = { index } >
141+ < Link href = { item . href } >
142+ < Text
143+ variant = "headingMd"
144+ as = "h1"
145+ className = "uppercase text-surfaceDefault"
146+ >
147+ { item . title }
148+ </ Text >
149+ </ Link >
150+ </ div >
151+ ) ) }
138152 </ div >
139-
140153 { status === 'loading' ? (
141- < div className = "min-w-[112px]" />
154+ < Spinner />
142155 ) : (
143- < div className = "flex min-w-[112px] shrink-0 items-center justify-end gap-4" >
144- < Icon source = { Icons . notification } color = "onBgDefault" />
156+ < div className = " hidden lg:block" >
145157 { session ?. user ? (
146158 < ProfileContent
147159 session = { session }
@@ -150,12 +162,16 @@ export function MainNav({ hideSearch = false }) {
150162 ) : (
151163 < Button
152164 onClick = { ( ) => {
153- console . log ( process . env . NEXTAUTH_URL , process . env . NEXT_PUBLIC_NEXTAUTH_URL )
165+ console . log (
166+ process . env . NEXTAUTH_URL ,
167+ process . env . NEXT_PUBLIC_NEXTAUTH_URL
168+ ) ;
154169 signIn ( 'keycloak' ) ;
155170 } }
156171 kind = "secondary"
172+ variant = "success"
157173 >
158- Log In
174+ < Text variant = "headingMd" > LOGIN / SIGN UP </ Text >
159175 </ Button >
160176 ) }
161177 </ div >
@@ -166,7 +182,7 @@ export function MainNav({ hideSearch = false }) {
166182 ) ;
167183}
168184
169- const ProfileContent = ( {
185+ export const ProfileContent = ( {
170186 session,
171187 keycloakSessionLogOut,
172188} : {
@@ -186,7 +202,7 @@ const ProfileContent = ({
186202 < Button
187203 kind = "tertiary"
188204 size = "slim"
189- className = "rounded-full hover:no-underline"
205+ className = "rounded-full hover:no-underline"
190206 >
191207 < Avatar
192208 showInitials
@@ -241,19 +257,11 @@ const ProfileContent = ({
241257
242258const LogginOutPage = ( ) => {
243259 return (
244- < div className = "h-screen w-screen overflow-hidden" >
245- < Link href = "/" >
246- < div className = "flex items-center gap-2 pt-[6px]" >
247- < Icon source = { Icons . logo } size = { 24 } color = "success" />
248- < Text variant = "headingLg" as = "h1" >
249- OPub
250- </ Text >
251- </ div >
252- </ Link >
253- < div className = "flex h-full w-full flex-col items-center justify-center gap-1" >
254- < Spinner />
255- < Text variant = "headingLg" > Logging out</ Text >
256- </ div >
260+ < div className = " flex items-center justify-end gap-4" >
261+ < Spinner color = "surface" />
262+ < Text variant = "headingLg" color = "onBgDefault" >
263+ Logging out...
264+ </ Text >
257265 </ div >
258266 ) ;
259267} ;
0 commit comments