dhre-ui-kit 0.0.14 → 0.0.16

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dhre-ui-kit",
3
- "version": "0.0.14",
3
+ "version": "0.0.16",
4
4
  "main": "src/index.ts",
5
5
  "files": [
6
6
  "src",
@@ -0,0 +1,91 @@
1
+ import React, {ReactElement} from 'react';
2
+ import {TouchableOpacity, View, StyleSheet, ViewStyle} from 'react-native';
3
+ import {SvgProps} from 'react-native-svg';
4
+ import CustomText from '../customText';
5
+ import {withThemeProvider} from '../../theme/withThemeProvider';
6
+ import {useTheme} from '../../theme/ThemeContext';
7
+
8
+ interface OurOfficesButtonProps {
9
+ leftIcon?: ReactElement<SvgProps>;
10
+ rightIcon?: ReactElement<SvgProps>;
11
+ onPress: () => void;
12
+ title: string;
13
+ description: string;
14
+ containerStyle?: ViewStyle;
15
+ titleVariant?: string;
16
+ descriptionVariant?: string;
17
+ titleColor?: string;
18
+ descriptionColor?: string;
19
+ }
20
+
21
+ const OurOfficesButton = ({
22
+ leftIcon,
23
+ rightIcon,
24
+ onPress,
25
+ title,
26
+ description,
27
+ containerStyle,
28
+ titleVariant = 'L1_REGULAR',
29
+ descriptionVariant = 'L1_REGULAR',
30
+ titleColor = 'CONTENT_PRIMARY',
31
+ descriptionColor = 'CONTENT_SECONDARY',
32
+ }: OurOfficesButtonProps) => {
33
+ const {theme} = useTheme();
34
+ return (
35
+ <TouchableOpacity
36
+ style={[
37
+ styles.button,
38
+ {backgroundColor: theme['SURFACE_SECONDARY']},
39
+ containerStyle,
40
+ ]}
41
+ onPress={onPress}>
42
+ {leftIcon && (
43
+ <View style={styles.iconContainer}>{React.cloneElement(leftIcon)}</View>
44
+ )}
45
+ <View style={styles.textContainer}>
46
+ <CustomText
47
+ text={title}
48
+ variant={titleVariant}
49
+ textColor={titleColor}
50
+ style={styles.textView}
51
+ />
52
+ <CustomText
53
+ text={description}
54
+ variant={descriptionVariant}
55
+ textColor={descriptionColor}
56
+ style={styles.flexWrap}
57
+ />
58
+ </View>
59
+ {rightIcon && (
60
+ <View style={styles.rightIconContainer}>
61
+ {React.cloneElement(rightIcon)}
62
+ </View>
63
+ )}
64
+ </TouchableOpacity>
65
+ );
66
+ };
67
+
68
+ const styles = StyleSheet.create({
69
+ button: {
70
+ flexDirection: 'row',
71
+ alignItems: 'center',
72
+ borderRadius: 10,
73
+ },
74
+ iconContainer: {
75
+ marginHorizontal: 16,
76
+ },
77
+ textContainer: {
78
+ flex: 1,
79
+ padding: 10,
80
+ borderRadius: 4,
81
+ },
82
+ rightIconContainer: {
83
+ marginLeft: 10,
84
+ position: 'absolute',
85
+ right: 10,
86
+ },
87
+ textView: {marginBottom: 4},
88
+ flexWrap: {flexWrap: 'wrap'},
89
+ });
90
+
91
+ export default withThemeProvider(OurOfficesButton);
@@ -0,0 +1 @@
1
+ export {default} from './OurOffices';
@@ -49,7 +49,7 @@ const CustomButton = ({
49
49
  <CustomText
50
50
  text={title}
51
51
  variant={titleVariant}
52
- style={[textStyle, {color: '#A7A7A7'}]}
52
+ style={[{color: '#A7A7A7'}, textStyle]}
53
53
  textColor={titleColor}
54
54
  />
55
55
 
package/src/index.ts CHANGED
@@ -28,5 +28,6 @@ export {default as CustomLoader} from './components/customLoader';
28
28
  export {default as Line} from './components/horizontalLine';
29
29
  export {default as Topic} from './components/topic';
30
30
  export {default as ContactModel} from './components/ContactModel';
31
+ export {default as OurOfficesButton} from './components/OutOfOffice';
31
32
 
32
33
  export * from './utils/stylehelper';