Use native new task sheet controls
This commit is contained in:
1 parent
c77e6af72a
commit
92404ecfd8
1 file changed
+2
-23
@@ -1,10 +1,7 @@
|
||||
import { useRouter } from "expo-router";
|
||||
import Stack from "expo-router/stack";
|
||||
import { SymbolView } from "expo-symbols";
|
||||
import { Pressable } from "react-native";
|
||||
import { Platform } from "react-native";
|
||||
import { useResolveClassNames } from "uniwind";
|
||||
|
||||
import { useAdaptiveWorkspaceLayout } from "../../features/layout/AdaptiveWorkspaceLayout";
|
||||
import { NewTaskFlowProvider } from "../../features/threads/new-task-flow-provider";
|
||||
import { useThemeColor } from "../../lib/useThemeColor";
|
||||
|
||||
@@ -12,25 +9,7 @@ export const unstable_settings = {
|
||||
anchor: "index",
|
||||
};
|
||||
|
||||
function NewTaskCloseButton() {
|
||||
const router = useRouter();
|
||||
const tintColor = useThemeColor("--color-foreground");
|
||||
|
||||
return (
|
||||
<Pressable
|
||||
accessibilityLabel="Close new task"
|
||||
accessibilityRole="button"
|
||||
className="h-9 w-9 items-center justify-center rounded-full bg-subtle active:opacity-70"
|
||||
hitSlop={8}
|
||||
onPress={() => router.dismiss()}
|
||||
>
|
||||
<SymbolView name="xmark" size={14} tintColor={String(tintColor)} type="monochrome" />
|
||||
</Pressable>
|
||||
);
|
||||
}
|
||||
|
||||
export default function NewTaskLayout() {
|
||||
const { layout } = useAdaptiveWorkspaceLayout();
|
||||
const sheetStyle = useResolveClassNames("bg-sheet");
|
||||
const sheetBg = useThemeColor("--color-sheet");
|
||||
const headerTint = useThemeColor("--color-foreground");
|
||||
@@ -46,7 +25,7 @@ export default function NewTaskLayout() {
|
||||
headerStyle: { backgroundColor: sheetBg },
|
||||
headerTintColor: headerTint,
|
||||
headerTitleStyle: { fontFamily: "DMSans_700Bold" },
|
||||
headerRight: layout.usesSplitView ? NewTaskCloseButton : undefined,
|
||||
unstable_navigationItemStyle: Platform.OS === "ios" ? "editor" : undefined,
|
||||
}}
|
||||
>
|
||||
<Stack.Screen name="index" options={{ animation: "none", title: "Choose project" }} />
|
||||
|
||||
Reference in new issue
Block a user