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

SettingsSection.tsx

48 lines1.4 KB

1import type { ReactNode } from "react";
2import { Platform, View } from "react-native";
3​
4import { AppText as Text } from "../../../components/AppText";
5​
6export function SettingsSection(props: {
7 readonly title?: string;
8 readonly titleIcon?: ReactNode;
9 readonly trailing?: ReactNode;
10 readonly children: ReactNode;
11}) {
12 return (
13 <View className="gap-2">
14 {props.title ? (
15 <View className="flex-row items-center justify-between gap-3">
16 <View
17 className={
18 Platform.OS === "android"
19 ? "min-w-0 flex-1 flex-row items-center gap-2 px-4"
20 : "min-w-0 flex-1 flex-row items-center gap-2 px-2"
21 }
22 >
23 {props.titleIcon}
24 <Text
25 className={
26 Platform.OS === "android"
27 ? "shrink text-sm font-t3-medium text-primary-text"
28 : "shrink text-sm font-t3-medium text-foreground-muted"
29 }
30 >
31 {props.title}
32 </Text>
33 </View>
34 {props.trailing}
35 </View>
36 ) : null}
37 <View
38 className={
39 Platform.OS === "android"
40 ? "overflow-hidden rounded-[28px] bg-grouped-card"
41 : "overflow-hidden rounded-[24px] border-continuous bg-grouped-card"
42 }
43 >
44 {props.children}
45 </View>
46 </View>
47 );