UI: helle Seitenleiste statt schwarz + aufgewertete Topbar
Look & Feel an die Referenz angepasst: weiße Navigation mit Orange-Akzent (aktives Item orange-soft, Chevrons, graue Icons) statt dunkler Sidebar. Topbar mit Nutzer-Block (Avatar-Initialen, Name, Rolle, Firma). Navi bleibt flach (keine Gruppen-Einteilung). name im CurrentUser-Typ ergänzt. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
18894c7b52
commit
1f45e35ab5
@ -26,6 +26,16 @@ const nav = computed<NavItem[]>(() => [
|
||||
const contextLabel = computed(() =>
|
||||
auth.user?.company?.name ?? auth.user?.reseller?.name ?? 'Plattform',
|
||||
)
|
||||
const userName = computed(() => auth.user?.name || auth.user?.email || '')
|
||||
const initials = computed(() =>
|
||||
userName.value.split(/[\s@.]+/).filter(Boolean).slice(0, 2).map((s) => s[0]).join('').toUpperCase() || 'U',
|
||||
)
|
||||
const roleLabel = computed(() => {
|
||||
if (auth.isPlatformAdmin) return 'Plattform-Admin'
|
||||
if (auth.isResellerAdmin) return 'Reseller-Admin'
|
||||
if (auth.isCompanyAdmin) return 'Firmen-Admin'
|
||||
return 'Mitarbeiter'
|
||||
})
|
||||
|
||||
function logout() {
|
||||
auth.logout()
|
||||
@ -42,14 +52,18 @@ async function stopImpersonation() {
|
||||
<div class="shell">
|
||||
<aside class="sidebar">
|
||||
<div class="sidebar__brand">
|
||||
<span class="brand-logo" style="color:#fff">vcard4<span class="tag">reseller</span></span>
|
||||
<span class="brand-logo">vcard4<span class="tag">reseller</span></span>
|
||||
</div>
|
||||
<nav class="sidebar__nav">
|
||||
<RouterLink v-for="item in nav" :key="item.to" :to="item.to" class="navlink"
|
||||
:class="{ active: $route.path === item.to }">
|
||||
<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round"><path :d="item.icon" /></svg>
|
||||
<span>{{ item.label }}</span>
|
||||
<span class="navlink__icon">
|
||||
<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round"><path :d="item.icon" /></svg>
|
||||
</span>
|
||||
<span class="navlink__label">{{ item.label }}</span>
|
||||
<svg class="navlink__chev" viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor"
|
||||
stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 18l6-6-6-6" /></svg>
|
||||
</RouterLink>
|
||||
</nav>
|
||||
</aside>
|
||||
@ -65,7 +79,13 @@ async function stopImpersonation() {
|
||||
<strong>{{ contextLabel }}</strong>
|
||||
</div>
|
||||
<div class="topbar__user">
|
||||
<span class="muted">{{ auth.user?.email }}</span>
|
||||
<div class="user">
|
||||
<div class="user__avatar">{{ initials }}</div>
|
||||
<div class="user__meta">
|
||||
<strong>{{ userName }}</strong>
|
||||
<span class="muted">{{ roleLabel }}<template v-if="auth.user?.company"> · {{ auth.user.company.name }}</template></span>
|
||||
</div>
|
||||
</div>
|
||||
<button class="btn btn-ghost btn-sm" @click="logout">Abmelden</button>
|
||||
</div>
|
||||
</header>
|
||||
@ -77,30 +97,46 @@ async function stopImpersonation() {
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.shell { display: flex; min-height: 100vh; }
|
||||
.shell { display: flex; min-height: 100vh; background: var(--bg); }
|
||||
|
||||
.sidebar {
|
||||
width: 240px; flex-shrink: 0; background: var(--sidebar); color: #cfcfd2;
|
||||
width: 248px; flex-shrink: 0; background: #fff; color: var(--text);
|
||||
border-right: 1px solid var(--line);
|
||||
display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
|
||||
}
|
||||
.sidebar__brand { padding: 1.4rem 1.3rem; font-size: 1.15rem; }
|
||||
.sidebar__nav { display: flex; flex-direction: column; gap: 2px; padding: .5rem .7rem; }
|
||||
.sidebar__brand { padding: 1.5rem 1.4rem 1.2rem; font-size: 1.2rem; }
|
||||
.sidebar__nav { display: flex; flex-direction: column; gap: 3px; padding: .4rem .7rem; overflow-y: auto; }
|
||||
.navlink {
|
||||
display: flex; align-items: center; gap: .8rem; padding: .7rem .8rem;
|
||||
border-radius: var(--radius-sm); color: #c2c2c6; font-size: .92rem; font-weight: 600;
|
||||
display: flex; align-items: center; gap: .75rem; padding: .62rem .7rem;
|
||||
border-radius: var(--radius-sm); color: #5b5b5b; font-size: .92rem; font-weight: 600;
|
||||
}
|
||||
.navlink:hover { background: var(--sidebar-hover); color: #fff; text-decoration: none; }
|
||||
.navlink.active { background: var(--psc-orange); color: #fff; }
|
||||
.navlink__icon { display: flex; color: #9a9a9a; }
|
||||
.navlink__label { flex: 1; }
|
||||
.navlink__chev { color: #cfcfcf; }
|
||||
.navlink:hover { background: #f6f6f6; color: var(--text); text-decoration: none; }
|
||||
.navlink:hover .navlink__icon { color: #6f6f6f; }
|
||||
.navlink.active { background: var(--psc-orange-soft); color: var(--psc-orange-dark); }
|
||||
.navlink.active .navlink__icon,
|
||||
.navlink.active .navlink__chev { color: var(--psc-orange); }
|
||||
|
||||
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
|
||||
.imp-banner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .55rem 1.6rem; background: var(--psc-orange); color: #fff; font-size: .9rem; font-weight: 600; }
|
||||
.imp-banner .btn { background: #fff; color: var(--psc-orange-dark); }
|
||||
.topbar {
|
||||
display: flex; align-items: center; justify-content: space-between;
|
||||
padding: 1rem 1.6rem; background: #fff; border-bottom: 1px solid var(--line);
|
||||
padding: .85rem 1.6rem; background: #fff; border-bottom: 1px solid var(--line);
|
||||
}
|
||||
.topbar__ctx { display: flex; flex-direction: column; line-height: 1.2; }
|
||||
.topbar__ctx .muted { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
|
||||
.topbar__user { display: flex; align-items: center; gap: 1rem; }
|
||||
.topbar__user { display: flex; align-items: center; gap: 1.1rem; }
|
||||
.user { display: flex; align-items: center; gap: .65rem; }
|
||||
.user__avatar {
|
||||
width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
|
||||
background: var(--psc-orange-soft); color: var(--psc-orange-dark);
|
||||
display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem;
|
||||
}
|
||||
.user__meta { display: flex; flex-direction: column; line-height: 1.25; }
|
||||
.user__meta strong { font-size: .92rem; }
|
||||
.user__meta .muted { font-size: .76rem; }
|
||||
.content { padding: 1.8rem; }
|
||||
</style>
|
||||
|
||||
@ -10,6 +10,7 @@ export interface TenantRef {
|
||||
export interface CurrentUser {
|
||||
id: string
|
||||
email: string
|
||||
name?: string
|
||||
roles: string[]
|
||||
reseller: TenantRef | null
|
||||
company: TenantRef | null
|
||||
|
||||
Loading…
Reference in New Issue
Block a user