@holper/react-native-holper-storybook 0.6.100 → 0.6.102

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.
@@ -1,7 +1,6 @@
1
1
  import React, { useState, useEffect } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { TouchableOpacity, ActivityIndicator } from 'react-native';
4
- import { ViewPropTypes } from 'deprecated-react-native-prop-types';
5
4
  import withPreventDoubleClick from './../PreventDoubleClick';
6
5
  import { Colors } from '../../configs/constants';
7
6
  import style from './style';
@@ -97,7 +96,7 @@ Button.propTypes = {
97
96
  'secondary',
98
97
  ]),
99
98
  size: PropTypes.oneOf(['tiny', 'small', 'medium', 'fit', 'icon']),
100
- style: ViewPropTypes.style,
99
+ style: PropTypes.any,
101
100
  onPress: PropTypes.func,
102
101
  debounceDelay: PropTypes.number,
103
102
  };
@@ -1,13 +1,15 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { View, TouchableOpacity } from 'react-native';
4
- import {ViewPropTypes} from 'deprecated-react-native-prop-types';
5
4
  import withPreventDoubleClick from '../PreventDoubleClick';
6
5
  import style from './style';
7
6
 
8
7
  const TappedTouchableOpacity = withPreventDoubleClick(TouchableOpacity);
9
8
 
