native-pytech 1.0.12 → 1.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/libs/swiftui/index.d.ts +1 -0
- package/dist/libs/swiftui/index.js +1 -0
- package/dist/libs/swiftui/src/Dialog/index.d.ts +4 -0
- package/dist/libs/swiftui/src/Dialog/index.js +22 -0
- package/dist/libs/swiftui/src/Dialog/types.d.ts +21 -0
- package/dist/libs/swiftui/src/Dialog/types.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ConfirmationDialog, Button, Text } from '@expo/ui/swift-ui';
|
|
2
|
+
import React, { memo, useState, useCallback } from 'react';
|
|
3
|
+
export default memo(({ children, buttonTriggerProps, title, message, }) => {
|
|
4
|
+
const [isPresented, setIsPresented] = useState(false);
|
|
5
|
+
const onPress = useCallback(() => {
|
|
6
|
+
buttonTriggerProps?.onPress?.();
|
|
7
|
+
setIsPresented(true);
|
|
8
|
+
}, []);
|
|
9
|
+
return (<ConfirmationDialog title={title ?? ''} isPresented={isPresented} onIsPresentedChange={setIsPresented} titleVisibility={title ? 'visible' : 'hidden'}>
|
|
10
|
+
<ConfirmationDialog.Trigger>
|
|
11
|
+
<Button {...buttonTriggerProps} onPress={onPress}/>
|
|
12
|
+
</ConfirmationDialog.Trigger>
|
|
13
|
+
|
|
14
|
+
<ConfirmationDialog.Actions>
|
|
15
|
+
{children}
|
|
16
|
+
</ConfirmationDialog.Actions>
|
|
17
|
+
|
|
18
|
+
{message && <ConfirmationDialog.Message>
|
|
19
|
+
<Text>{message}</Text>
|
|
20
|
+
</ConfirmationDialog.Message>}
|
|
21
|
+
</ConfirmationDialog>);
|
|
22
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ButtonProps } from "@expo/ui/swift-ui";
|
|
2
|
+
type Props = {
|
|
3
|
+
/**
|
|
4
|
+
The buttons to be displayed in the dialog.
|
|
5
|
+
@example <Button label="Delete" role="destructive" onPress={() => console.log('Delete')} />
|
|
6
|
+
*/
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
The props to be passed to the button that triggers the dialog.
|
|
10
|
+
*/
|
|
11
|
+
buttonTriggerProps?: ButtonProps;
|
|
12
|
+
/**
|
|
13
|
+
The title of the dialog.
|
|
14
|
+
*/
|
|
15
|
+
title?: string;
|
|
16
|
+
/**
|
|
17
|
+
The message to be displayed in the dialog.
|
|
18
|
+
*/
|
|
19
|
+
message?: string;
|
|
20
|
+
};
|
|
21
|
+
export default Props;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|