Skip to content

Commit

Permalink
Merge pull request #5 from Ferlab-Ste-Justine/add-auth
Browse files Browse the repository at this point in the history
add keycloak authentication
  • Loading branch information
jecos authored Jan 21, 2025
2 parents 78af561 + 9b821cc commit d287213
Show file tree
Hide file tree
Showing 20 changed files with 2,488 additions and 2,908 deletions.
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20.18.0
31 changes: 21 additions & 10 deletions frontend/components/feature/main_navigation/index.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@

interface IProps {
languages?: string[];
userName: string;
onLogout(): void;
}

export function MainNav({ languages = [] }: IProps) {
export function MainNav({ languages = [], userName, onLogout }: IProps) {
return (
<header className="h-15 bg-gray-800 text-white flex items-center justify-between px-4">
<div className="flex space-x-3 items-center">
<div className="text-lg font-bold">My App</div>
<nav>
<a href="#" className="px-4 py-2 hover:bg-gray-700">Dashboard</a>
<a href="#" className="px-4 py-2 hover:bg-gray-700">Variant</a>
<a href="#" className="px-4 py-2 hover:bg-gray-700">
Dashboard
</a>
<a href="#" className="px-4 py-2 hover:bg-gray-700">
Variant
</a>
</nav>
</div>
<div className="flex items-center space-x-4">
Expand All @@ -23,15 +28,21 @@ export function MainNav({ languages = [] }: IProps) {
)}

<div className="relative">
<button className="py-2 px-3">Account</button>
<button className="py-2 px-3">{userName}</button>
<div className="absolute right-0 mt-2 w-40 bg-white text-black rounded shadow hidden group-hover:block">
<a href="#" className="block px-4 py-2 hover:bg-gray-200">Profile</a>
<a href="#" className="block px-4 py-2 hover:bg-gray-200">Settings</a>
<a href="#" className="block px-4 py-2 hover:bg-gray-200">
Profile
</a>
<a href="#" className="block px-4 py-2 hover:bg-gray-200">
Settings
</a>
</div>
</div>

<button className="text-white py-2 px-3 ">Logout</button>
<button className="text-white py-2 px-3 " onClick={onLogout}>
Logout
</button>
</div>
</header >);
</header>
);
}

Loading

0 comments on commit d287213

Please sign in to comment.