Open History to see the last commit
1import { T, useGT } from "gt-react-native";
2import { Pressable, type StyleProp, type ViewStyle } from "react-native";
3
4import { cn } from "../lib/cn";
5import { AppText } from "./ui/AppText";
6import { SymbolView } from "./ui/AppSymbol";
7
8export function NewThreadButton(props: {
9 readonly onPress: () => void;
10 readonly extended?: boolean;
11 readonly expanded?: boolean;
12 readonly className?: string;
13 readonly style?: StyleProp<ViewStyle>;
14}) {
15 const gt = useGT();
16 return (
17 <Pressable
18 accessibilityLabel={gt("New thread")}
19 accessibilityRole="button"
20 onPress={props.onPress}
21 className={cn(
22 "items-center justify-center bg-primary shadow-lg active:opacity-70",
23 props.extended
24 ? "h-[56px] flex-row gap-[8px] rounded-[16px] px-[16px]"
25 : "size-[80px] rounded-[20px]",
26 props.className,
27 )}
28 style={props.style}
29 >
30 <SymbolView
31 name="square.and.pencil"
32 size={props.extended ? 24 : 28}
33 tintColorClassName="accent-primary-foreground"
34 type="monochrome"
35 />
36 {props.extended && props.expanded !== false ? (
37 <AppText className="text-[16px] font-t3-medium text-primary-foreground">
38 <T>New thread</T>
39 </AppText>
40 ) : null}
41 </Pressable>
42 );
43}