feat(dashboard): add recent tab and add scroll to contacts

This commit is contained in:
KostyaDanovsky 2017-07-05 20:18:53 +03:00
parent b4b32a3577
commit d8b7c81f46
3 changed files with 36 additions and 5 deletions

View file

@ -3,11 +3,14 @@
<nga-tab tabTitle="Contacts">
<div class="contact" *ngFor="let c of contacts">
<nga-user [picture]="c.user.picture" [name]="c.user.name" [title]="c.type" size="xmedium"></nga-user>
<i class="ion-ios-telephone-outline"></i>
<i class="i-contact ion-ios-telephone-outline"></i>
</div>
</nga-tab>
<nga-tab tabTitle="Recent">
<span>Content #2</span>
<div class="contact" *ngFor="let c of recent">
<nga-user [picture]="c.user.picture" [name]="c.user.name" [title]="c.type" size="xmedium"></nga-user>
<span class="time">{{ c.time }}</span>
</div>
</nga-tab>
</nga-tabset>
</nga-card>

View file

@ -2,11 +2,19 @@
@import '~@akveo/nga-theme/styles/global/bootstrap/hero-buttons';
@include nga-install-component() {
nga-tabset /deep/ ul {
border-bottom: 1px solid nga-theme(separator);
nga-tabset {
height: 100%;
display: flex;
flex-direction: column;
/deep/ ul {
border-bottom: 1px solid nga-theme(separator);
}
}
nga-tab {
flex: 1;
overflow-y: scroll;
padding: 0;
}
@ -18,11 +26,17 @@
border-bottom: 1px solid nga-theme(separator);
}
i {
.i-contact {
font-size: 2.5rem;
cursor: pointer;
}
.time {
font-size: 0.875rem;
font-weight: nga-theme(font-weight-light);
text-transform: uppercase;
}
nga-user /deep/ {
.info-container {
margin-left: 0.875rem;

View file

@ -8,8 +8,11 @@ import { UserService } from '../../../@core/data/users.service';
templateUrl: './contacts.component.html',
})
export class ContactsComponent {
contacts: any[];
recent: any[];
constructor(private userService: UserService) {
const users = this.userService.getUsers();
@ -21,5 +24,16 @@ export class ContactsComponent {
{ user: users.alan, type: 'home' },
{ user: users.kate, type: 'work' },
];
this.recent = [
{ user: users.alan, type: 'home', time: '9:12 pm' },
{ user: users.eva, type: 'home', time: '7:45 pm' },
{ user: users.nick, type: 'mobile', time: '5:29 pm' },
{ user: users.lee, type: 'mobile', time: '11:24 am' },
{ user: users.jack, type: 'mobile', time: '10:45 am' },
{ user: users.kate, type: 'work', time: '9:42 am' },
{ user: users.kate, type: 'work', time: '9:31 am' },
{ user: users.jack, type: 'mobile', time: '8:01 am' },
];
}
}