@bigbinary/neetoui-rn 0.0.269 → 0.0.271

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.
Files changed (125) hide show
  1. package/lib/components/Accordion.js +1 -1
  2. package/lib/components/ActionIcon.js +1 -1
  3. package/lib/components/Alert.js +1 -1
  4. package/lib/components/AnimatedImage.js +1 -1
  5. package/lib/components/Avatar.js +1 -1
  6. package/lib/components/Badge.js +1 -1
  7. package/lib/components/BottomSheet.js +1 -1
  8. package/lib/components/BottomTabBar.js +1 -1
  9. package/lib/components/Button.js +1 -1
  10. package/lib/components/ButtonGroup.js +1 -1
  11. package/lib/components/Calendar.js +1 -1
  12. package/lib/components/Card.js +1 -1
  13. package/lib/components/Carousel.js +1 -1
  14. package/lib/components/ChatInput/AttachmentsView.js +1 -1
  15. package/lib/components/ChatInput/Badge.js +1 -1
  16. package/lib/components/ChatInput/ChatInput.js +1 -1
  17. package/lib/components/ChatInput/EmailFields.js +1 -1
  18. package/lib/components/ChatInput/IconButton.js +1 -1
  19. package/lib/components/ChatInput/MentionsInputWrapper.js +1 -1
  20. package/lib/components/CheckBox.js +1 -1
  21. package/lib/components/Chip.js +1 -1
  22. package/lib/components/Container.js +1 -1
  23. package/lib/components/Divider.js +1 -1
  24. package/lib/components/FAB.js +1 -1
  25. package/lib/components/FlashList.js +1 -1
  26. package/lib/components/FlatList.js +1 -1
  27. package/lib/components/Input.js +1 -1
  28. package/lib/components/InputEmailChip.js +1 -1
  29. package/lib/components/LineLoader.js +1 -1
  30. package/lib/components/ListItem.js +1 -1
  31. package/lib/components/Loader.js +1 -1
  32. package/lib/components/MultiSelect.js +1 -1
  33. package/lib/components/NotificationIcon.js +1 -1
  34. package/lib/components/NotificationPreferenceList.js +1 -1
  35. package/lib/components/OnBoarding.js +1 -1
  36. package/lib/components/OrganizationItem.js +1 -1
  37. package/lib/components/OtpInputs.js +1 -1
  38. package/lib/components/ParentView.js +1 -1
  39. package/lib/components/Popover.js +1 -1
  40. package/lib/components/RadioButton.js +1 -1
  41. package/lib/components/RichTextEditor.js +1 -1
  42. package/lib/components/Ripple.js +1 -1
  43. package/lib/components/ScrollView.js +1 -1
  44. package/lib/components/SearchBar.js +1 -1
  45. package/lib/components/SegmentedTopBar/Indicator.js +1 -1
  46. package/lib/components/SegmentedTopBar/Tab.js +1 -1
  47. package/lib/components/SegmentedTopBar/index.js +1 -1
  48. package/lib/components/SocialButton.js +1 -1
  49. package/lib/components/Toast.js +1 -1
  50. package/lib/components/ToggleSwitch.js +1 -1
  51. package/lib/components/TopBar.js +1 -1
  52. package/lib/components/Touchable.js +1 -1
  53. package/lib/components/TouchableWithoutFeedback.js +1 -1
  54. package/lib/components/Typography.js +1 -1
  55. package/lib/components/index.js +1 -1
  56. package/lib/config/toasterConfig.js +1 -1
  57. package/lib/contexts/index.js +1 -1
  58. package/lib/theme/index.js +1 -1
  59. package/lib/utils/utils.js +1 -1
  60. package/package.json +22 -15
  61. package/src/components/Accordion.jsx +0 -266
  62. package/src/components/ActionIcon.jsx +0 -76
  63. package/src/components/Alert.jsx +0 -262
  64. package/src/components/AnimatedImage.jsx +0 -140
  65. package/src/components/Avatar.jsx +0 -144
  66. package/src/components/Badge.jsx +0 -97
  67. package/src/components/BottomSheet.jsx +0 -487
  68. package/src/components/BottomTabBar.jsx +0 -232
  69. package/src/components/Button.jsx +0 -275
  70. package/src/components/ButtonGroup.jsx +0 -120
  71. package/src/components/Calendar.jsx +0 -128
  72. package/src/components/Card.jsx +0 -90
  73. package/src/components/Carousel.jsx +0 -116
  74. package/src/components/ChatInput/AttachmentsView.jsx +0 -51
  75. package/src/components/ChatInput/Badge.jsx +0 -24
  76. package/src/components/ChatInput/ChatInput.jsx +0 -564
  77. package/src/components/ChatInput/EmailFields.jsx +0 -122
  78. package/src/components/ChatInput/IconButton.jsx +0 -34
  79. package/src/components/ChatInput/MentionsInputWrapper.jsx +0 -155
  80. package/src/components/CheckBox.jsx +0 -150
  81. package/src/components/Chip.jsx +0 -180
  82. package/src/components/Container.jsx +0 -31
  83. package/src/components/Divider.jsx +0 -79
  84. package/src/components/FAB.jsx +0 -113
  85. package/src/components/FlashList.jsx +0 -189
  86. package/src/components/FlatList.js +0 -10
  87. package/src/components/Input.jsx +0 -357
  88. package/src/components/InputEmailChip.jsx +0 -246
  89. package/src/components/LineLoader.jsx +0 -46
  90. package/src/components/ListItem.jsx +0 -68
  91. package/src/components/Loader.jsx +0 -122
  92. package/src/components/MultiSelect.jsx +0 -631
  93. package/src/components/NotificationIcon.jsx +0 -38
  94. package/src/components/NotificationPreferenceList.jsx +0 -208
  95. package/src/components/OnBoarding.jsx +0 -134
  96. package/src/components/OrganizationItem.jsx +0 -110
  97. package/src/components/OtpInputs.jsx +0 -194
  98. package/src/components/ParentView.jsx +0 -139
  99. package/src/components/Popover.jsx +0 -221
  100. package/src/components/RadioButton.jsx +0 -155
  101. package/src/components/RichTextEditor.jsx +0 -163
  102. package/src/components/Ripple.jsx +0 -281
  103. package/src/components/ScrollView.js +0 -14
  104. package/src/components/SearchBar.jsx +0 -207
  105. package/src/components/SegmentedTopBar/Indicator.jsx +0 -77
  106. package/src/components/SegmentedTopBar/Tab.jsx +0 -37
  107. package/src/components/SegmentedTopBar/index.jsx +0 -128
  108. package/src/components/SocialButton.jsx +0 -106
  109. package/src/components/Toast.jsx +0 -195
  110. package/src/components/ToggleSwitch.jsx +0 -112
  111. package/src/components/TopBar.jsx +0 -147
  112. package/src/components/Touchable.jsx +0 -133
  113. package/src/components/TouchableWithoutFeedback.jsx +0 -51
  114. package/src/components/Typography.jsx +0 -93
  115. package/src/components/index.js +0 -45
  116. package/src/config/index.js +0 -1
  117. package/src/config/toasterConfig.jsx +0 -142
  118. package/src/contexts/index.js +0 -3
  119. package/src/hooks/index.js +0 -3
  120. package/src/hooks/useDebounce.js +0 -17
  121. package/src/hooks/useKeyboard.js +0 -33
  122. package/src/hooks/useRefreshByUser.js +0 -20
  123. package/src/index.js +0 -2
  124. package/src/theme/index.js +0 -181
  125. package/src/utils/utils.js +0 -56
