Skip to content

Commit

Permalink
alerts-ui: Add collapsible effect
Browse files Browse the repository at this point in the history
  • Loading branch information
Javier Suarez authored and AlexITC committed Apr 22, 2018
1 parent e749195 commit 7e19294
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 8 deletions.
3 changes: 3 additions & 0 deletions alerts-ui/src/app/app-navbar/app-navbar.component.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.left-padding {
padding-left: 15px;
}
15 changes: 11 additions & 4 deletions alerts-ui/src/app/app-navbar/app-navbar.component.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
<nav class="navbar navbar-default">
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse" [attr.aria-expanded]="!collapsed"
(click)="toggleCollapse()" [ngClass]="{'collapsed': collapsed}">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a routerLink="/" class="navbar-brand">
<img src="assets/bitcoin.png" alt="Logo">
</a>
Expand All @@ -9,7 +16,7 @@
</a>
</div>

<div class="collapse navbar-collapse">
<div class="collapse navbar-collapse" id="navbar-collapse" [ngClass]="{'in': !collapsed}">
<ul class="nav navbar-nav">
<li *ngFor="let tab of tabs" [ngClass]="{ 'active': isSelected(tab.path) }">
<!-- TODO: check why [hidden] attribute is not working -->
Expand All @@ -19,7 +26,7 @@

<ul class="nav navbar-nav navbar-right">
<li *ngIf="isAuthenticated()">
<p class="navbar-text">{{getAuthenticatedUser()}}</p>
<p class="navbar-text left-padding">{{getAuthenticatedUser()}}</p>
</li>
<li *ngIf="isAuthenticated()">
<a href="#" (click)="logout()">{{'label.logout' | translate}}</a>
Expand All @@ -32,7 +39,7 @@
<a routerLink="/login">{{'label.login' | translate}}</a>
</li>
<!-- language -->
<li class="dropdown" dropdown>
<li class="dropdown left-padding" dropdown>
<div class="navbar-form">
<div class="btn-group" dropdown>
<button dropdownToggle type="button" class="btn btn-primary dropdown-toggle">
Expand Down
6 changes: 6 additions & 0 deletions alerts-ui/src/app/app-navbar/app-navbar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ export class AppNavbarComponent implements OnInit {
{ label: 'label.newCurrencyAlerts', path: '/new-currency-alerts', authRequired: true }
];

public collapsed = true;

constructor(
private authService: AuthService,
private navigatorService: NavigatorService,
Expand All @@ -36,6 +38,10 @@ export class AppNavbarComponent implements OnInit {
ngOnInit() {
}

toggleCollapse() {
this.collapsed = !this.collapsed;
}

/* tabs */
isSelected(path: string): boolean {
if (!path.startsWith('/')) {
Expand Down
11 changes: 9 additions & 2 deletions alerts-ui/src/app/home/home.component.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

.home-description {
font-weight: bold;
}
Expand All @@ -15,4 +14,12 @@

#home-supported-exchanges {
font-size: 20px;
}
}

.max-width {
max-width: 100%;
}

.container {
padding-top: 70px;
}
4 changes: 2 additions & 2 deletions alerts-ui/src/app/home/home.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ <h2>{{'home.descripion' | translate}}</h2>
<label id="home-examples">{{'home.examples' | translate}}</label>
<div class="panel panel-default">
<div class="panel-body">
<img src="assets/new-currencies-email.png" alt="New Currency Email">
<img class="max-width" src="assets/new-currencies-email.png" alt="New Currency Email">
</div>
<div class="panel-footer">{{'home.newCurrenciesAlertExample' | translate}}</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
<img src="assets/price-alert-email.png" alt="Price Alert Email">
<img class="max-width" src="assets/price-alert-email.png" alt="Price Alert Email">
</div>
<div class="panel-footer">{{'home.priceAlertExample' | translate}}</div>
</div>
Expand Down

0 comments on commit 7e19294

Please sign in to comment.