Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

composerFooterLayout.ts

22 lines734 Bytes

1export const COMPOSER_FOOTER_COMPACT_BREAKPOINT_PX = 620;
2export const COMPOSER_FOOTER_WIDE_ACTIONS_COMPACT_BREAKPOINT_PX = 780;
3​
4export function shouldUseCompactComposerFooter(
5 width: number | null,
6 options?: { hasWideActions?: boolean },
7): boolean {
8 const breakpoint = options?.hasWideActions
9 ? COMPOSER_FOOTER_WIDE_ACTIONS_COMPACT_BREAKPOINT_PX
10 : COMPOSER_FOOTER_COMPACT_BREAKPOINT_PX;
11 return width !== null && width < breakpoint;
13​
14export function shouldUseCompactComposerPrimaryActions(
15 width: number | null,
16 options?: { hasWideActions?: boolean },
17): boolean {
18 if (!options?.hasWideActions) {
19 return false;
20 }
21 return width !== null && width < COMPOSER_FOOTER_WIDE_ACTIONS_COMPACT_BREAKPOINT_PX;