Open History to see the last commit
1import { SymbolView } from "expo-symbols";
2import { Pressable, View } from "react-native";
3
4import { AppText as Text } from "../../components/AppText";
5import { useThemeColor } from "../../lib/useThemeColor";
6
7export function NewTaskSheetHeader(props: {
8 readonly eyebrow?: string;
9 readonly title: string;
10 readonly control?: {
11 readonly icon: "chevron.left" | "xmark";
12 readonly onPress: () => void;
13 };
14}) {
15 const iconColor = useThemeColor("--color-icon");
16
17 return (
18 <>
19 <View style={{ minHeight: 16, paddingTop: 8 }} />
20 <View className="items-center gap-1 px-5 pb-3 pt-4">
21 {props.control ? (
22 <Pressable
23 className="absolute left-3 top-4 h-9 w-9 items-center justify-center rounded-full bg-subtle"
24 style={{ zIndex: 1 }}
25 onPress={props.control.onPress}
26 >
27 <SymbolView
28 name={props.control.icon}
29 size={16}
30 tintColor={iconColor}
31 type="monochrome"
32 weight="medium"
33 />
34 </Pressable>
35 ) : null}
36 <Text
37 className="text-[12px] font-t3-bold uppercase text-foreground-muted"
38 style={{ letterSpacing: 1 }}
39 >
40 {props.eyebrow ?? "New task"}
41 </Text>
42 <Text className="text-[28px] font-t3-bold">{props.title}</Text>
43 </View>
44 </>
45 );
46}