From d807d128612d61178178e2288fb4e396c6a03bae Mon Sep 17 00:00:00 2001 From: Alexis Hernandez Date: Sun, 22 Apr 2018 16:00:33 -0500 Subject: [PATCH] web-ui: Add tabs to the home view The following views are now displayed in tabs: - Latest blocks - Richest addresses - Masternodes --- web-ui/src/app/app.module.ts | 4 +++- web-ui/src/app/components/home/home.component.html | 13 ++++++++++++- web-ui/src/app/components/home/home.component.ts | 9 +++++++++ .../latest-blocks/latest-blocks.component.html | 6 +++--- .../masternodes/masternodes.component.html | 4 ++-- .../richest-addresses.component.html | 4 ++-- 6 files changed, 31 insertions(+), 9 deletions(-) diff --git a/web-ui/src/app/app.module.ts b/web-ui/src/app/app.module.ts index b30bf06..05769b6 100644 --- a/web-ui/src/app/app.module.ts +++ b/web-ui/src/app/app.module.ts @@ -7,6 +7,7 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { AppRoutingModule } from './app-routing.module'; import { AlertModule, BsDropdownModule, CollapseModule, TooltipModule, ModalModule } from 'ngx-bootstrap'; +import { TabsModule } from 'ngx-bootstrap/tabs'; import { TranslateModule } from '@ngx-translate/core'; import { ToastrModule } from 'ngx-toastr'; @@ -68,7 +69,8 @@ import { MasternodesComponent } from './components/masternodes/masternodes.compo HttpClientModule, NgHttpLoaderModule, TranslateModule.forRoot(), - NgxPaginationModule + NgxPaginationModule, + TabsModule.forRoot() ], providers: [ AddressesService, diff --git a/web-ui/src/app/components/home/home.component.html b/web-ui/src/app/components/home/home.component.html index c4bd937..0c716ee 100644 --- a/web-ui/src/app/components/home/home.component.html +++ b/web-ui/src/app/components/home/home.component.html @@ -1,5 +1,16 @@
- + + + + + + + + + + + +
diff --git a/web-ui/src/app/components/home/home.component.ts b/web-ui/src/app/components/home/home.component.ts index 33fd770..61e9620 100644 --- a/web-ui/src/app/components/home/home.component.ts +++ b/web-ui/src/app/components/home/home.component.ts @@ -7,9 +7,18 @@ import { Component, OnInit } from '@angular/core'; }) export class HomeComponent implements OnInit { + currentView = 'latestBlocks'; + constructor() { } ngOnInit() { } + selectView(view: string) { + this.currentView = view; + } + + isSelected(view: string): boolean { + return this.currentView === view; + } } diff --git a/web-ui/src/app/components/latest-blocks/latest-blocks.component.html b/web-ui/src/app/components/latest-blocks/latest-blocks.component.html index 93a5131..bbdf9f0 100644 --- a/web-ui/src/app/components/latest-blocks/latest-blocks.component.html +++ b/web-ui/src/app/components/latest-blocks/latest-blocks.component.html @@ -1,19 +1,19 @@
-
+

{{'label.latestBlocks' | translate}}

-
+

{{'message.loadingLatestBlocks' | translate}}

-
+
diff --git a/web-ui/src/app/components/masternodes/masternodes.component.html b/web-ui/src/app/components/masternodes/masternodes.component.html index aa1cb3c..552f8da 100644 --- a/web-ui/src/app/components/masternodes/masternodes.component.html +++ b/web-ui/src/app/components/masternodes/masternodes.component.html @@ -1,10 +1,10 @@
-

{{'label.masternodes' | translate}}

+

{{'label.masternodes' | translate}}

-
+
diff --git a/web-ui/src/app/components/richest-addresses/richest-addresses.component.html b/web-ui/src/app/components/richest-addresses/richest-addresses.component.html index 6979f5e..9507c4b 100644 --- a/web-ui/src/app/components/richest-addresses/richest-addresses.component.html +++ b/web-ui/src/app/components/richest-addresses/richest-addresses.component.html @@ -1,10 +1,10 @@
-

{{'label.richestAddresses' | translate}}

+

{{'label.richestAddresses' | translate}}

-
+