@devries-cameron20 / t3code Mirror · read-only
Fork 0

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, 04:45 UTC

main
tsx 22 lines 852 Bytes
Raw
1 import { use } from "react";
2 // oxlint-disable-next-line eslint/no-restricted-imports -- The wrapper every screen must use.
3 import { RefreshControl as NativeRefreshControl } from "react-native";
4 import { View, type RefreshControlProps } from "react-native";
5
6 import { BottomSheetContext } from "./BottomSheetContext";
7
8 /**
9 * A bottom sheet takes the pull at the top, and Material reads the swipe-refresh layout as unable
10 * to scroll up, so the sheet collapses instead of scrolling back. Sheets get a plain wrapper that
11 * keeps the layout style the scroll view hands its refresh control.
12 */
13 export function RefreshControl(props: RefreshControlProps) {
14 if (use(BottomSheetContext)) {
15 return (
16 <View collapsable={false} style={props.style}>
17 {props.children}
18 </View>
19 );
20 }
21 return <NativeRefreshControl {...props} />;
22 }