Defines if modal should currently be shown or not
Function to change modal visibility. Called to hide the modal when someone taps on the backdrop.
Optional
showTitle?: booleanDisplay a title in the modal.
Optional
title?: stringTitle to display.
Optional
showConfirm?: booleanIf enabled, the confirm button is shown.
Function to call when the confirm button is pressed or the user taps out with onTapOut
set to "confirm".
Optional
showCancel?: booleanIf enabled, the cancel button is shown.
Optional
onCancel?: (duration: Duration) => voidFunction to call when the cancel button is pressed or the user taps out with onTapOut
set to "cancel".
const [duration, setDuration] = useState({hours: 0, minutes: 15, seconds: 30});
const [cachedDuration, setCachedDuration] = useState(cloneDuration(duration));
useEffect(() => {
setCachedDuration(cloneDuration(duration));
}, [duration]);
return (
<ModalTimePicker
duration={cachedDuration} // when user cancels and reopens the time picker modal, show previously selected values
onConfirm={setDuration}
onCancel={setCachedDuration}
//...
/>
);
Optional
allowTapOut?: booleanIf enabled, user can close the modal by tapping on the backdrop.
Optional
onTapOut?: "cancel" | "confirm"Defines if tapping out should be considered cancelling or confirming. The corresponding function will be called on tap out.
Optional
backdropStyle?: ViewStyleStyling for the backdrop.
Optional
titleStyle?: TextStyleStyling for the title text.
Optional
titlePickerSeparatorStyle?: ViewStyleStyling for the separator between the title and time picker.
Optional
pickerButtonsSeparatorStyle?: ViewStyleStyling for the separator between the time picker and buttons.
Optional
buttonContainerStyle?: ViewStyleStyling for the button container.
Optional
buttonSeparatorStyle?: ViewStyleStyling for the separator between the buttons.
Optional
confirmButtonStyle?: TextStyleStyling for the confirm button.
Optional
cancelButtonStyle?: TextStyleStyling for the cancel button.
Properties for a modal time picker extending time picker props.