Brandon Presley
f778426aba
Something happened with the deno formatter, I can't remember what! Hahahahahaahahaha
34 lines
708 B
TypeScript
34 lines
708 B
TypeScript
import { View } from "react-native";
|
|
import { Button, Subheading } from "react-native-paper";
|
|
import { ITEM_PADDING } from "./constants";
|
|
|
|
export default function SettingButton({
|
|
name: text,
|
|
label,
|
|
onPress,
|
|
}: {
|
|
name: string;
|
|
label?: string;
|
|
onPress: () => void;
|
|
}) {
|
|
if (label) {
|
|
return (
|
|
<View
|
|
style={{
|
|
flexDirection: "row",
|
|
alignItems: "center",
|
|
paddingLeft: ITEM_PADDING,
|
|
}}
|
|
>
|
|
<Subheading style={{ width: 100 }}>{label}</Subheading>
|
|
<Button onPress={onPress}>{text}</Button>
|
|
</View>
|
|
);
|
|
}
|
|
return (
|
|
<Button style={{ alignSelf: "flex-start" }} onPress={onPress}>
|
|
{text}
|
|
</Button>
|
|
);
|
|
}
|