Skip to content
Snippets Groups Projects
Commit 1fe246b5 authored by Callari, Roberto's avatar Callari, Roberto
Browse files

update

parent a39d5ff5
No related branches found
No related tags found
No related merge requests found
......@@ -3,19 +3,20 @@ import { Observable } from 'rxjs';
export interface User {
name: string;
picture: string;
role: string;
}
export interface Contacts {
user: User;
type: string;
}
// export interface Contacts {
// user: User;
// type: string;
// }
export interface RecentUsers extends Contacts {
time: number;
}
// export interface RecentUsers extends Contacts {
// time: number;
// }
export abstract class UserData {
abstract getUsers(): Observable<User[]>;
abstract getContacts(): Observable<Contacts[]>;
abstract getRecentUsers(): Observable<RecentUsers[]>;
// abstract getContacts(): Observable<Contacts[]>;
// abstract getRecentUsers(): Observable<RecentUsers[]>;
}
import { of as observableOf, Observable } from 'rxjs';
import { Injectable } from '@angular/core';
import { Contacts, RecentUsers, UserData } from '../data/users';
import { UserData } from '../data/users';
@Injectable()
export class UserService extends UserData {
private time: Date = new Date;
private users = {
nick: { name: 'Nick Jones', picture: 'assets/images/nick.png' },
eva: { name: 'Eva Moor', picture: 'assets/images/eva.png' },
jack: { name: 'Jack Williams', picture: 'assets/images/jack.png' },
lee: { name: 'Lee Wong', picture: 'assets/images/lee.png' },
alan: { name: 'Alan Thompson', picture: 'assets/images/alan.png' },
kate: { name: 'Kate Martinez', picture: 'assets/images/kate.png' },
};
private types = {
mobile: 'mobile',
home: 'home',
work: 'work',
nick: { name: 'John Doe',role:"Admin", picture: 'assets/images/default_user.png' },
};
private contacts: Contacts[] = [
{ user: this.users.nick, type: this.types.mobile },
{ user: this.users.eva, type: this.types.home },
{ user: this.users.jack, type: this.types.mobile },
{ user: this.users.lee, type: this.types.mobile },
{ user: this.users.alan, type: this.types.home },
{ user: this.users.kate, type: this.types.work },
];
private recentUsers: RecentUsers[] = [
{ user: this.users.alan, type: this.types.home, time: this.time.setHours(21, 12)},
{ user: this.users.eva, type: this.types.home, time: this.time.setHours(17, 45)},
{ user: this.users.nick, type: this.types.mobile, time: this.time.setHours(5, 29)},
{ user: this.users.lee, type: this.types.mobile, time: this.time.setHours(11, 24)},
{ user: this.users.jack, type: this.types.mobile, time: this.time.setHours(10, 45)},
{ user: this.users.kate, type: this.types.work, time: this.time.setHours(9, 42)},
{ user: this.users.kate, type: this.types.work, time: this.time.setHours(9, 31)},
{ user: this.users.jack, type: this.types.mobile, time: this.time.setHours(8, 0)},
];
getUsers(): Observable<any> {
return observableOf(this.users);
}
getContacts(): Observable<Contacts[]> {
return observableOf(this.contacts);
}
getRecentUsers(): Observable<RecentUsers[]> {
return observableOf(this.recentUsers);
}
}
......@@ -10,46 +10,14 @@
>
<nb-icon [icon]="(materialTheme$ | async) ? 'menu-outline' : 'menu-2-outline'"></nb-icon>
</a>
<a class="logo" href="#" (click)="navigateHome()">ngx-<span>admin</span></a>
<a class="logo" href="#" (click)="navigateHome()"><img class="mr-1" src="assets\images\urbanite_logo.png">URBANITE</a>
</div>
<nb-select
status="primary"
matRipple
[selected]="currentTheme"
(selectedChange)="changeTheme($event)"
>
<nb-option
*ngFor="let theme of themes"
[value]="theme.value"
matRipple
>{{ theme.name }}</nb-option>
</nb-select>
</div>
<div class="header-container">
<nb-actions size="small">
<nb-action class="control-item">
<nb-search
type="rotate-layout"
matRipple
[matRippleUnbounded]="true"
[matRippleCentered]="true"
></nb-search></nb-action>
<nb-action
class="control-item"
icon="email-outline"
matRipple
[matRippleUnbounded]="true"
[matRippleCentered]="true"
></nb-action>
<nb-action
class="control-item"
icon="bell-outline"
matRipple
[matRippleUnbounded]="true"
[matRippleCentered]="true"
></nb-action>
<nb-action
class="user-action"
*nbIsGranted="['view', 'user']"
......@@ -59,6 +27,7 @@
<nb-user [nbContextMenu]="userMenu"
[onlyPicture]="userPictureOnly"
[name]="user?.name"
[title]="user?.role"
[picture]="user?.picture">
</nb-user>
</nb-action>
......
......@@ -50,6 +50,11 @@
white-space: nowrap;
text-decoration: none;
}
img {
max-width: 50%;
max-height: 15%;
}
}
@include media-breakpoint-down(sm) {
......
src/assets/images/default_user.png

5.79 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment