()
| 3 | import { Button, DatePicker } from "jetpack-compose-react-native"; |
| 4 | |
| 5 | export default function DialogsExample() { |
| 6 | const [datePickerVisible, setDatePickerVisible] = React.useState(false); |
| 7 | |
| 8 | return ( |
| 9 | <ScrollView style={{ flex: 1 }} contentContainerStyle={{ padding: 20 }}> |
| 10 | <Text style={styles.header}>Datepickers Example</Text> |
| 11 | {datePickerVisible && ( |
| 12 | <DatePicker |
| 13 | showModeToggle |
| 14 | confirmText="Confirm" |
| 15 | dismissText="Cancel" |
| 16 | onDismiss={() => setDatePickerVisible(!datePickerVisible)} |
| 17 | /> |
| 18 | )} |
| 19 | <Button |
| 20 | text="Show DatePicker" |
| 21 | onClick={() => { |
| 22 | setDatePickerVisible(true); |
| 23 | }} |
| 24 | /> |
| 25 | </ScrollView> |
| 26 | ); |
| 27 | } |
| 28 | |
| 29 | const styles = StyleSheet.create({ |
| 30 | header: { |
nothing calls this directly
no outgoing calls
no test coverage detected