mirror of
https://github.com/bitwarden/browser
synced 2025-12-14 07:13:32 +00:00
button styles and conditional add button
This commit is contained in:
@@ -11,13 +11,22 @@
|
|||||||
<i class="fa fa-search"></i>
|
<i class="fa fa-search"></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="right">
|
<div class="right">
|
||||||
<button type="button" appBlurClick (click)="addCipher()" title="{{'addItem' | i18n}}">
|
<button type="button" appBlurClick (click)="addCipher()" title="{{'addItem' | i18n}}" *ngIf="showAdd">
|
||||||
<i class="fa fa-plus fa-lg"></i>
|
<i class="fa fa-plus fa-lg"></i>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
<content>
|
<content>
|
||||||
<ng-container *ngIf="(ciphers | searchCiphers: searchText) as searchedCiphers">
|
<ng-container *ngIf="(ciphers | searchCiphers: searchText) as searchedCiphers">
|
||||||
|
<div class="no-items" *ngIf="!searchedCiphers.length">
|
||||||
|
<i class="fa fa-spinner fa-spin fa-3x" *ngIf="!loaded"></i>
|
||||||
|
<ng-container *ngIf="loaded">
|
||||||
|
<p>{{'noItemsInList' | i18n}}</p>
|
||||||
|
<button (click)="addCipher()" class="btn block primary link" *ngIf="showAdd">
|
||||||
|
{{'addItem' | i18n}}
|
||||||
|
</button>
|
||||||
|
</ng-container>
|
||||||
|
</div>
|
||||||
<div class="box list only-list" *ngIf="searchedCiphers.length > 0">
|
<div class="box list only-list" *ngIf="searchedCiphers.length > 0">
|
||||||
<div class="box-header">
|
<div class="box-header">
|
||||||
{{groupingTitle}}
|
{{groupingTitle}}
|
||||||
@@ -28,13 +37,5 @@
|
|||||||
(onSelected)="selectCipher($event)"></app-ciphers-list>
|
(onSelected)="selectCipher($event)"></app-ciphers-list>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="no-items" *ngIf="!searchedCiphers.length">
|
|
||||||
<i class="fa fa-spinner fa-spin fa-3x" *ngIf="!loaded"></i>
|
|
||||||
<ng-container *ngIf="loaded">
|
|
||||||
<i class="fa fa-frown-o fa-4x"></i>
|
|
||||||
<p>{{'noItemsInList' | i18n}}</p>
|
|
||||||
<button (click)="addCipher()" class="btn block primary link">{{'addItem' | i18n}}</button>
|
|
||||||
</ng-container>
|
|
||||||
</div>
|
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</content>
|
</content>
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ export class CiphersComponent extends BaseCiphersComponent implements OnInit, On
|
|||||||
groupingTitle: string;
|
groupingTitle: string;
|
||||||
searchText: string;
|
searchText: string;
|
||||||
state: any;
|
state: any;
|
||||||
|
showAdd = true;
|
||||||
|
|
||||||
constructor(cipherService: CipherService, private route: ActivatedRoute,
|
constructor(cipherService: CipherService, private route: ActivatedRoute,
|
||||||
private router: Router, private location: Location,
|
private router: Router, private location: Location,
|
||||||
@@ -82,6 +83,7 @@ export class CiphersComponent extends BaseCiphersComponent implements OnInit, On
|
|||||||
}
|
}
|
||||||
await super.load((c) => c.folderId === folderId);
|
await super.load((c) => c.folderId === folderId);
|
||||||
} else if (params.collectionId) {
|
} else if (params.collectionId) {
|
||||||
|
this.showAdd = false;
|
||||||
this.searchPlaceholder = this.i18nService.t('searchCollection');
|
this.searchPlaceholder = this.i18nService.t('searchCollection');
|
||||||
const collection = await this.collectionService.get(params.collectionId);
|
const collection = await this.collectionService.get(params.collectionId);
|
||||||
if (collection != null) {
|
if (collection != null) {
|
||||||
|
|||||||
58
src/scss/buttons.scss
Normal file
58
src/scss/buttons.scss
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
@import "variables.scss";
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
background-color: $button-backgound-color;
|
||||||
|
border-radius: $border-radius;
|
||||||
|
padding: 7px 15px;
|
||||||
|
border: 1px solid $button-border-color;
|
||||||
|
font-size: $font-size-base;
|
||||||
|
color: $button-color;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-align: center;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
&.primary {
|
||||||
|
color: $button-color-primary;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.danger {
|
||||||
|
color: $button-color-danger;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover:not([disabled]) {
|
||||||
|
cursor: pointer;
|
||||||
|
background-color: darken($button-backgound-color, 1.5%);
|
||||||
|
border-color: darken($button-border-color, 17%);
|
||||||
|
color: darken($button-color, 10%);
|
||||||
|
|
||||||
|
&.primary {
|
||||||
|
color: darken($button-color-primary, 6%);
|
||||||
|
}
|
||||||
|
|
||||||
|
&.danger {
|
||||||
|
color: darken($button-color-danger, 6%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&:focus:not([disabled]) {
|
||||||
|
cursor: pointer;
|
||||||
|
background-color: darken($button-backgound-color, 6%);
|
||||||
|
border-color: darken($button-border-color, 25%);
|
||||||
|
outline: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&[disabled] {
|
||||||
|
opacity: 0.65;
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.block {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.link {
|
||||||
|
border: none !important;
|
||||||
|
background: none !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
@import "variables.scss";
|
@import "variables.scss";
|
||||||
@import "base.scss";
|
@import "base.scss";
|
||||||
@import "box.scss";
|
@import "box.scss";
|
||||||
|
@import "buttons.scss";
|
||||||
@import "misc.scss";
|
@import "misc.scss";
|
||||||
@import "plugins.scss";
|
@import "plugins.scss";
|
||||||
@import "environment.scss";
|
@import "environment.scss";
|
||||||
|
|||||||
Reference in New Issue
Block a user