source: petify-frontend/src/components/TopNav.vue@ fa32d0f

Last change on this file since fa32d0f was fa32d0f, checked in by veronika-ils <ilioskaveronika@…>, 4 hours ago

Added form for clinics

  • Property mode set to 100644
File size: 4.3 KB
RevLine 
[92e7c7a]1<template>
2 <nav class="navbar navbar-expand-lg navbar-light bg-white border-bottom sticky-top nav-shadow">
3 <div class="container py-2">
4 <!-- Petify logo links to Listings and stays orange -->
5 <RouterLink class="navbar-brand fw-bold brand" to="/">
6 Petify
7 </RouterLink>
8
9 <button
10 class="navbar-toggler"
11 type="button"
12 aria-controls="petifyNavbar"
13 :aria-expanded="isOpen ? 'true' : 'false'"
14 aria-label="Toggle navigation"
15 @click="isOpen = !isOpen"
16 >
17 <span class="navbar-toggler-icon"></span>
18 </button>
19
20 <div
21 id="petifyNavbar"
22 class="navbar-collapse"
23 :class="isOpen ? 'collapse show' : 'collapse'"
24 >
25 <div class="d-flex align-items-center gap-2 ms-auto">
26 <div class="d-flex gap-2">
27 <template v-if="auth.isAuthenticated">
28 <RouterLink v-if="auth.user?.userType === 'CLINIC'" class="btn btn-outline-secondary" to="/clinics">
29 Clinic Dashboard
30 </RouterLink>
31 <template v-if="auth.user?.userType === 'ADMIN'">
32 <RouterLink class="btn btn-admin" to="/admin/clinics">
33 <i class="bi bi-hospital"></i> Clinics
34 </RouterLink>
35 <RouterLink class="btn btn-admin" to="/admin/clients">
36 <i class="bi bi-people"></i> Clients
37 </RouterLink>
38 <RouterLink class="btn btn-admin" to="/admin/listings">
39 <i class="bi bi-card-list"></i> Listings
40 </RouterLink>
41 </template>
42 <RouterLink class="btn btn-outline-secondary" to="/profile">
43 {{ auth.user?.firstName }}'s Profile
44 </RouterLink>
45 <button
46 class="btn btn-outline-secondary"
47 type="button"
48 @click="logout"
49 >
50 Log out
51 </button>
52 </template>
53 <template v-else>
[fa32d0f]54 <RouterLink class="btn btn-outline-secondary" to="/clinic-application">
55 Apply as clinic
56 </RouterLink>
[92e7c7a]57 <RouterLink class="btn btn-login" to="/login">
58 Log in
59 </RouterLink>
60 <RouterLink class="btn btn-signup" to="/signup">
61 Sign up
62 </RouterLink>
63 </template>
64 </div>
65 </div>
66 </div>
67 </div>
68 </nav>
69</template>
70
71<script setup lang="ts">
72import { ref, watch } from 'vue'
73import { useRoute, useRouter } from 'vue-router'
74import { useAuthStore } from '../stores/auth.ts'
75
76const route = useRoute()
77const router = useRouter()
78const auth = useAuthStore()
79
80const isOpen = ref(false)
81
82watch(
83 () => route.fullPath,
84 () => {
85 isOpen.value = false
86 },
87)
88
89function logout() {
90 auth.logout()
91 router.push('/')
92}
93</script>
94
95<style scoped>
96.nav-shadow {
97 box-shadow: 0 6px 20px rgba(17, 24, 39, 0.06);
98}
99
100/* Petify logo – orange and stable */
101.brand,
102.brand:hover,
103.brand:focus,
104.brand:active,
105.brand:visited {
106 color: #f97316;
107 text-decoration: none;
108 letter-spacing: 0.3px;
109}
110
111/* Login button */
112.btn-login {
113 border-radius: 12px;
114 padding: 0.45rem 1.1rem;
115 border: 1px solid #e5e7eb;
116 background-color: #ffffff;
117 color: #374151;
118 font-weight: 500;
119 transition: all 0.15s ease;
120}
121
122.btn-login:hover {
123 background-color: #f9fafb;
124 border-color: #d1d5db;
125 color: #111827;
126}
127
128/* Sign up button */
129.btn-signup {
130 border-radius: 12px;
131 padding: 0.45rem 1.2rem;
132 background: linear-gradient(135deg, #fb923c, #f97316);
133 border: none;
134 color: #ffffff;
135 font-weight: 600;
136 box-shadow: 0 6px 16px rgba(249, 115, 22, 0.35);
137 transition: all 0.15s ease;
138}
139
140.btn-signup:hover {
141 transform: translateY(-1px);
142 box-shadow: 0 10px 22px rgba(249, 115, 22, 0.45);
143}
144
145/* Admin button */
146.btn-admin {
147 border-radius: 12px;
148 padding: 0.45rem 1rem;
149 background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
150 border: none;
151 color: #ffffff;
152 font-weight: 600;
153 box-shadow: 0 6px 16px rgba(220, 38, 38, 0.35);
154 transition: all 0.15s ease;
155 display: flex;
156 align-items: center;
157 gap: 6px;
158}
159
160.btn-admin:hover {
161 transform: translateY(-1px);
162 box-shadow: 0 10px 22px rgba(220, 38, 38, 0.45);
163 color: #ffffff;
164 text-decoration: none;
165}
166
167.btn-admin i {
168 font-size: 0.9rem;
169}
170</style>
Note: See TracBrowser for help on using the repository browser.