Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kuwait Comp: Bottom Navbar #2508

Merged
merged 24 commits into from
Dec 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
7e855fb
feat: bottom nav component init
FaithDaka Oct 28, 2024
29c4fd4
Merge branch 'master' of https://github.com/IDEMSInternational/open-a…
FaithDaka Oct 28, 2024
e683651
feat: changes
FaithDaka Oct 28, 2024
ccde313
styling: button css fix
FaithDaka Oct 28, 2024
aef5eca
wip: plh-bottom-nav component template integration
jfmcquade Oct 28, 2024
0635e54
Merge branch 'master' into feat/bottom-nav
jfmcquade Oct 28, 2024
d23a0cf
chore: add plhasset pipe to plh-bottom-nav component
jfmcquade Oct 28, 2024
0ce55a7
Merge branch 'master' of https://github.com/IDEMSInternational/open-a…
FaithDaka Nov 6, 2024
460f7d5
Merge branch 'feat/bottom-nav' of https://github.com/IDEMSInternation…
FaithDaka Nov 6, 2024
5e26617
kw component restructure
FaithDaka Nov 6, 2024
8aa67a0
feat: kuwait app module
FaithDaka Nov 6, 2024
291f341
feat: kuwait app layout component
FaithDaka Nov 6, 2024
f140a00
feat: nav-item routing
FaithDaka Nov 6, 2024
939f6d9
navbar styling
FaithDaka Nov 6, 2024
7914421
Merge branch 'master' of https://github.com/IDEMSInternational/open-a…
FaithDaka Nov 12, 2024
d8820a6
Merge branch 'master' of https://github.com/IDEMSInternational/open-a…
FaithDaka Nov 21, 2024
6a56b7e
remove layout folder
FaithDaka Nov 22, 2024
49cb0bb
Merge branch 'master' into feat/bottom-nav
jfmcquade Dec 20, 2024
d23c7c9
chore: remove debug(?) styling
jfmcquade Dec 20, 2024
808dac1
stlye: remove link underline
jfmcquade Dec 20, 2024
9f195f6
Merge branch 'master' into feat/bottom-nav
jfmcquade Dec 24, 2024
739cff7
fix: use RouterLinkActive to fix active link logic
jfmcquade Dec 24, 2024
7e3412f
chore: code tidy
jfmcquade Dec 24, 2024
2bb17af
Merge branch 'master' into feat/bottom-nav
esmeetewinkel Dec 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/components/plh/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ import { PlhParentPointBoxComponent } from "./parent-point-box/parent-point-box.
import { PlhModuleListItemComponent } from "./plh-kids-kw/components/module-list-item/module-list-item.component";
import { PlhCompletionModalComponent } from "./plh-kids-kw/components/completion-modal/completion-modal.component";
import { PlhModuleDetailsHeaderComponent } from "./plh-kids-kw/components/module-details-header/module-details-header.component";
import { PlhBottomNavigationBarComponent } from "./plh-kids-kw/components/bottom-navigation-bar/bottom-navigation-bar.component";

export {
PlhParentPointCounterComponent,
PlhParentPointBoxComponent,
PlhModuleListItemComponent,
PlhCompletionModalComponent,
PlhModuleDetailsHeaderComponent,
PlhBottomNavigationBarComponent,
};

export const PLH_COMPONENTS = [
Expand All @@ -18,6 +20,7 @@ export const PLH_COMPONENTS = [
PlhModuleListItemComponent,
PlhCompletionModalComponent,
PlhModuleDetailsHeaderComponent,
PlhBottomNavigationBarComponent,
];

export const PLH_COMPONENT_MAPPING = {
Expand All @@ -26,6 +29,7 @@ export const PLH_COMPONENT_MAPPING = {
plh_module_details_header: PlhModuleDetailsHeaderComponent,
plh_module_list_item: PlhModuleListItemComponent,
plh_completion_modal: PlhCompletionModalComponent,
plh_bottom_nav: PlhBottomNavigationBarComponent,
};

export type PLHComponentName = keyof typeof PLH_COMPONENT_MAPPING;
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>
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();
});
});
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 packages/components/plh/plh-kids-kw/plh-kids-kw-routing.module.ts
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 {}
10 changes: 10 additions & 0 deletions packages/components/plh/plh-kids-kw/plh-kids-kw.module.ts
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 {}
36 changes: 26 additions & 10 deletions src/theme/themes/plh_kids_kw/_overrides.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,12 @@ body[data-theme="plh_kids_kw"] {
ion-button[disabled] {
filter: none;
}

.left {
text-align: unset !important;
}
// Center align all button text by default
.left.null ::ng-deep {
text-align: center;
p {
text-align: center !important;
}
}
.left ::ng-deep {
p {
text-align: left !important;
}
}
.left.centre ::ng-deep {
p {
text-align: center !important;
Expand Down Expand Up @@ -975,6 +965,32 @@ body[data-theme="plh_kids_kw"] {
}
}

// bottom_nav
.plh-bottom-nav-wrapper {
@include mixins.flex-space-between;
flex-direction: row;
width: 100%;
padding: 12px 16px 8px 16px;
border-top: 1px solid #e7e8e9;
.nav-item {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
text-decoration: none;
}
.label p {
padding: 0;
margin: 0;
color: #6686b1;
font-weight: var(--font-weight-standard);
}
.active-link .label p {
font-weight: var(--font-weight-bold);
color: #0066a1;
}
}

// Pop Up
.popup-backdrop {
&[data-variant~="plh_completion"] {
Expand Down
Loading