@@ -1,133 +0,0 @@
1
- import * as React from "react";
2
-
3
- import propTypes from "@styled-system/prop-types";
4
- import PropTypes from "prop-types";
5
- import styled from "styled-components/native";
6
- import {
7
- flexbox,
8
- space,
9
- border,
10
- buttonStyle,
11
- color,
12
- layout,
13
- } from "styled-system";
14
-
15
- import Ripple from "./Ripple";
16
-
17
- import { getShadowStyles } from "../utils/utils";
18
-
19
- const StyledRipple = styled(Ripple)`
20
- ${buttonStyle}
21
- ${flexbox}
22
- ${space}
23
- ${border}
24
- ${layout}
25
- ${color}
26
- `;
27
-
28
- /**
29
- * Touchable component is a wrapper over Ripple.
30
- *
31
- * This component supports below props categories from [styled-system ](/styled-system).
32
- * <ul>
33
- * <li>flexbox</li>
34
- * <li>space</li>
35
- * <li>border</li>
36
- * <li>layout</li>
37
- * <li>color</li>
38
- * <li>buttonStyle</li>
39
- * </ul>
40
- *
41
- * ## Usage
42
- * ```js
43
- * import * as React from 'react';
44
- * import { Touchable, Typography } from '@bigbinary/neetoui-rn';
45
- *
46
- * export default function Main() {
47
- * return (
48
- * <Touchable
49
- * bg="background.primary"
50
- * width="100px"
51
- * height="30px"
52
- * rippleConfig={{
53
- * opacity: 0.09,
54
- * duration: 600,
55
- * containerBorderRadius: moderateScale(50),
56
- * }}
57
- * >
58
- * <Typography fontSize="10px">This is wrapped in Touchable component</Typography>
59
- * </Touchable>
60
- * );
61
- * }
62
- * ```
63
- *
64
- */
65
-
66
- const defaultRippleConfig = {
67
- rippleCentered: false,
68
- rippleSequential: true,
69
- rippleFades: true,
70
- rippleOutsideContainer: false,
71
- rippleColor: "#000",
72
- rippleOpacity: 0.09,
73
- rippleDuration: 600,
74
- rippleSize: 0,
75
- rippleContainerBorderRadius: 0,
76
- };
77
-
78
- export const Touchable = React.forwardRef((props, ref) => {
79
- const { children, elevation, rippleConfig, ...rest } = props;
80
- const shadowStyles = elevation ? getShadowStyles(elevation) : {};
81
-
82
- const rippleProps = {
83
- ...defaultRippleConfig,
84
- rippleCentered:
85
- rippleConfig.isCentered ?? defaultRippleConfig.rippleCentered,
86
- rippleSequential:
87
- rippleConfig.isSequential ?? defaultRippleConfig.rippleSequential,
88
- rippleFades: rippleConfig.shouldFade ?? defaultRippleConfig.rippleFades,
89
- rippleOutsideContainer:
90
- rippleConfig.shouldOverflowContainer ??
91
- defaultRippleConfig.rippleOutsideContainer,
92
- rippleColor: rippleConfig.color ?? defaultRippleConfig.rippleColor,
93
- rippleOpacity: rippleConfig.opacity ?? defaultRippleConfig.rippleOpacity,
94
- rippleDuration: rippleConfig.duration ?? defaultRippleConfig.rippleDuration,
95
- rippleSize: rippleConfig.size ?? defaultRippleConfig.rippleSize,
96
- rippleContainerBorderRadius: rest.borderRadius ? rest.borderRadius : 0,
97
- };
98
-
99
- return (
100
- <StyledRipple ref={ref} style={shadowStyles} {...rippleProps} {...rest}>
101
- {children}
102
- </StyledRipple>
103
- );
104
- });
105
-
106
- Touchable.propTypes = {
107
- ...propTypes.flexbox,
108
- ...propTypes.space,
109
- ...propTypes.border,
110
- ...propTypes.layout,
111
- ...propTypes.color,
112
- ...propTypes.buttonStyle,
113
-
114
- children: PropTypes.node.isRequired,
115
- elevation: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
116
- rippleConfig: PropTypes.shape({
117
- isCentered: PropTypes.bool,
118
- isSequential: PropTypes.bool,
119
- shouldFade: PropTypes.bool,
120
- shouldOverflowContainer: PropTypes.bool,
121
- color: PropTypes.string,
122
- opacity: PropTypes.number,
123
- duration: PropTypes.number,
124
- size: PropTypes.number,
125
- containerBorderRadius: PropTypes.number,
126
- }),
127
- };
128
-
129
- Touchable.defaultProps = {
130
- rippleConfig: {},
131
- };
132
-
133
- Touchable.displayName = "Touchable";
@@ -1,51 +0,0 @@
1
- import React, { useRef } from "react";
2
- import { TouchableWithoutFeedback as RNTouchableWithoutFeedback } from "react-native";
3
-
4
- import PropTypes from "prop-types";
5
-
6
- const TouchableWithoutFeedback = ({ onPress, onPressIn, ...props }) => {
7
- const _touchActivatePositionRef = useRef(null);
8
-
9
- function _onPressIn(e) {
10
- const { pageX, pageY } = e.nativeEvent;
11
-
12
- _touchActivatePositionRef.current = {
13
- pageX,
14
- pageY,
15
- };
16
-
17
- onPressIn?.(e);
18
- }
19
-
20
- function _onPress(e) {
21
- const { pageX, pageY } = e.nativeEvent;
22
-
23
- const absX = Math.abs(_touchActivatePositionRef?.current?.pageX - pageX);
24
- const absY = Math.abs(_touchActivatePositionRef?.current?.pageY - pageY);
25
-
26
- const dragged = absX > 2 || absY > 2;
27
- if (!dragged) {
28
- onPress?.(e);
29
- }
30
- }
31
-
32
- return (
33
- <RNTouchableWithoutFeedback
34
- onPress={_onPress}
35
- onPressIn={_onPressIn}
36
- {...props}
37
- >
38
- {props.children}
39
- </RNTouchableWithoutFeedback>
40
- );
41
- };
42
-
43
- TouchableWithoutFeedback.defaultProps = {};
44
-
45
- TouchableWithoutFeedback.propTypes = {
46
- onPress: PropTypes.func,
47
- onPressIn: PropTypes.func,
48
- children: PropTypes.element.isRequired,
49
- };
50
-
51
- export default TouchableWithoutFeedback;
@@ -1,93 +0,0 @@
1
- import * as React from "react";
2
-
3
- import propTypes from "@styled-system/prop-types";
4
- import PropTypes from "prop-types";
5
- import styled from "styled-components/native";
6
- import {
7
- space,
8
- layout,
9
- flexbox,
10
- typography,
11
- color,
12
- textStyle,
13
- position,
14
- system,
15
- } from "styled-system";
16
-
17
- export const Text = styled.Text`
18
- ${textStyle}
19
- ${space}
20
- ${layout}
21
- ${flexbox}
22
- ${typography}
23
- ${color}
24
- ${position}
25
- ${system({
26
- textDecoration: {
27
- property: "textDecoration",
28
- cssProperty: "textDecoration",
29
- },
30
- textTransform: { property: "textTransform", cssProperty: "textTransform" },
31
- })}
32
- `;
33
-
34
- /**
35
- * Typography component is a primitive text component which is built on top of styled-system.
36
- *
37
- * This component supports below props categories from [styled-system ](/styled-system).
38
- *
39
- * <ul>
40
- * <li>space</li>
41
- * <li>layout</li>
42
- * <li>flexbox</li>
43
- * <li>typography</li>
44
- * <li>color</li>
45
- * <li>textStyle</li>
46
- * </ul>
47
- *
48
- * <div class="screenshots">
49
- * <img src="screenshots/typography/colors.png" />
50
- * <img src="screenshots/typography/fontfamilies.png" />
51
- * </div>
52
- *
53
- * <div class="screenshots">
54
- * <img src="screenshots/typography/fontsizes.png" />
55
- * <img src="screenshots/typography/textstyles.png" />
56
- * </div>
57
- *
58
- * ## Usage
59
- * ```js
60
- * import * as React from 'react';
61
- * import { Typography, Container } from '@bigbinary/neetoui-rn';
62
- *
63
- * export default function Main() {
64
- * return (
65
- * <Container>
66
- * <Typography>
67
- * This is basic example of Typography
68
- * </Typography>
69
- * </Container>
70
- * );
71
- * }
72
- * ```
73
- *
74
- * @extends StyledSystems props /styled-system
75
- */
76
-
77
- export const Typography = ({ children, ...rest }) => (
78
- <Text {...rest}>{children}</Text>
79
- );
80
-
81
- Typography.propTypes = {
82
- ...propTypes.space,
83
- ...propTypes.layout,
84
- ...propTypes.flexbox,
85
- ...propTypes.typography,
86
- ...propTypes.color,
87
- ...propTypes.textStyle,
88
- children: PropTypes.node,
89
- };
90
-
91
- Typography.defaultProps = {
92
- textStyle: "defaultTextStyle",
93
- };
@@ -1,45 +0,0 @@
1
- export { Button } from "./Button";
2
- export { SocialButton } from "./SocialButton";
3
- export { Container } from "./Container";
4
- export { Typography } from "./Typography";
5
- export { Input } from "./Input";
6
- export { FAB } from "./FAB";
7
- export { ToggleSwitch } from "./ToggleSwitch";
8
- export { Avatar } from "./Avatar";
9
- export { Badge } from "./Badge";
10
- export { Toast } from "./Toast";
11
- export { Alert } from "./Alert";
12
- export { BottomSheet } from "./BottomSheet";
13
- export { Chip } from "./Chip";
14
- export { ParentView } from "./ParentView";
15
- export { RichTextEditor } from "./RichTextEditor";
16
- export { ButtonGroup } from "./ButtonGroup";
17
- export { OtpInputs } from "./OtpInputs";
18
- export { Popover } from "./Popover";
19
- export { Touchable } from "./Touchable";
20
- export { Card } from "./Card";
21
- export { TopBar } from "./TopBar";
22
- export { RadioButton } from "./RadioButton";
23
- export { CheckBox } from "./CheckBox";
24
- export { MultiSelect } from "./MultiSelect";
25
- export { Divider } from "./Divider";
26
- export { FlatList } from "./FlatList";
27
- export { ScrollView } from "./ScrollView";
28
- export { SegmentedTopBar } from "./SegmentedTopBar";
29
- export { ListItem } from "./ListItem";
30
- export { Carousel } from "./Carousel";
31
- export { OnBoarding } from "./OnBoarding";
32
- export { SearchBar } from "./SearchBar";
33
- export { Accordion } from "./Accordion";
34
- export { Calendar } from "./Calendar";
35
- export { FlashList } from "./FlashList";
36
- export { BottomTabBar } from "./BottomTabBar";
37
- export { AnimatedImage } from "./AnimatedImage";
38
- export { NotificationPreferenceList } from "./NotificationPreferenceList";
39
- export { OrganizationItem } from "./OrganizationItem";
40
- export { ChatInput } from "./ChatInput/ChatInput";
41
- export { Loader } from "./Loader";
42
- export { InputEmailChip } from "./InputEmailChip";
43
- export { LineLoader } from "./LineLoader";
44
- export { ActionIcon } from "./ActionIcon";
45
- export { NotificationIcon } from "./NotificationIcon";
@@ -1 +0,0 @@
1
- export { defaultToasterConfig } from "./toasterConfig";
@@ -1,142 +0,0 @@
1
- import React from "react";
2
- import { Pressable, StyleSheet } from "react-native";
3
-
4
- import { Close } from "@bigbinary/neeto-icons-rn";
5
- import { moderateScale } from "react-native-size-matters";
6
- import Toast, { BaseToast } from "react-native-toast-message";
7
-
8
- import { theme } from "@theme";
9
-
10
- const CloseButton = () => (
11
- <Pressable style={styles.closeButtonStyle} onPress={Toast.hide}>
12
- <Close color={theme.colors.background.white} size={moderateScale(22)} />
13
- </Pressable>
14
- );
15
-
16
- export const defaultToasterConfig = {
17
- success: props => (
18
- <BaseToast
19
- {...props}
20
- contentContainerStyle={styles.contentContainerStyle}
21
- leadingIconContainerStyle={styles.toasterBGColor}
22
- renderTrailingIcon={() => <CloseButton />}
23
- text1NumberOfLines={10}
24
- text1Style={styles.text1Style}
25
- text2NumberOfLines={10}
26
- text2Style={styles.text2Style}
27
- touchableContainerProps={{
28
- style: [styles.touchableContainerProps, styles.successStyle],
29
- }}
30
- />
31
- ),
32
- error: props => (
33
- <BaseToast
34
- {...props}
35
- contentContainerStyle={styles.contentContainerStyle}
36
- leadingIconContainerStyle={styles.toasterBGColor}
37
- renderTrailingIcon={() => <CloseButton />}
38
- text1NumberOfLines={10}
39
- text1Style={styles.text1Style}
40
- text2NumberOfLines={10}
41
- text2Style={styles.text2Style}
42
- touchableContainerProps={{
43
- style: [styles.touchableContainerProps, styles.errorStyle],
44
- }}
45
- />
46
- ),
47
- info: props => (
48
- <BaseToast
49
- {...props}
50
- contentContainerStyle={styles.contentContainerStyle}
51
- leadingIconContainerStyle={styles.toasterBGColor}
52
- renderTrailingIcon={() => <CloseButton />}
53
- text1NumberOfLines={10}
54
- text1Style={styles.text1Style}
55
- text2NumberOfLines={10}
56
- text2Style={styles.text2Style}
57
- touchableContainerProps={{
58
- style: [styles.touchableContainerProps, styles.infoStyle],
59
- }}
60
- />
61
- ),
62
- warning: props => (
63
- <BaseToast
64
- {...props}
65
- contentContainerStyle={styles.contentContainerStyle}
66
- leadingIconContainerStyle={styles.toasterBGColor}
67
- renderTrailingIcon={() => <CloseButton />}
68
- text1NumberOfLines={10}
69
- text1Style={styles.text1Style}
70
- text2NumberOfLines={10}
71
- text2Style={styles.text2Style}
72
- touchableContainerProps={{
73
- style: [styles.touchableContainerProps, styles.warningStyle],
74
- }}
75
- />
76
- ),
77
- };
78
-
79
- defaultToasterConfig.success.displayName = "Success";
80
- defaultToasterConfig.error.displayName = "Error";
81
-
82
- const styles = StyleSheet.create({
83
- touchableContainerProps: {
84
- flexDirection: "row",
85
- flex: 1,
86
- paddingVertical: 10,
87
- width: 340,
88
- borderRadius: 6,
89
- shadowOffset: { width: 0, height: 0 },
90
- shadowOpacity: 0.1,
91
- shadowRadius: 6,
92
- elevation: 2,
93
- backgroundColor: "#FFF",
94
- borderLeftWidth: 5,
95
- borderLeftColor: "#D8D8D8",
96
- },
97
- successStyle: {
98
- borderLeftColor: theme.colors.toast.success,
99
- backgroundColor: theme.colors.background.grey800,
100
- },
101
- errorStyle: {
102
- borderLeftColor: theme.colors.toast.error,
103
- backgroundColor: theme.colors.background.grey800,
104
- },
105
- infoStyle: {
106
- borderLeftColor: theme.colors.toast.info,
107
- backgroundColor: theme.colors.background.grey800,
108
- },
109
- warningStyle: {
110
- borderLeftColor: theme.colors.toast.warning,
111
- backgroundColor: theme.colors.background.grey800,
112
- },
113
- toasterBGColor: { backgroundColor: theme.colors.background.grey800 },
114
- contentContainerStyle: {
115
- paddingHorizontal: 15,
116
- backgroundColor: theme.colors.background.grey800,
117
- },
118
- text1Style: {
119
- fontSize: 15,
120
- fontFamily: theme.fonts.sf700,
121
- color: theme.colors.font.white,
122
- },
123
- text2Style: {
124
- fontSize: 16,
125
- fontFamily: theme.fonts.sf700,
126
- color: theme.colors.font.white,
127
- },
128
- closeButtonStyle: {
129
- justifyContent: "center",
130
- alignItems: "center",
131
- paddingRight: 10,
132
- backgroundColor: theme.colors.background.grey800,
133
- shadowColor: theme.colors.background.grey800,
134
- flexDirection: "row",
135
- borderTopRightRadius: 6,
136
- borderBottomRightRadius: 6,
137
- shadowOffset: { width: 0, height: 0 },
138
- shadowOpacity: 0.1,
139
- shadowRadius: 6,
140
- elevation: 2,
141
- },
142
- });
@@ -1,3 +0,0 @@
1
- import React from "react";
2
-
3
- export const ProviderContext = React.createContext(null);
@@ -1,3 +0,0 @@
1
- export { useKeyboard } from "./useKeyboard";
2
- export { useDebounce } from "./useDebounce";
3
- export { useRefreshByUser } from "./useRefreshByUser";
@@ -1,17 +0,0 @@
1
- import { useState, useEffect } from "react";
2
-
3
- export function useDebounce(value, delay) {
4
- const [debouncedValue, setDebouncedValue] = useState(value);
5
-
6
- useEffect(() => {
7
- const handler = setTimeout(() => {
8
- setDebouncedValue(value);
9
- }, delay);
10
-
11
- return () => {
12
- clearTimeout(handler);
13
- };
14
- }, [value, delay]);
15
-
16
- return debouncedValue;
17
- }
@@ -1,33 +0,0 @@
1
- import { useEffect, useState } from "react";
2
- import { Keyboard } from "react-native";
3
-
4
- export function useKeyboard() {
5
- const [keyboardHeight, setKeyboardHeight] = useState(0);
6
-
7
- function onKeyboardDidShow(e) {
8
- setKeyboardHeight(e.endCoordinates.height);
9
- }
10
-
11
- function onKeyboardDidHide() {
12
- setKeyboardHeight(0);
13
- }
14
-
15
- useEffect(() => {
16
- const keyboardDidShowListener = Keyboard.addListener(
17
- "keyboardDidShow",
18
- onKeyboardDidShow
19
- );
20
-
21
- const keyboardDidHideListener = Keyboard.addListener(
22
- "keyboardDidHide",
23
- onKeyboardDidHide
24
- );
25
-
26
- return () => {
27
- keyboardDidHideListener.remove();
28
- keyboardDidShowListener.remove();
29
- };
30
- }, []);
31
-
32
- return keyboardHeight;
33
- }
@@ -1,20 +0,0 @@
1
- import { useState } from "react";
2
-
3
- export function useRefreshByUser(refetch) {
4
- const [isRefetchingByUser, setIsRefetchingByUser] = useState(false);
5
-
6
- async function refetchByUser() {
7
- setIsRefetchingByUser(true);
8
-
9
- try {
10
- await refetch();
11
- } finally {
12
- setIsRefetchingByUser(false);
13
- }
14
- }
15
-
16
- return {
17
- isRefetchingByUser,
18
- refetchByUser,
19
- };
20
- }
package/src/index.js DELETED
@@ -1,2 +0,0 @@
1
- export * from "./components";
2
- export * from "./theme";