upd: inputdate
Deskripsi: - custom tampilan input datetime picker pada ios No Issues
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import Styles from '@/constants/Styles';
|
||||
import { Pressable, View } from 'react-native';
|
||||
import Text from './Text';
|
||||
import Modal from 'react-native-modal';
|
||||
import Text from './Text';
|
||||
|
||||
type Props = {
|
||||
isVisible: boolean
|
||||
@@ -10,9 +10,10 @@ type Props = {
|
||||
children: React.ReactNode
|
||||
onSubmit: () => void
|
||||
disableSubmit?: boolean
|
||||
buttonHide?: boolean
|
||||
}
|
||||
|
||||
export default function ModalFloat({ isVisible, setVisible, title, children, onSubmit, disableSubmit }: Props) {
|
||||
export default function ModalFloat({ isVisible, setVisible, title, children, onSubmit, disableSubmit, buttonHide }: Props) {
|
||||
return (
|
||||
<Modal
|
||||
animationIn={"fadeIn"}
|
||||
@@ -28,14 +29,18 @@ export default function ModalFloat({ isVisible, setVisible, title, children, onS
|
||||
<View style={[Styles.mb10]}>
|
||||
{children}
|
||||
</View>
|
||||
<View style={[Styles.rowItemsCenter, { justifyContent: 'flex-end' }]}>
|
||||
<Pressable style={[Styles.ph15, Styles.pv05, Styles.round10, Styles.mr10]} onPress={() => { setVisible(false) }}>
|
||||
<Text style={[Styles.textDefault]}>Batal</Text>
|
||||
</Pressable>
|
||||
<Pressable style={[Styles.ph15, Styles.pv05, Styles.round10]} onPress={onSubmit} disabled={disableSubmit}>
|
||||
<Text style={[Styles.textDefault, disableSubmit && Styles.cGray]}>Simpan</Text>
|
||||
</Pressable>
|
||||
</View>
|
||||
{
|
||||
!buttonHide && (
|
||||
<View style={[Styles.rowItemsCenter, { justifyContent: 'flex-end' }]}>
|
||||
<Pressable style={[Styles.ph15, Styles.pv05, Styles.round10, Styles.mr10]} onPress={() => { setVisible(false) }}>
|
||||
<Text style={[Styles.textDefault]}>Batal</Text>
|
||||
</Pressable>
|
||||
<Pressable style={[Styles.ph15, Styles.pv05, Styles.round10]} onPress={onSubmit} disabled={disableSubmit}>
|
||||
<Text style={[Styles.textDefault, disableSubmit && Styles.cGray]}>Simpan</Text>
|
||||
</Pressable>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
</View>
|
||||
</Modal>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user