@coinbase/cds-mobile 9.4.1 → 9.4.2
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/CHANGELOG.md
CHANGED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React, { useCallback, useMemo } from 'react';
|
|
2
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
3
|
+
import { ModalContext } from '@coinbase/cds-common/overlays/ModalContext';
|
|
4
|
+
import { useNavigation } from '@react-navigation/native';
|
|
5
|
+
import { Button } from '../../buttons/Button';
|
|
6
|
+
import { LoremIpsum } from '../../layout/__stories__/LoremIpsum';
|
|
7
|
+
import { VStack } from '../../layout/VStack';
|
|
8
|
+
import { ModalBody } from '../modal/ModalBody';
|
|
9
|
+
import { ModalFooter } from '../modal/ModalFooter';
|
|
10
|
+
import { ModalHeader } from '../modal/ModalHeader';
|
|
11
|
+
|
|
12
|
+
/** Deep link: expoapp:///DebugReactNavigationModal */
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
const ModalNavigationScreen = () => {
|
|
15
|
+
const navigation = useNavigation();
|
|
16
|
+
const handleClose = useCallback(() => navigation.goBack(), [navigation]);
|
|
17
|
+
const {
|
|
18
|
+
top
|
|
19
|
+
} = useSafeAreaInsets();
|
|
20
|
+
const modalContext = useMemo(() => ({
|
|
21
|
+
visible: true,
|
|
22
|
+
onRequestClose: handleClose
|
|
23
|
+
}), [handleClose]);
|
|
24
|
+
const rootStyle = useMemo(() => ({
|
|
25
|
+
paddingTop: top
|
|
26
|
+
}), [top]);
|
|
27
|
+
return /*#__PURE__*/_jsx(ModalContext.Provider, {
|
|
28
|
+
value: modalContext,
|
|
29
|
+
children: /*#__PURE__*/_jsxs(VStack, {
|
|
30
|
+
flexGrow: 1,
|
|
31
|
+
style: rootStyle,
|
|
32
|
+
children: [/*#__PURE__*/_jsx(ModalHeader, {
|
|
33
|
+
closeAccessibilityLabel: "Close",
|
|
34
|
+
title: "Navigation Modal"
|
|
35
|
+
}), /*#__PURE__*/_jsx(ModalBody, {
|
|
36
|
+
children: /*#__PURE__*/_jsx(LoremIpsum, {})
|
|
37
|
+
}), /*#__PURE__*/_jsx(ModalFooter, {
|
|
38
|
+
primaryAction: /*#__PURE__*/_jsx(Button, {
|
|
39
|
+
onPress: handleClose,
|
|
40
|
+
children: "Save"
|
|
41
|
+
}),
|
|
42
|
+
secondaryAction: /*#__PURE__*/_jsx(Button, {
|
|
43
|
+
onPress: handleClose,
|
|
44
|
+
variant: "secondary",
|
|
45
|
+
children: "Cancel"
|
|
46
|
+
})
|
|
47
|
+
})]
|
|
48
|
+
})
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
// eslint-disable-next-line internal/example-screen-default
|
|
53
|
+
export default ModalNavigationScreen;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinbase/cds-mobile",
|
|
3
|
-
"version": "9.4.
|
|
3
|
+
"version": "9.4.2",
|
|
4
4
|
"description": "Coinbase Design System - Mobile",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -206,9 +206,9 @@
|
|
|
206
206
|
"react-native-worklets": "0.5.2"
|
|
207
207
|
},
|
|
208
208
|
"dependencies": {
|
|
209
|
-
"@coinbase/cds-common": "^9.4.
|
|
209
|
+
"@coinbase/cds-common": "^9.4.2",
|
|
210
210
|
"@coinbase/cds-icons": "^5.19.0",
|
|
211
|
-
"@coinbase/cds-illustrations": "^4.
|
|
211
|
+
"@coinbase/cds-illustrations": "^4.43.0",
|
|
212
212
|
"@coinbase/cds-lottie-files": "^3.3.4",
|
|
213
213
|
"@coinbase/cds-utils": "^2.3.5",
|
|
214
214
|
"@floating-ui/react-native": "^0.10.5",
|