source: frontend/src/components/Header.tsx

main
Last change on this file was 700e2f9, checked in by 186079 <matej.milevski@…>, 5 days ago

Init

  • Property mode set to 100644
File size: 3.5 KB
RevLine 
[700e2f9]1import logo from "../../assets/icare.png";
2import { type Component, Show } from "solid-js";
3import { A } from "@solidjs/router";
4import { useAuth } from "@/context/AuthContext";
5import UserMenu from "@/components/UserMenu";
6import { UserType } from "@/enums/UserType";
7
8const Header: Component = () => {
9 const { isAuthenticated, user } = useAuth();
10
11 return (
12 <header class="bg-white shadow-sm border-b border-gray-200">
13 <nav class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
14 <div class="flex justify-between items-center h-16">
15 <div class="flex items-center">
16 <A href="/" class="flex items-center gap-2">
17 <img src={logo} alt="iCare" class="h-10 w-auto" />
18 <h1 class="text-2xl font-bold text-blue-600">iCare</h1>
19 </A>
20 </div>
21
22 <div class="flex items-center gap-6">
23 <A
24 href="/"
25 class="text-gray-700 hover:text-blue-600 font-medium transition-colors"
26 activeClass="text-blue-600"
27 >
28 Home
29 </A>
30
31 <Show when={isAuthenticated() && user()?.userType === "PATIENT"}>
32 <A
33 href="/blogs"
34 class="text-gray-700 hover:text-blue-600 font-medium transition-colors"
35 activeClass="text-blue-600"
36 >
37 Blogs
38 </A>
39 <A
40 href="/therapists"
41 class="text-gray-700 hover:text-blue-600 font-medium transition-colors"
42 activeClass="text-blue-600"
43 >
44 Therapists
45 </A>
46 <A
47 href="/consultations"
48 class="text-gray-700 hover:text-blue-600 font-medium transition-colors"
49 activeClass="text-blue-600"
50 >
51 Consultations
52 </A>
53 <A
54 href="/diary"
55 class="text-gray-700 hover:text-blue-600 font-medium transition-colors"
56 activeClass="text-blue-600"
57 >
58 Diary
59 </A>
60 </Show>
61
62 <Show
63 when={
64 isAuthenticated() && user()?.userType === UserType.THERAPIST
65 }
66 >
67 <A
68 href="/consultation-slots"
69 class="text-gray-700 hover:text-blue-600 font-medium transition-colors"
70 activeClass="text-blue-600"
71 >
72 Consultation Slots
73 </A>
74 <A
75 href="/consultations"
76 class="text-gray-700 hover:text-blue-600 font-medium transition-colors"
77 activeClass="text-blue-600"
78 >
79 Consultations
80 </A>
81 <A
82 href="/diary"
83 class="text-gray-700 hover:text-blue-600 font-medium transition-colors"
84 activeClass="text-blue-600"
85 >
86 Patient Diaries
87 </A>
88 </Show>
89
90 <Show
91 when={isAuthenticated()}
92 fallback={
93 <A
94 href="/login"
95 class="text-gray-700 hover:text-blue-600 font-medium transition-colors"
96 activeClass="text-blue-600"
97 >
98 Login
99 </A>
100 }
101 >
102 <UserMenu />
103 </Show>
104 </div>
105 </div>
106 </nav>
107 </header>
108 );
109};
110
111export default Header;
Note: See TracBrowser for help on using the repository browser.