Deskripsi: - update tema mode light dan dark pada fitur banner, lembaga desa, jabatan, anggota, dan diskusi umum
35 lines
1.2 KiB
TypeScript
35 lines
1.2 KiB
TypeScript
import Styles from "@/constants/Styles";
|
|
import { useTheme } from "@/providers/ThemeProvider";
|
|
import { Feather } from "@expo/vector-icons";
|
|
import { Pressable, View } from "react-native";
|
|
import Text from "./Text";
|
|
|
|
type Props = {
|
|
value: string
|
|
onPress?: () => void
|
|
round?: boolean
|
|
error?: boolean
|
|
errorText?: string
|
|
}
|
|
|
|
export default function ButtonSelect({ value, onPress, round, error, errorText }: Props) {
|
|
const { colors } = useTheme();
|
|
return (
|
|
<View style={[Styles.mv05]}>
|
|
<Pressable onPress={onPress}>
|
|
<View style={[
|
|
Styles.inputRoundForm,
|
|
Styles.inputRoundFormRight,
|
|
round && Styles.round30,
|
|
Styles.pv10,
|
|
{ borderColor: colors.icon + '20', backgroundColor: colors.input },
|
|
error && { borderColor: "red" }
|
|
]}>
|
|
<Feather name="arrow-right-circle" size={20} color={colors.text} />
|
|
<Text style={[{ color: colors.text }]}>{value}</Text>
|
|
</View>
|
|
</Pressable>
|
|
{error && (<Text style={[Styles.textInformation, Styles.mt05, Styles.cError]}>{errorText}</Text>)}
|
|
</View>
|
|
)
|
|
} |