Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

NewThreadButton.shared.tsx

39 lines1.2 KB

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