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

SettingsProjectOverridesSection.tsx

37 lines1.3 KB

1import { Pressable, View } from "react-native";
2​
3import { AppText as Text } from "../../../components/AppText";
4import { SettingsSection } from "./SettingsSection";
5​
6export function SettingsProjectOverridesSection(props: {
7 readonly projectLabel: string;
8 readonly hasOverrides: boolean;
9 readonly supportsOverrides: boolean;
10 readonly pending: boolean;
11 readonly onClear: () => void;
12}) {
13 return (
14 <SettingsSection title="Project">
15 <View className="min-h-16 flex-row items-center gap-3 px-4 py-3">
16 <Text className="min-w-0 flex-1 text-base text-foreground" numberOfLines={2}>
17 {props.projectLabel}
18 </Text>
19 {!props.pending && props.supportsOverrides && props.hasOverrides ? (
20 <Pressable
21 accessibilityRole="button"
22 accessibilityLabel="Use environment defaults"
23 onPress={props.onClear}
24 className="px-2 py-2 active:opacity-70"
25 >
26 <Text className="text-sm font-t3-medium text-primary-text">Use defaults</Text>
27 </Pressable>
28 ) : null}
29 </View>
30 {!props.supportsOverrides ? (
31 <Text className="px-4 pb-3 text-sm text-foreground-muted">
32 Update the selected environments to edit project overrides.
33 </Text>
34 ) : null}
35 </SettingsSection>
36 );