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

icon code

This commit is contained in:
Kyle Spearrin 2018-11-06 12:13:11 -05:00
parent 6fa3538cbc
commit 52e087e4dd

View File

@ -6,6 +6,8 @@ import {
import { CipherType } from '../../enums/cipherType';
import { CipherView } from '../../models/view/cipherView';
import { EnvironmentService } from '../../abstractions/environment.service';
import { StateService } from '../../abstractions/state.service';
@ -13,12 +15,21 @@ import { ConstantsService } from '../../services/constants.service';
import { Utils } from '../../misc/utils';
const IconMap = {
'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),
};
@Component({
selector: 'app-vault-icon',
templateUrl: 'icon.component.html',
})
export class IconComponent implements OnChanges {
@Input() cipher: any;
@Input() cipher: CipherView;
icon: string;
image: string;
fallbackImage: string;
@ -59,6 +70,10 @@ export class IconComponent implements OnChanges {
}
}
get iconCode(): string {
return IconMap[this.icon];
}
private setLoginIcon() {
if (this.cipher.login.uri) {
let hostnameUri = this.cipher.login.uri;