( isStandalone?: boolean, hasBottomBar = true, )
| 8 | // laptop the promotional banner is fixed at 2rem and the layout pads the page |
| 9 | // by as much, so the screen gives that back too. |
| 10 | export const useAgentShellHeight = ( |
| 11 | isStandalone?: boolean, |
| 12 | hasBottomBar = true, |
| 13 | ): string => { |
| 14 | const isLaptopLayout = useLaptopLayout(); |
| 15 | const { isAvailable: hasBanner } = useBanner(); |
| 16 | |
| 17 | if (isStandalone) { |
| 18 | return 'h-[100dvh]'; |
| 19 | } |
| 20 | |
| 21 | return classNames( |
| 22 | hasBottomBar |
| 23 | ? 'h-[calc(100dvh-var(--shell-top,3.5rem)-var(--shell-bottom,4rem)-var(--safe-area-top,0px))]' |
| 24 | : 'h-[calc(100dvh-var(--shell-top,3.5rem)-env(safe-area-inset-bottom,0px)-var(--safe-area-top,0px))]', |
| 25 | 'tablet:h-[calc(100dvh-3.5rem)]', |
| 26 | isLaptopLayout && !hasBanner && 'laptop:h-[calc(100dvh-1.75rem-2px)]', |
| 27 | isLaptopLayout && hasBanner && 'laptop:h-[calc(100dvh-3.75rem-2px)]', |
| 28 | ); |
| 29 | }; |
no test coverage detected