MCPcopy Create free account
hub / github.com/dailydotdev/apps / useAgentShellHeight

Function useAgentShellHeight

packages/shared/src/features/interests/shell.ts:10–29  ·  view source on GitHub ↗
(
  isStandalone?: boolean,
  hasBottomBar = true,
)

Source from the content-addressed store, hash-verified

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.
10export 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};

Callers 6

AgentWorkspaceSkeletonFunction · 0.90
AgentWorkspaceFunction · 0.90
AgentHomeScreenFunction · 0.90
TopicChatScreenFunction · 0.90
MessagesScreenFunction · 0.90
AgentSettingsPageFunction · 0.90

Calls 2

useLaptopLayoutFunction · 0.90
useBannerFunction · 0.90

Tested by

no test coverage detected