The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 03:37 UTC
| 1 | import { createContext, use } from "react"; |
| 2 | import type { SharedValue } from "react-native-reanimated"; |
| 3 | |
| 4 | // Controls follow the visible pane; keep the expensive navigator/feed at settled width during transitions. |
| 5 | export const WorkspaceContentWidthContext = createContext<SharedValue<number> | null>(null); |
| 6 | |
| 7 | export function useWorkspaceContentWidth() { |
| 8 | return use(WorkspaceContentWidthContext); |
| 9 | } |
| 10 | |
| 11 | // The settled width itself. The feed lays its rows out at this width in the same commit that |
| 12 | // resizes the pane; waiting for its own onLayout re-measured every row twice, once against the |
| 13 | // old text widths, and the list jumped while it repositioned them. |
| 14 | export const WorkspaceSettledContentWidthContext = createContext<number | null>(null); |
| 15 | |
| 16 | export function useWorkspaceSettledContentWidth() { |
| 17 | return use(WorkspaceSettledContentWidthContext); |
| 18 | } |