1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-28 12:45:45 +01:00

made nav into a toolbar

This commit is contained in:
addison 2021-02-05 12:34:01 -05:00
parent 3e6f85c206
commit ec933025f3
9 changed files with 183 additions and 162 deletions

View File

@ -63,10 +63,11 @@ import { ShareComponent } from './vault/share.component';
import { VaultComponent } from './vault/vault.component'; import { VaultComponent } from './vault/vault.component';
import { ViewComponent } from './vault/view.component'; import { ViewComponent } from './vault/view.component';
import { AccessComponent } from './send/access.component';
import { AddEditComponent as SendAddEditComponent } from './send/add-edit.component'; import { AddEditComponent as SendAddEditComponent } from './send/add-edit.component';
import { SendComponent } from './send/send.component'; import { SendComponent } from './send/send.component';
import { NavComponent } from './layout/nav.component';
import { registerLocaleData } from '@angular/common'; import { registerLocaleData } from '@angular/common';
import localeBe from '@angular/common/locales/be'; import localeBe from '@angular/common/locales/be';
import localeBg from '@angular/common/locales/bg'; import localeBg from '@angular/common/locales/bg';
@ -160,7 +161,6 @@ registerLocaleData(localeZhTw, 'zh-TW');
], ],
declarations: [ declarations: [
A11yTitleDirective, A11yTitleDirective,
AccessComponent,
AddEditComponent, AddEditComponent,
ApiActionDirective, ApiActionDirective,
AppComponent, AppComponent,
@ -183,6 +183,7 @@ registerLocaleData(localeZhTw, 'zh-TW');
LockComponent, LockComponent,
LoginComponent, LoginComponent,
ModalComponent, ModalComponent,
NavComponent,
PasswordGeneratorComponent, PasswordGeneratorComponent,
PasswordGeneratorHistoryComponent, PasswordGeneratorHistoryComponent,
PasswordHistoryComponent, PasswordHistoryComponent,

View File

@ -0,0 +1,5 @@
<ng-container *ngFor="let item of items">
<a [routerLink]="item.link" class="btn primary" routerLinkActive="active" [title]="item.label">
<i class="fa" [ngClass]="item.icon"></i>{{ item.label }}
</a>
</ng-container>

View File

@ -0,0 +1,20 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-nav',
templateUrl: 'nav.component.html',
})
export class NavComponent {
items: any[] = [
{
link: '/vault',
icon: 'fa-lock',
label: 'My Vault',
},
{
link: '/send',
icon: 'fa-paper-plane',
label: 'Send',
},
];
}

View File

@ -1,7 +0,0 @@
<div class="details">
<div clas="content">
<div class="inner-content">
<p>Under construction</p>
</div>
</div>
</div>

View File

@ -1,18 +0,0 @@
import {
Component,
OnInit,
} from '@angular/core';
@Component({
selector: 'app-send-access',
templateUrl: 'access.component.html',
})
export class AccessComponent implements OnInit {
constructor() {
return;
}
ngOnInit() {
return;
}
}

View File

@ -3,7 +3,6 @@
<div class="mac-bar"></div> <div class="mac-bar"></div>
<div class="content"> <div class="content">
<div class="inner-content"> <div class="inner-content">
<div class="top-content">
<h2 class="sr-only">{{'filters' | i18n}}</h2> <h2 class="sr-only">{{'filters' | i18n}}</h2>
<ul> <ul>
<li [ngClass]="{active: selectedAll}"> <li [ngClass]="{active: selectedAll}">
@ -26,9 +25,8 @@
</li> </li>
</ul> </ul>
</div> </div>
<div class="bottom-content"> <div class="footer">
<a routerLink="/" class="fa fa-lock btn primary icon-link" title="Bitwarden Vault"></a> <app-nav class="nav"></app-nav>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,7 +1,6 @@
<div class="mac-bar"></div> <div class="mac-bar"></div>
<div class="content"> <div class="content">
<div class="inner-content"> <div class="inner-content">
<div class="top-content">
<h2 class="sr-only">{{'filters' | i18n}}</h2> <h2 class="sr-only">{{'filters' | i18n}}</h2>
<ul> <ul>
<li [ngClass]="{active: selectedAll}"> <li [ngClass]="{active: selectedAll}">
@ -99,8 +98,7 @@
</div> </div>
</ng-container> </ng-container>
</div> </div>
<div class="bottom-content"> <div class="footer">
<a routerLink="/send" class="fa fa-paper-plane btn primary icon-link" title="Bitwarden Send"></a> <app-nav class="nav"></app-nav>
</div>
</div> </div>
</div> </div>

View File

@ -77,16 +77,6 @@
text-decoration: underline; text-decoration: underline;
} }
} }
&.icon-link {
padding: 10px;
font-size: 20px;
text-align: center;
text-decoration: none;
margin: 5px 2px;
border-radius: 50%;
width: 45px;
}
} }
.action-buttons { .action-buttons {

View File

@ -24,12 +24,18 @@
border-right-color: themed('borderColor'); border-right-color: themed('borderColor');
} }
.inner-content { .content {
display: flex; display: flex;
height: 100%;
flex-direction: column; flex-direction: column;
flex-grow: 1; flex-grow: 1;
justify-content: space-between; justify-content: space-between;
.footer {
padding: 0;
}
.inner-content {
padding-bottom: 0;
padding-right: 5px; padding-right: 5px;
user-select: none; user-select: none;
@ -37,6 +43,7 @@
margin: 0 0 15px 0; margin: 0 0 15px 0;
} }
} }
}
h2 { h2 {
text-transform: uppercase; text-transform: uppercase;
@ -418,7 +425,7 @@
} }
.footer { .footer {
height: 50px; height: 55px;
flex: 0 0 auto; flex: 0 0 auto;
border-top: 1px solid #000000; border-top: 1px solid #000000;
display: flex; display: flex;
@ -443,4 +450,31 @@
display: flex; display: flex;
} }
} }
.nav {
height: 100%;
width: 100%;
display: flex;
.btn {
width: 100%;
font-size: $font-size-base * 0.8;
flex: 1;
border: 0;
border-radius: 0;
padding-bottom: 4px;
&:not(.active) {
@include themify($themes) {
background-color: themed('backgroundColorAlt');
}
}
i {
font-size: $font-size-base * 1.5;
display: block;
margin-bottom: 2px;
text-align: center;
}
}
}
} }