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

composerFooterLayout.ts

24 lines846 Bytes

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