MCPcopy
hub / github.com/codeaashu/claude-code / useModalOrTerminalSize

Function useModalOrTerminalSize

src/context/modalContext.tsx:38–54  ·  view source on GitHub ↗
(fallback)

Source from the content-addressed store, hash-verified

36 * smaller than the terminal.
37 */
38export function useModalOrTerminalSize(fallback) {
39 const $ = _c(3);
40 const ctx = useContext(ModalContext);
41 let t0;
42 if ($[0] !== ctx || $[1] !== fallback) {
43 t0 = ctx ? {
44 rows: ctx.rows,
45 columns: ctx.columns
46 } : fallback;
47 $[0] = ctx;
48 $[1] = fallback;
49 $[2] = t0;
50 } else {
51 t0 = $[2];
52 }
53 return t0;
54}
55export function useModalScrollRef() {
56 return useContext(ModalContext)?.scrollRef ?? null;
57}

Callers 2

SettingsFunction · 0.85
BtwSideQuestionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected