MCPcopy Create free account
hub / github.com/callstack/react-native-paper / DialogExample

Function DialogExample

example/src/Examples/DialogExample.tsx:22–118  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

20};
21
22const DialogExample = () => {
23 const [visible, setVisible] = React.useState<ButtonVisibility>({});
24 const { isV3 } = useExampleTheme();
25
26 const _toggleDialog = (name: string) => () =>
27 setVisible({ ...visible, [name]: !visible[name] });
28
29 const _getVisible = (name: string) => !!visible[name];
30
31 return (
32 <ScreenWrapper style={styles.container}>
33 <Button
34 mode="outlined"
35 onPress={_toggleDialog('dialog1')}
36 style={styles.button}
37 >
38 Long text
39 </Button>
40 <Button
41 mode="outlined"
42 onPress={_toggleDialog('dialog2')}
43 style={styles.button}
44 >
45 Radio buttons
46 </Button>
47 <Button
48 mode="outlined"
49 onPress={_toggleDialog('dialog3')}
50 style={styles.button}
51 >
52 Progress indicator
53 </Button>
54 <Button
55 mode="outlined"
56 onPress={_toggleDialog('dialog4')}
57 style={styles.button}
58 >
59 Undismissable Dialog
60 </Button>
61 <Button
62 mode="outlined"
63 onPress={_toggleDialog('dialog5')}
64 style={styles.button}
65 >
66 Custom colors
67 </Button>
68 {isV3 && (
69 <Button
70 mode="outlined"
71 onPress={_toggleDialog('dialog6')}
72 style={styles.button}
73 >
74 With icon
75 </Button>
76 )}
77 {Platform.OS === 'android' && (
78 <Button
79 mode="outlined"

Callers

nothing calls this directly

Calls 3

useExampleThemeFunction · 0.90
_toggleDialogFunction · 0.85
_getVisibleFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…