Skip to content

Commit

Permalink
chore: expose 'use_template_header' property on nav-stack for use wit…
Browse files Browse the repository at this point in the history
…h inline sticky display group header
  • Loading branch information
jfmcquade committed Nov 28, 2024
1 parent 2cb4a5a commit 8ea53f4
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,9 @@ ion-modal.nav-stack-modal {
ion-toolbar {
--background: var(--ion-color-background);
--color: var(--ion-color-primary);

&.fixed {
position: fixed;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<ion-toolbar>
<ion-toolbar [class.fixed]="config.useTemplateHeader">
@if (config.title) {
<!-- use mode="ios" to centre title within toolbar -->
<ion-title mode="ios">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ export interface INavStackConfig {
templateName: string;
title?: string;
showCloseButton?: boolean;
// If true, the default nav-stack header will be ignored by content
useTemplateHeader?: boolean;
}

/** The logic for nav-stack open/dismiss exists in the nav-stack service */
Expand Down
4 changes: 3 additions & 1 deletion src/app/feature/nav-stack/nav-stack.actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ interface INavStackActionParams {
template: string;
title: string;
show_close_button: boolean;
use_template_header: boolean;
}

export class NavStackActionFactory {
Expand All @@ -14,11 +15,12 @@ export class NavStackActionFactory {
const [actionId] = args;
const childActions = {
open: async () => {
const { template, title, show_close_button = true } = params;
const { template, title, show_close_button = true, use_template_header } = params;
const navStackConfig = {
templateName: template,
title,
showCloseButton: show_close_button,
useTemplateHeader: use_template_header,
};
this.service.pushNavStack(navStackConfig);
},
Expand Down
2 changes: 1 addition & 1 deletion src/app/shared/components/template/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ import { TmplTextBoxComponent } from "./text-box/text-box.component";
import { TmplTextComponent } from "./text/text.component";
import { TmplTextBubbleComponent } from "./text-bubble/text-bubble.component";
import { TmplTileComponent } from "./tile-component/tile-component.component";
import { TmplTitleComponent } from ".//title/title.component";
import { TmplTitleComponent } from "./title/title.component";
import { TmplTimerComponent } from "./timer/timer.component";
import { TmplToggleBarComponent } from "./toggle-bar/toggle-bar";
import { TmplVideoComponent } from "./video";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,6 @@
bottom: 0;
}
}
// When displaying a sticky header inside a nav-stack modal, remove the inline placeholder
// as the nav-stack has an in-built header
:host-context(.nav-stack-modal) {
.sticky-top-placeholder {
display: none;
}
}
/// In flex box components should try to fill height, but not width (leave to flex property)
.display-group-wrapper > plh-template-component {
height: 100%;
Expand Down

0 comments on commit 8ea53f4

Please sign in to comment.