MCPcopy
hub / github.com/chartdb/chartdb / useBreakpoint

Function useBreakpoint

src/hooks/use-breakpoint.ts:22–32  ·  view source on GitHub ↗
(breakpointKey: K)

Source from the content-addressed store, hash-verified

20type BreakpointKey = keyof typeof breakpoints;
21
22export function useBreakpoint<K extends BreakpointKey>(breakpointKey: K) {
23 const bool = useMediaQuery({
24 query: `(min-width: ${breakpoints[breakpointKey]})`,
25 });
26 const capitalizedKey =
27 breakpointKey[0].toUpperCase() + breakpointKey.substring(1);
28 type Key = `is${Capitalize<K>}`;
29 return {
30 [`is${capitalizedKey}`]: bool,
31 } as Record<Key, boolean>;
32}

Callers 12

EditorPageComponentFunction · 0.90
SidePanelFunction · 0.90
DependencyListItemHeaderFunction · 0.90
CanvasFunction · 0.90
CanvasContextMenuFunction · 0.90
TableNodeContextMenuFunction · 0.90
AreaNodeContextMenuFunction · 0.90
EditorSidebarFunction · 0.90
LayoutProviderFunction · 0.90
ImportDatabaseFunction · 0.90
SelectTablesFunction · 0.90
useFocusOnFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected