1
0
mirror of https://github.com/bitwarden/jslib synced 2025-12-16 08:13:26 +00:00

[Icons] Update font sheet (#582)

* Initial commit for icon update

* Updated lg to reflect current usage

* Created BitwardenIconsService

* Prettier updates

* More prettier updates

* Updated font

* Prettier

* Added new icons to service map

* Removed variables and converted css to use scss maps and exported list

* Updated font sheet (130)

* Removed base class and replaced bolt icon

* Added 3x icon size

* Added sm text size helper

* Added rotate 270 helper

* Prettier

* Updated font sheet

* Requested Changes

* Removed BitwardenIcons Util - obsolete
This commit is contained in:
Vincent Salucci
2022-01-24 15:40:04 -06:00
committed by GitHub
parent af7da0e942
commit a985621bb9
10 changed files with 448 additions and 25 deletions

View File

@@ -9,15 +9,6 @@ import { StateService } from "jslib-common/abstractions/state.service";
import { Utils } from "jslib-common/misc/utils";
const IconMap: any = {
"fa-globe": String.fromCharCode(0xf0ac),
"fa-sticky-note-o": String.fromCharCode(0xf24a),
"fa-id-card-o": String.fromCharCode(0xf2c3),
"fa-credit-card": String.fromCharCode(0xf09d),
"fa-android": String.fromCharCode(0xf17b),
"fa-apple": String.fromCharCode(0xf179),
};
/**
* Provides a mapping from supported card brands to
* the filenames of icon that should be present in images/cards folder of clients.
@@ -59,25 +50,21 @@ export class IconComponent implements OnChanges {
this.load();
}
get iconCode(): string {
return IconMap[this.icon];
}
protected load() {
switch (this.cipher.type) {
case CipherType.Login:
this.icon = "fa-globe";
this.icon = "bwi-globe";
this.setLoginIcon();
break;
case CipherType.SecureNote:
this.icon = "fa-sticky-note-o";
this.icon = "bwi-sticky-note";
break;
case CipherType.Card:
this.icon = "fa-credit-card";
this.icon = "bwi-credit-card";
this.setCardIcon();
break;
case CipherType.Identity:
this.icon = "fa-id-card-o";
this.icon = "bwi-id-card";
break;
default:
break;
@@ -90,10 +77,10 @@ export class IconComponent implements OnChanges {
let isWebsite = false;
if (hostnameUri.indexOf("androidapp://") === 0) {
this.icon = "fa-android";
this.icon = "bwi-android";
this.image = null;
} else if (hostnameUri.indexOf("iosapp://") === 0) {
this.icon = "fa-apple";
this.icon = "bwi-apple";
this.image = null;
} else if (
this.imageEnabled &&