10
- const Card = ({children, isButton, onPress, noShadow, style: customStyle}, ...props) => (
9
+ const Card = (
10
+ { children, isButton, onPress, noShadow, style: customStyle },
11
+ ...props
12
+ ) => (
11
13
  <>
12
14
  {isButton ? (
13
15
  <TappedTouchableOpacity
@@ -33,15 +35,15 @@ Card.defaultProps = {
33
35
  children: null,
34
36
  isButton: false,
35
37
  noShadow: false,
36
- onPress: () => {}
38
+ onPress: () => {},
37
39
  };
38
40
 
39
41
  Card.propTypes = {
40
- style: ViewPropTypes.style,
42
+ style: PropTypes.any,
41
43
  children: PropTypes.node,
42
44
  isButton: PropTypes.bool,
43
45
  noShadow: PropTypes.bool,
44
- onPress: PropTypes.func
46
+ onPress: PropTypes.func,
45
47
  };
46
48
 
47
- export default Card;
49
+ export default Card;
@@ -7,7 +7,6 @@ import {
7
7
  ScrollView,
8
8
  View,
9
9
  } from 'react-native';
10
- import { ViewPropTypes } from 'deprecated-react-native-prop-types';
11
10
  import style from './style';
12
11
 
13
12
  const Container = ({
@@ -48,8 +47,8 @@ Container.defaultProps = {
48
47
  Container.propTypes = {
49
48
  fullScreen: PropTypes.bool,
50
49
  enableScroll: PropTypes.bool,
51
- style: ViewPropTypes.style,
52
- scrollStyle: ViewPropTypes.style,
50
+ style: PropTypes.any,
51
+ scrollStyle: PropTypes.any,
53
52
  };
54
53
 
55
54
  export default Container;
@@ -1,18 +1,23 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { View, ScrollView, RefreshControl, KeyboardAvoidingView, Platform } from 'react-native';
4
- import {ViewPropTypes} from 'deprecated-react-native-prop-types';
3
+ import {
4
+ View,
5
+ ScrollView,
6
+ RefreshControl,
7
+ KeyboardAvoidingView,
8
+ Platform,
9
+ } from 'react-native';
5
10
  import style from './style';
6
11
 
7
12
  const FloatingContainer = ({
8
- useRefreshControl,
9
- onRefresh,
10
- isRefreshing,
11
- children,
12
- floatingComponent,
13
- centered,
14
- floatingContainerStyle,
15
- disableScroll
13
+ useRefreshControl,
14
+ onRefresh,
15
+ isRefreshing,
16
+ children,
17
+ floatingComponent,
18
+ centered,
19
+ floatingContainerStyle,
20
+ disableScroll,
16
21
  }) => (
17
22
  <KeyboardAvoidingView
18
23
  style={style.floatingContainer}
@@ -27,16 +32,15 @@ const FloatingContainer = ({
27
32
  keyboardDismissMode='on-drag'
28
33
  refreshControl={
29
34
  useRefreshControl ? (
30
- <RefreshControl
31
- refreshing={isRefreshing}
32
- onRefresh={onRefresh}
33
- />
34
- ) : false
35
+ <RefreshControl refreshing={isRefreshing} onRefresh={onRefresh} />
36
+ ) : null
35
37
  }
36
38
  >
37
39
  {children}
38
40
  </ScrollView>
39
- <View style={[style.container, floatingContainerStyle]}>{floatingComponent}</View>
41
+ <View style={[style.container, floatingContainerStyle]}>
42
+ {floatingComponent}
43
+ </View>
40
44
  </KeyboardAvoidingView>
41
45
  );
42
46
 
@@ -48,7 +52,7 @@ FloatingContainer.defaultProps = {
48
52
  children: null,
49
53
  floatingComponent: null,
50
54
  disableScroll: false,
51
- floatingContainerStyle: {}
55
+ floatingContainerStyle: {},
52
56
  };
53
57
 
54
58
  FloatingContainer.propTypes = {
@@ -59,7 +63,7 @@ FloatingContainer.propTypes = {
59
63
  children: PropTypes.node,
60
64
  floatingComponent: PropTypes.node,
61
65
  disableScroll: PropTypes.bool,
62
- floatingContainerStyle: ViewPropTypes.style
66
+ floatingContainerStyle: PropTypes.any,
63
67
  };
64
68
 
65
- export default FloatingContainer;
69
+ export default FloatingContainer;
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { View, TouchableOpacity, Image } from 'react-native';
4
- import { ImagePropTypes } from 'deprecated-react-native-prop-types';
5
4
  import Ionicons from 'react-native-vector-icons/Ionicons';
6
5
  import { Colors } from '../../configs/constants';
7
6
  import style from './style';
@@ -38,7 +37,7 @@ Header.defaultProps = {
38
37
 
39
38
  Header.propTypes = {
40
39
  inverted: PropTypes.bool,
41
- logo: ImagePropTypes.source.isRequired,
40
+ logo: PropTypes.any.isRequired,
42
41
  right: PropTypes.node,
43
42
  onMenuPress: PropTypes.func,
44
43
  };
@@ -1,39 +1,39 @@
1
1
  import React, { useState } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { Image, View } from 'react-native';
4
- import {ViewPropTypes, ImagePropTypes} from 'deprecated-react-native-prop-types';
5
4
  import style from './style';
6
5
 
7
6
  const ImageResponsive = ({ source, style: customStyle, avatar, ...props }) => {
8
7
  const [width, setWidth] = useState(100);
9
8
 
10
9
  return (
11
- <View style={[
12
- customStyle,
13
- avatar ? { borderRadius: width / 2, overflow: 'hidden' } : {}
14
- ]}
10
+ <View
11
+ style={[
12
+ customStyle,
13
+ avatar ? { borderRadius: width / 2, overflow: 'hidden' } : {},
14
+ ]}
15
15
  >
16
16
  <Image
17
17
  style={style.responsiveImage}
18
18
  source={source}
19
19
  resizeMode={avatar ? 'cover' : 'contain'}
20
- onLayout={({nativeEvent}) => setWidth(nativeEvent.layout.width)}
20
+ onLayout={({ nativeEvent }) => setWidth(nativeEvent.layout.width)}
21
21
  {...props}
22
22
  />
23
23
  </View>
24
24
  );
25
- }
25
+ };
26
26
 
27
27
  ImageResponsive.defaultProps = {
28
28
  style: {},
29
29
  source: null,
30
- avatar: false
30
+ avatar: false,
31
31
  };
32
32
 
33
33
  ImageResponsive.propTypes = {
34
- style: ViewPropTypes.style,
35
- source: ImagePropTypes.source.isRequired,
36
- avatar: PropTypes.bool
34
+ style: PropTypes.any,
35
+ source: PropTypes.any.isRequired,
36
+ avatar: PropTypes.bool,
37
37
  };
38
38
 
39
39
  export default ImageResponsive;
@@ -1,10 +1,16 @@
1
1
  import React, { useState } from 'react';
2
- import { View, Modal, TouchableOpacity, ActivityIndicator, Image } from 'react-native';
2
+ import {
3
+ View,
4
+ Modal,
5
+ TouchableOpacity,
6
+ ActivityIndicator,
7
+ Image,
8
+ } from 'react-native';
3
9
  import Ionicons from 'react-native-vector-icons/Ionicons';
4
- import {ImagePropTypes} from 'deprecated-react-native-prop-types';
5
10
  import ImageResponsive from '../ImageResponsive';
6
11
  import { Colors } from '../../configs/constants';
7
12
  import style from './style';
13
+ import PropTypes from 'prop-types';
8
14
 
9
15
  const ImageViewer = ({ source, style: imageStyle, ...props }) => {
10
16
  const [loading, setLoading] = useState(true);
@@ -13,21 +19,20 @@ const ImageViewer = ({ source, style: imageStyle, ...props }) => {
13
19
  return (
14
20
  <>
15
21
  <TouchableOpacity onPress={() => setVisible(true)}>
16
- <ImageResponsive
17
- source={source}
18
- style={imageStyle}
19
- {...props}
20
- />
22
+ <ImageResponsive source={source} style={imageStyle} {...props} />
21
23
  </TouchableOpacity>
22
24
 
23
25
  <Modal
24
- animationType="slide"
26
+ animationType='slide'
25
27
  transparent={true}
26
28
  visible={visible}
27
29
  onRequestClose={() => {}}
28
30
  >
29
31
  <View style={style.container}>
30
- <TouchableOpacity onPress={() => setVisible(false)} style={style.closeIcon}>
32
+ <TouchableOpacity
33
+ onPress={() => setVisible(false)}
34
+ style={style.closeIcon}
35
+ >
31
36
  <Ionicons name='close-outline' size={24} color={Colors.darkblue} />
32
37
  </TouchableOpacity>
33
38
 
@@ -37,7 +42,7 @@ const ImageViewer = ({ source, style: imageStyle, ...props }) => {
37
42
  onLoadEnd={() => setLoading(false)}
38
43
  />
39
44
 
40
- { loading && <ActivityIndicator style={style.activityIndicator}/> }
45
+ {loading && <ActivityIndicator style={style.activityIndicator} />}
41
46
  </View>
42
47
  </Modal>
43
48
  </>
@@ -46,12 +51,12 @@ const ImageViewer = ({ source, style: imageStyle, ...props }) => {
46
51
 
47
52
  ImageViewer.defaultProps = {
48
53
  source: null,
49
- style: {}
54
+ style: {},
50
55
  };
51
56
 
52
57
  ImageViewer.propTypes = {
53
- source: ImagePropTypes.source.isRequired,
54
- style: ImagePropTypes.style
58
+ source: PropTypes.any.isRequired,
59
+ style: PropTypes.any,
55
60
  };
56
61
 
57
62
  export default ImageViewer;
@@ -9,7 +9,7 @@ export default {
9
9
  flex: 1,
10
10
  justifyContent: 'center',
11
11
  alignItems: 'center',
12
- position: 'relative'
12
+ position: 'relative',
13
13
  },
14
14
  closeIcon: {
15
15
  position: 'absolute',
@@ -21,17 +21,17 @@ export default {
21
21
  borderRadius: 15,
22
22
  backgroundColor: Colors.lightblue,
23
23
  alignItems: 'center',
24
- justifyContent: 'center'
24
+ justifyContent: 'center',
25
25
  },
26
26
  body: {
27
27
  width,
28
28
  height,
29
29
  alignSelf: 'center',
30
- position: 'relative'
30
+ position: 'relative',
31
31
  },
32
32
  activityIndicator: {
33
- top: (height / 2) - 100,
34
- left: (width / 2) - 20,
35
- position: 'absolute'
36
- }
33
+ top: height / 2 - 100,
34
+ left: width / 2 - 20,
35
+ position: 'absolute',
36
+ },
37
37
  };
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { TouchableOpacity, View } from 'react-native';
4
- import { ImagePropTypes } from 'deprecated-react-native-prop-types';
5
4
  import Text from '../Text';
6
5
  import ImageResponsive from '../ImageResponsive';
7
6
  import { Colors } from '../../configs/constants';
@@ -71,7 +70,7 @@ Notification.propTypes = {
71
70
  first: PropTypes.bool,
72
71
  active: PropTypes.bool,
73
72
  hideAvatar: PropTypes.bool,
74
- avatar: ImagePropTypes.source,
73
+ avatar: PropTypes.any,
75
74
  title: PropTypes.string,
76
75
  description: PropTypes.string,
77
76
  date: PropTypes.instanceOf(moment),
@@ -13,35 +13,32 @@ export const ConfirmPictureModal = ({
13
13
  image,
14
14
  repeatPictureText,
15
15
  usePictureText,
16
- }) => {
17
- return (
18
- <Modal
19
- animationType='slide'
20
- transparent={false}
21
- visible={visible}
22
- onRequestClose={() => {}}
23
- >
24
- <View style={style.cameraTakenImageContainer}>
25
- <ImageResponsive
26
- source={{
27
- uri: image ? image.uri : null,
28
- cache: 'only-if-cached',
29
- }}
30
- style={avatar ? style.cameraTakenImage : style.cameraContainer}
31
- />
16
+ }) => (
17
+ <Modal
18
+ animationType='slide'
19
+ transparent={false}
20
+ visible={visible}
21
+ onRequestClose={() => {}}
22
+ >
23
+ <View style={style.cameraTakenImageContainer}>
24
+ <ImageResponsive
25
+ source={{
26
+ uri: image ? image.uri : null,
27
+ }}
28
+ style={avatar ? style.cameraTakenImage : style.cameraContainer}
29
+ />
32
30
 
33
- <View style={style.cameraRetakePhoto}>
34
- <TouchableOpacity onPress={onRepeatPhoto}>
35
- <Text style={style.cameraRetakePhotoText}>{repeatPictureText}</Text>
36
- </TouchableOpacity>
37
- <TouchableOpacity onPress={onUsePhoto}>
38
- <Text style={style.cameraRetakePhotoText}>{usePictureText}</Text>
39
- </TouchableOpacity>
40
- </View>
31
+ <View style={style.cameraRetakePhoto}>
32
+ <TouchableOpacity onPress={onRepeatPhoto}>
33
+ <Text style={style.cameraRetakePhotoText}>{repeatPictureText}</Text>
34
+ </TouchableOpacity>
35
+ <TouchableOpacity onPress={onUsePhoto}>
36
+ <Text style={style.cameraRetakePhotoText}>{usePictureText}</Text>
37
+ </TouchableOpacity>
41
38
  </View>
42
- </Modal>
43
- );
44
- };
39
+ </View>
40
+ </Modal>
41
+ );
45
42
 
46
43
  ConfirmPictureModal.defaultProps = {
47
44
  visible: false,
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { Text as RNText } from 'react-native';
4
- import { TextPropTypes } from 'deprecated-react-native-prop-types';
5
4
  import style from './style';
6
5
 
7
6
  const Text = ({
@@ -69,7 +68,7 @@ Text.propTypes = {
69
68
  ]),
70
69
  weight: PropTypes.oneOf(['regular', 'bold', 'semiBold']),
71
70
  align: PropTypes.oneOf(['left', 'right', 'center', 'justify']),
72
- style: TextPropTypes.style,
71
+ style: PropTypes.any,
73
72
  children: PropTypes.node,
74
73
  };
75
74
 
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "main": "lib/index.js",
3
3
  "name": "@holper/react-native-holper-storybook",
4
4
  "description": "A component library for Holper projects",
5
- "version": "0.6.100",
5
+ "version": "0.6.102",
6
6
  "license": "MIT",
7
7
  "files": [
8
8
  "lib",
@@ -30,7 +30,6 @@
30
30
  "@react-native-async-storage/async-storage": "2.1.2",
31
31
  "@react-native-community/datetimepicker": "8.3.0",
32
32
  "@react-native-community/slider": "4.5.6",
33
- "deprecated-react-native-prop-types": "^5.0.0",
34
33
  "expo": "^53.0.10",
35
34
  "expo-asset": "~11.1.5",
36
35
  "expo-camera": "~16.1.7",