-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2508 from IDEMSInternational/feat/bottom-nav
Kuwait Comp: Bottom Navbar
- Loading branch information
Showing
8 changed files
with
123 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
...nts/plh/plh-kids-kw/components/bottom-navigation-bar/bottom-navigation-bar.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<div class="plh-bottom-nav-wrapper"> | ||
@for (button of params.buttonList; track button.name) { | ||
<a | ||
class="nav-item" | ||
routerLinkActive="active-link" | ||
[routerLink]="'template/' + button.target_template" | ||
[attr.data-name]="button.name" | ||
#rla="routerLinkActive" | ||
> | ||
<div class="icon"> | ||
<img [src]="(rla.isActive ? button.active_icon : button.icon) | plhAsset" /> | ||
</div> | ||
<div class="label"> | ||
<p>{{ button.label }}</p> | ||
</div> | ||
</a> | ||
} | ||
</div> |
Empty file.
24 changes: 24 additions & 0 deletions
24
.../plh/plh-kids-kw/components/bottom-navigation-bar/bottom-navigation-bar.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing"; | ||
import { IonicModule } from "@ionic/angular"; | ||
|
||
import { BottomNavigationBarComponent } from "./bottom-navigation-bar.component"; | ||
|
||
describe("BottomNavigationBarComponent", () => { | ||
let component: BottomNavigationBarComponent; | ||
let fixture: ComponentFixture<BottomNavigationBarComponent>; | ||
|
||
beforeEach(waitForAsync(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [BottomNavigationBarComponent], | ||
imports: [IonicModule.forRoot()], | ||
}).compileComponents(); | ||
|
||
fixture = TestBed.createComponent(BottomNavigationBarComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
})); | ||
|
||
it("should create", () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
31 changes: 31 additions & 0 deletions
31
...nents/plh/plh-kids-kw/components/bottom-navigation-bar/bottom-navigation-bar.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { Component, Input, OnInit } from "@angular/core"; | ||
import { TemplateBaseComponent } from "src/app/shared/components/template/components/base"; | ||
import { getParamFromTemplateRow } from "src/app/shared/utils"; | ||
|
||
interface IPlhBottomNavigationParams { | ||
/** TEMPLATE PARAMETER: button_list. A list of nav button items */ | ||
buttonList: INavButton[]; | ||
} | ||
interface INavButton { | ||
icon: string | null; | ||
label: string | null; | ||
target_template: string | null; | ||
name: string | null; | ||
active_icon: string | null; | ||
} | ||
@Component({ | ||
selector: "plh-bottom-navigation-bar", | ||
templateUrl: "./bottom-navigation-bar.component.html", | ||
styleUrls: ["./bottom-navigation-bar.component.scss"], | ||
}) | ||
export class PlhBottomNavigationBarComponent extends TemplateBaseComponent implements OnInit { | ||
params: Partial<IPlhBottomNavigationParams> = {}; | ||
|
||
ngOnInit() { | ||
this.getParams(); | ||
} | ||
|
||
getParams() { | ||
this.params.buttonList = getParamFromTemplateRow(this._row, "button_list", []); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
packages/components/plh/plh-kids-kw/plh-kids-kw-routing.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { NgModule } from "@angular/core"; | ||
import { RouterModule, Routes } from "@angular/router"; | ||
|
||
const routes: Routes = []; | ||
|
||
@NgModule({ | ||
imports: [RouterModule.forChild(routes)], | ||
exports: [RouterModule], | ||
}) | ||
export class PlhKidsKuwaitRoutingModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { NgModule } from "@angular/core"; | ||
import { CommonModule } from "@angular/common"; | ||
|
||
import { PlhKidsKuwaitRoutingModule } from "./plh-kids-kw-routing.module"; | ||
|
||
@NgModule({ | ||
declarations: [], | ||
imports: [CommonModule, PlhKidsKuwaitRoutingModule], | ||
}) | ||
export class PlhKidsKuwaitModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters