@holper/react-native-holper-storybook 0.6.8 → 0.6.11

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/index.js CHANGED
@@ -1,3 +1,3 @@
1
- export { asyncLoadFont } from './configs/loadFonts';
2
- export { Colors, MapStyle, ConstantsWS, HiringStatus, NotificationsTypes } from './configs/constants';
1
+ export {asyncLoadFont} from './configs/loadFonts';
2
+ export {Colors, MapStyle, ConstantsWS, HiringStatus, CouponStatus, NotificationsTypes} from './configs/constants';
3
3
  export * from './components';
@@ -1,24 +1,24 @@
1
- import React, { useRef, useState } from 'react';
1
+ import React, {useRef, useState} from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { View, Image } from 'react-native';
3
+ import {View, Image} from 'react-native';
4
4
  import Swiper from 'react-native-deck-swiper';
5
5
  import Entypo from 'react-native-vector-icons/Entypo';
6
6
  import Text from '../Text';
7
7
  import Button from '../Button';
8
- import { Colors } from '../../configs/constants';
8
+ import {Colors} from '../../configs/constants';
9
9
  import style from './style';
10
10
 
11
- const DeckSwiper = ({ data, inverted, nextText, onChange, onFinish }) => {
11
+ const DeckSwiper = ({data, inverted, nextText, onChange, onFinish}) => {
12
12
  const swiper = useRef(null);
13
13
  const [finished, setFinished] = useState(false);
14
14
  const [index, setIndex] = useState(0);
15
15
 
16
16
  const renderDots = () => (
17
- data.map((d,i) => <Entypo
17
+ data.map((d, i) => <Entypo
18
18
  name='dot-single'
19
19
  size={36}
20
20
  key={`dot-${i}`}
21
- style={style[index === i ? 'dotSelected': 'dot']}
21
+ style={style[index === i ? 'dotSelected' : 'dot']}
22
22
  />)
23
23
  );
24
24
 
@@ -28,7 +28,7 @@ const DeckSwiper = ({ data, inverted, nextText, onChange, onFinish }) => {
28
28
  ref={swiper}
29
29
  cards={data}
30
30
  renderCard={(card) => {
31
- if(!card) {
31
+ if (!card) {
32
32
  return null;
33
33
  }
34
34
  return (
@@ -42,23 +42,23 @@ const DeckSwiper = ({ data, inverted, nextText, onChange, onFinish }) => {
42
42
  />
43
43
  </View>
44
44
  <View style={style.textContainer}>
45
- <Text size='large' style={style.title}>{card.title}</Text>
46
- <Text align='center'>{card.description}</Text>
45
+ <Text size='extra-large' style={style.title}>{card.title}</Text>
46
+ <Text size='large' align='center'>{card.description}</Text>
47
47
  </View>
48
48
  </View>
49
- )
49
+ );
50
50
  }}
51
51
  onSwipedAll={() => {
52
52
  setFinished(true);
53
53
  onFinish();
54
54
  }}
55
55
  onSwipedRight={index => {
56
- setIndex(index-1);
57
- onChange(index-1);
56
+ setIndex(index - 1);
57
+ onChange(index - 1);
58
58
  }}
59
59
  onSwipedLeft={index => {
60
- setIndex(index+1);
61
- onChange(index+1);
60
+ setIndex(index + 1);
61
+ onChange(index + 1);
62
62
  }}
63
63
  cardIndex={index}
64
64
  backgroundColor={Colors.white}
@@ -69,18 +69,18 @@ const DeckSwiper = ({ data, inverted, nextText, onChange, onFinish }) => {
69
69
  goBackToPreviousCardOnSwipeRight={true}
70
70
  childrenOnTop
71
71
  >
72
- {!finished && (
73
- <>
74
- <View style={style.dotsContainer}>
75
- {renderDots()}
76
- </View>
77
- <View style={style.container}>
78
- <Button variant={inverted ? 'inverted' : 'primary'} onPress={() => swiper.current.swipeLeft()}>
79
- <Text color='white'>{nextText}</Text>
80
- </Button>
81
- </View>
82
- </>
83
- )}
72
+ {!finished && (
73
+ <>
74
+ <View style={style.dotsContainer}>
75
+ {renderDots()}
76
+ </View>
77
+ <View style={style.container}>
78
+ <Button variant={inverted ? 'inverted' : 'primary'} onPress={() => swiper.current.swipeLeft()}>
79
+ <Text color='white'>{nextText}</Text>
80
+ </Button>
81
+ </View>
82
+ </>
83
+ )}
84
84
  </Swiper>
85
85
  </>
86
86
  );
@@ -90,8 +90,10 @@ DeckSwiper.defaultProps = {
90
90
  data: [],
91
91
  inverted: false,
92
92
  nextText: ' ',
93
- onChange: () => {},
94
- onfinish: () => {}
93
+ onChange: () => {
94
+ },
95
+ onfinish: () => {
96
+ }
95
97
  };
96
98
 
97
99
  DeckSwiper.propTypes = {
@@ -104,6 +106,6 @@ DeckSwiper.propTypes = {
104
106
  nextText: PropTypes.string,
105
107
  onChange: PropTypes.func,
106
108
  onFinish: PropTypes.func
107
- }
109
+ };
108
110
 
109
111
  export default DeckSwiper;
@@ -1,7 +1,7 @@
1
- import { Dimensions } from 'react-native';
2
- import { Colors } from '../../configs/constants';
1
+ import {Dimensions} from 'react-native';
2
+ import {Colors} from '../../configs/constants';
3
3
 
4
- const { height, width } = Dimensions.get('window');
4
+ const {height, width} = Dimensions.get('window');
5
5
 
6
6
  export default {
7
7
  container: {
@@ -22,8 +22,8 @@ export default {
22
22
  alignItems: 'center',
23
23
  },
24
24
  imageContainer: {
25
- width: width - 100,
26
- height: height / 2.5,
25
+ width: width - 90,
26
+ height: height / 2.3,
27
27
  },
28
28
  imageResponsive: {
29
29
  height: undefined,
@@ -33,7 +33,7 @@ Text.defaultProps = {
33
33
  Text.propTypes = {
34
34
  color: PropTypes.oneOf(['dark', 'light', 'lighter', 'white', 'green', 'red', 'yellow', 'violet']),
35
35
  variant: PropTypes.oneOf(['default', 'lowercase', 'uppercase']),
36
- size: PropTypes.oneOf(['tiny', 'small', 'medium', 'large', 'extra-large']),
36
+ size: PropTypes.oneOf(['tiny', 'small', 'medium', 'large', 'extra-large', 'huge']),
37
37
  weight: PropTypes.oneOf(['regular', 'bold', 'semiBold']),
38
38
  align: PropTypes.oneOf(['left', 'right', 'center', 'justify']),
39
39
  style: RNText.propTypes.style,
@@ -49,6 +49,9 @@ export default {
49
49
  'extra-large': {
50
50
  fontSize: 24
51
51
  },
52
+ huge: {
53
+ fontSize: 40
54
+ },
52
55
  // Weights
53
56
  regular: {
54
57
  fontFamily: 'poppins_regular'
@@ -48,6 +48,13 @@ export const HiringStatus = Object.freeze({
48
48
  UNPAID: 'unpaid'
49
49
  });
50
50
 
51
+ export const CouponStatus = Object.freeze({
52
+ PENDING: 'pending',
53
+ IN_USE: 'inUse',
54
+ EXPIRED: 'expired',
55
+ DONE: 'DONE'
56
+ });
57
+
51
58
  export const NotificationsTypes = Object.freeze({
52
59
  /** New hiring is created */
53
60
  NEW_HIRING: 'newHiring',
package/lib/index.js CHANGED
@@ -1,3 +1,3 @@
1
- export { asyncLoadFont } from './configs/loadFonts';
2
- export { Colors, MapStyle, ConstantsWS, HiringStatus, NotificationsTypes } from './configs/constants';
1
+ export {asyncLoadFont} from './configs/loadFonts';
2
+ export {Colors, MapStyle, ConstantsWS, HiringStatus, CouponStatus, NotificationsTypes} from './configs/constants';
3
3
  export * from './components';
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.8",
5
+ "version": "0.6.11",
6
6
  "license": "MIT",
7
7
  "files": [
8
8
  "lib",