Refractor. Update styling
This commit is contained in:
@@ -10,27 +10,27 @@ const { mainNavLinks, adminNavLinks, showAdminSection } = useRoleAccess()
|
||||
function linkClasses(path) {
|
||||
const active = route.path.startsWith(path)
|
||||
return active
|
||||
? 'bg-blue-50 text-blue-700 dark:bg-blue-950/50 dark:text-blue-300'
|
||||
: 'text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-800'
|
||||
? 'bg-brand-soft text-brand-soft-text'
|
||||
: 'text-ink-secondary hover:bg-surface-muted'
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<aside class="hidden w-64 shrink-0 border-r border-gray-200 bg-white dark:border-gray-800 dark:bg-gray-900 lg:flex lg:flex-col">
|
||||
<div class="flex h-16 items-center px-8">
|
||||
<span class="text-lg font-bold text-gray-900 dark:text-gray-100">VigilCare</span>
|
||||
<aside class="hidden w-60 shrink-0 border-r border-border bg-surface-raised lg:flex lg:flex-col">
|
||||
<div class="flex h-14 items-center px-4">
|
||||
<span class="text-base font-bold text-brand">VigilCare</span>
|
||||
</div>
|
||||
<nav class="flex-1 px-4 py-4" aria-label="Main navigation">
|
||||
<ul class="space-y-2">
|
||||
<nav class="flex-1 px-2 py-3" aria-label="Main navigation">
|
||||
<ul class="space-y-0.5">
|
||||
<li v-for="link in mainNavLinks" :key="link.to">
|
||||
<RouterLink
|
||||
:to="link.to"
|
||||
class="flex items-center gap-4 rounded-lg px-4 py-2 text-sm font-medium transition duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500"
|
||||
class="flex items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand"
|
||||
:class="linkClasses(link.to)"
|
||||
>
|
||||
<svg
|
||||
v-if="link.icon === 'ward'"
|
||||
class="h-6 w-6 shrink-0"
|
||||
class="h-5 w-5 shrink-0"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
stroke="currentColor"
|
||||
@@ -45,7 +45,7 @@ function linkClasses(path) {
|
||||
</svg>
|
||||
<svg
|
||||
v-else-if="link.icon === 'sepsis'"
|
||||
class="h-6 w-6 shrink-0"
|
||||
class="h-5 w-5 shrink-0"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
stroke="currentColor"
|
||||
@@ -60,7 +60,7 @@ function linkClasses(path) {
|
||||
</svg>
|
||||
<svg
|
||||
v-else-if="link.icon === 'alerts'"
|
||||
class="h-6 w-6 shrink-0"
|
||||
class="h-5 w-5 shrink-0"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
stroke="currentColor"
|
||||
@@ -75,7 +75,7 @@ function linkClasses(path) {
|
||||
</svg>
|
||||
<svg
|
||||
v-else-if="link.icon === 'departments'"
|
||||
class="h-6 w-6 shrink-0"
|
||||
class="h-5 w-5 shrink-0"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
stroke="currentColor"
|
||||
@@ -90,7 +90,7 @@ function linkClasses(path) {
|
||||
</svg>
|
||||
<svg
|
||||
v-else-if="link.icon === 'reconciliation'"
|
||||
class="h-6 w-6 shrink-0"
|
||||
class="h-5 w-5 shrink-0"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
stroke="currentColor"
|
||||
@@ -105,7 +105,7 @@ function linkClasses(path) {
|
||||
</svg>
|
||||
<svg
|
||||
v-else-if="link.icon === 'ops'"
|
||||
class="h-6 w-6 shrink-0"
|
||||
class="h-5 w-5 shrink-0"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
stroke="currentColor"
|
||||
@@ -120,7 +120,7 @@ function linkClasses(path) {
|
||||
</svg>
|
||||
<svg
|
||||
v-else-if="link.icon === 'analytics'"
|
||||
class="h-6 w-6 shrink-0"
|
||||
class="h-5 w-5 shrink-0"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
stroke="currentColor"
|
||||
@@ -135,7 +135,7 @@ function linkClasses(path) {
|
||||
</svg>
|
||||
<svg
|
||||
v-else-if="link.icon === 'simulation'"
|
||||
class="h-6 w-6 shrink-0"
|
||||
class="h-5 w-5 shrink-0"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
stroke="currentColor"
|
||||
@@ -156,7 +156,7 @@ function linkClasses(path) {
|
||||
</svg>
|
||||
<svg
|
||||
v-else
|
||||
class="h-6 w-6 shrink-0"
|
||||
class="h-5 w-5 shrink-0"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
stroke="currentColor"
|
||||
@@ -174,20 +174,20 @@ function linkClasses(path) {
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div v-if="showAdminSection" class="mt-8">
|
||||
<p class="mb-2 px-4 text-xs font-semibold uppercase tracking-wide text-gray-500 dark:text-gray-400">
|
||||
<div v-if="showAdminSection" class="mt-6">
|
||||
<p class="mb-1.5 px-3 text-xs font-medium text-ink-muted">
|
||||
Admin
|
||||
</p>
|
||||
<ul class="space-y-2">
|
||||
<ul class="space-y-0.5">
|
||||
<li v-for="link in adminNavLinks" :key="link.to">
|
||||
<RouterLink
|
||||
:to="link.to"
|
||||
class="flex items-center gap-4 rounded-lg px-4 py-2 text-sm font-medium transition duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500"
|
||||
class="flex items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand"
|
||||
:class="linkClasses(link.to)"
|
||||
>
|
||||
<svg
|
||||
v-if="link.icon === 'users'"
|
||||
class="h-6 w-6 shrink-0"
|
||||
class="h-5 w-5 shrink-0"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
stroke="currentColor"
|
||||
@@ -202,7 +202,7 @@ function linkClasses(path) {
|
||||
</svg>
|
||||
<svg
|
||||
v-else-if="link.icon === 'audit'"
|
||||
class="h-6 w-6 shrink-0"
|
||||
class="h-5 w-5 shrink-0"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
stroke="currentColor"
|
||||
@@ -217,7 +217,7 @@ function linkClasses(path) {
|
||||
</svg>
|
||||
<svg
|
||||
v-else
|
||||
class="h-6 w-6 shrink-0"
|
||||
class="h-5 w-5 shrink-0"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
stroke="currentColor"
|
||||
@@ -242,21 +242,21 @@ function linkClasses(path) {
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
<div class="border-t border-gray-200 px-4 py-4 dark:border-gray-800">
|
||||
<div class="mb-2 px-4">
|
||||
<p class="truncate text-sm font-medium text-gray-900 dark:text-gray-100">
|
||||
<div class="border-t border-border px-2 py-3">
|
||||
<div class="mb-1.5 px-3">
|
||||
<p class="truncate text-sm font-medium text-ink">
|
||||
{{ authStore.displayName }}
|
||||
</p>
|
||||
<p class="truncate text-xs text-gray-500 dark:text-gray-400">
|
||||
<p class="truncate text-xs text-ink-muted">
|
||||
{{ authStore.role }}
|
||||
</p>
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
class="flex w-full items-center gap-4 rounded-lg px-4 py-2 text-sm font-medium text-gray-700 transition duration-200 hover:bg-red-50 hover:text-red-600 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-red-500 dark:text-gray-300 dark:hover:bg-red-950/50 dark:hover:text-red-400"
|
||||
class="flex w-full items-center gap-3 rounded-md px-3 py-2 text-sm font-medium text-ink-secondary transition duration-150 hover:bg-severity-critical-light hover:text-severity-critical focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-severity-critical"
|
||||
@click="authStore.logout()"
|
||||
>
|
||||
<svg class="h-6 w-6 shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true">
|
||||
<svg class="h-5 w-5 shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" />
|
||||
</svg>
|
||||
Sign out
|
||||
|
||||
Reference in New Issue
Block a user