MCPcopy Create free account
hub / github.com/TraderAlice/OpenAlice / responsiveMaxWidth

Function responsiveMaxWidth

ui/src/components/PageSidebarLayout.tsx:25–34  ·  view source on GitHub ↗
(containerWidth: number)

Source from the content-addressed store, hash-verified

23}
24
25function responsiveMaxWidth(containerWidth: number): number {
26 if (!Number.isFinite(containerWidth) || containerWidth <= 0) return MAX_WIDTH
27 const ratio =
28 containerWidth < 900 ? 0.30 :
29 containerWidth < 1180 ? 0.34 :
30 0.36
31 const proportional = Math.floor(containerWidth * ratio)
32 const reserveMain = Math.floor(containerWidth - MAIN_PANE_MIN_WIDTH)
33 return Math.max(MIN_WIDTH, Math.min(MAX_WIDTH, proportional, reserveMain))
34}
35
36function useIsDesktop(): boolean {
37 const query = '(min-width: 768px)'

Callers 1

PageSidebarLayoutFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected