upd: ui jabatan
Deskripsi: - ui list jabatan - ui filter modal - ui tambah jabatan - ui select option - ui modal select option - ui edit jabatan No Issues
This commit is contained in:
46
components/selectForm.tsx
Normal file
46
components/selectForm.tsx
Normal file
@@ -0,0 +1,46 @@
|
||||
import Styles from "@/constants/Styles";
|
||||
import { Feather } from "@expo/vector-icons";
|
||||
import { Pressable, Text, View } from "react-native";
|
||||
|
||||
|
||||
type Props = {
|
||||
label?: string;
|
||||
placeholder?: string;
|
||||
value: string;
|
||||
onPress?: () => void;
|
||||
info?: string;
|
||||
itemLeft?: React.ReactNode;
|
||||
error?: boolean;
|
||||
errorText?: string;
|
||||
required?: boolean;
|
||||
round?: boolean
|
||||
};
|
||||
|
||||
export default function SelectForm({ label, value, placeholder, onPress, info, error, errorText, required, itemLeft, round }: Props) {
|
||||
return (
|
||||
<View style={[Styles.mb10]}>
|
||||
{
|
||||
label != undefined && (
|
||||
<Text style={[Styles.mb05, { textTransform: "capitalize" }, error && Styles.cError]}>
|
||||
{label}
|
||||
{required && (<Text style={Styles.cError}>*</Text>)}
|
||||
</Text>
|
||||
)
|
||||
}
|
||||
<Pressable onPress={onPress}>
|
||||
<View style={[Styles.inputRoundForm, Styles.inputRoundFormRight, error && { borderColor: "red" }, round && Styles.round30, Styles.pv10]}>
|
||||
<Feather name="chevron-right" size={20} color="grey" />
|
||||
{
|
||||
value ? (
|
||||
<Text style={[Styles.cBlack]}>{value}</Text>
|
||||
) : (
|
||||
<Text style={[Styles.cGray]}>{placeholder}</Text>
|
||||
)
|
||||
}
|
||||
</View>
|
||||
</Pressable>
|
||||
{error && (<Text style={[Styles.textInformation, Styles.cError]}>{errorText}</Text>)}
|
||||
{info != undefined && (<Text style={[Styles.textInformation, , Styles.cGray]}>{info}</Text>)}
|
||||
</View>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user