MCPcopy Create free account
hub / github.com/andrew-levy/jetpack-compose-react-native / DialogsExample

Function DialogsExample

example/app/dialogs.tsx:5–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3import { Button, Dialog } from "jetpack-compose-react-native";
4
5export default function DialogsExample() {
6 const [dialogVisible, setDialogVisible] = React.useState(false);
7
8 return (
9 <ScrollView style={{ flex: 1 }} contentContainerStyle={{ padding: 20 }}>
10 <Text style={styles.header}>Dialogs Example</Text>
11 {dialogVisible && (
12 <Dialog
13 title="Dialog Title"
14 text="Dialog text description"
15 icon="person"
16 confirmText="Confirm"
17 dismissText="Dismiss"
18 onConfirm={() => {
19 setDialogVisible(false);
20 console.log("Dialog confirmed");
21 }}
22 onDismiss={() => {
23 setDialogVisible(false);
24 console.log("Dialog dismissed");
25 }}
26 />
27 )}
28 <Button
29 text="Show Dialog"
30 onClick={() => {
31 setDialogVisible(true);
32 }}
33 />
34 </ScrollView>
35 );
36}
37
38const styles = StyleSheet.create({
39 header: {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected