Skip to content

Commit 91d4c6b

Browse files
authored
Revert "fix(sheet overlay): fix height computation for sheet (#1532)" (#1534)
This reverts commit 90d7e62.
1 parent 358e65d commit 91d4c6b

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

projects/components/src/overlay/sheet/sheet-overlay.component.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { ChangeDetectionStrategy, Component, HostListener, Inject, Injector, TemplateRef, Type } from '@angular/core';
22
import { IconType } from '@hypertrace/assets-library';
3-
import { ExternalNavigationParams, LayoutChangeService } from '@hypertrace/common';
3+
import { ExternalNavigationParams, GLOBAL_HEADER_HEIGHT, LayoutChangeService } from '@hypertrace/common';
44
import { ButtonStyle } from '../../button/button';
55
import { IconSize } from '../../icon/icon-size';
6-
import { POPOVER_DATA } from '../../popover/popover';
6+
import { PopoverFixedPositionLocation, POPOVER_DATA } from '../../popover/popover';
77
import { PopoverRef } from '../../popover/popover-ref';
88
import { SheetConstructionData } from '../overlay.service';
99
import { SheetOverlayConfig, SheetSize } from './sheet';
@@ -72,6 +72,7 @@ export class SheetOverlayComponent {
7272
public constructor(
7373
private readonly popoverRef: PopoverRef,
7474
@Inject(POPOVER_DATA) sheetData: SheetConstructionData,
75+
@Inject(GLOBAL_HEADER_HEIGHT) globalHeaderHeight: string,
7576
layoutChange: LayoutChangeService
7677
) {
7778
const sheetConfig: SheetOverlayConfig = sheetData.config;
@@ -84,7 +85,7 @@ export class SheetOverlayComponent {
8485

8586
this.isComponentSheet = !(sheetConfig.content instanceof TemplateRef);
8687
this.renderer = sheetConfig.content;
87-
this.popoverRef.height('100vh');
88+
this.popoverRef.height(this.getHeightForPopover(globalHeaderHeight, sheetConfig.position));
8889
this.setWidth();
8990
this.navigationParams = sheetConfig.pageNavParams;
9091
this.rendererInjector = Injector.create({
@@ -136,4 +137,8 @@ export class SheetOverlayComponent {
136137
return '100%';
137138
}
138139
}
140+
141+
private getHeightForPopover(globalHeaderHeight: string, position?: PopoverFixedPositionLocation): string {
142+
return position === PopoverFixedPositionLocation.Right ? '100vh' : `calc(100vh - ${globalHeaderHeight})`;
143+
}
139144
}

0 commit comments

Comments
 (0)