File tree Expand file tree Collapse file tree 8 files changed +6665
-3146
lines changed Expand file tree Collapse file tree 8 files changed +6665
-3146
lines changed Original file line number Diff line number Diff line change 9
9
"web" : " expo start --web"
10
10
},
11
11
"dependencies" : {
12
- "@chatwoot/react-native-widget" : " ^0.0.19 " ,
12
+ "@chatwoot/react-native-widget" : " ^0.0.20 " ,
13
13
"@react-native-async-storage/async-storage" : " 1.23.1" ,
14
14
"expo" : " ~51.0.28" ,
15
15
"expo-status-bar" : " ~1.12.1" ,
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import PropTypes from 'prop-types';
5
5
import { storeHelper , findColors } from './utils' ;
6
6
import WebView from './WebView' ;
7
7
import styles from './style' ;
8
- import { COLOR_WHITE } from './constants' ;
8
+ import { COLOR_WHITE } from './constants' ;
9
9
10
10
const propTypes = {
11
11
isModalVisible : PropTypes . bool . isRequired ,
@@ -24,22 +24,14 @@ const propTypes = {
24
24
closeModal : PropTypes . func ,
25
25
} ;
26
26
27
- const defaultProps = {
28
- cwCookie : '' ,
29
- user : { } ,
30
- locale : 'en' ,
31
- colorScheme : 'light' ,
32
- customAttributes : { } ,
33
- } ;
34
-
35
27
const ChatWootWidget = ( {
36
28
isModalVisible,
37
29
baseUrl,
38
30
websiteToken,
39
- user,
40
- locale,
41
- colorScheme,
42
- customAttributes,
31
+ user = { } ,
32
+ locale = 'en' ,
33
+ colorScheme = 'light' ,
34
+ customAttributes = { } ,
43
35
closeModal,
44
36
} ) => {
45
37
const [ cwCookie , setCookie ] = useState ( '' ) ;
@@ -82,7 +74,6 @@ const ChatWootWidget = ({
82
74
) ;
83
75
} ;
84
76
85
- ChatWootWidget . defaultProps = defaultProps ;
86
77
ChatWootWidget . propTypes = propTypes ;
87
78
88
79
export default ChatWootWidget ;
Original file line number Diff line number Diff line change @@ -19,14 +19,6 @@ const propTypes = {
19
19
closeModal : PropTypes . func ,
20
20
} ;
21
21
22
- const defaultProps = {
23
- cwCookie : '' ,
24
- user : { } ,
25
- locale : 'en' ,
26
- customAttributes : { } ,
27
- colorScheme : 'light' ,
28
- } ;
29
-
30
22
const WebViewComponent = ( {
31
23
baseUrl,
32
24
websiteToken,
@@ -113,6 +105,6 @@ const styles = StyleSheet.create({
113
105
flex : 1 ,
114
106
} ,
115
107
} ) ;
116
- WebViewComponent . defaultProps = defaultProps ;
108
+
117
109
WebViewComponent . propTypes = propTypes ;
118
110
export default WebViewComponent ;
Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @chatwoot/react-native-widget" ,
3
- "version" : " 0.0.19 " ,
3
+ "version" : " 0.0.20 " ,
4
4
"description" : " React Native widget for Chatwoot" ,
5
5
"main" : " index.js" ,
6
6
"scripts" : {
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import PropTypes from 'prop-types';
5
5
import { storeHelper , findColors } from './utils' ;
6
6
import WebView from './WebView' ;
7
7
import styles from './style' ;
8
- import { COLOR_WHITE } from './constants' ;
8
+ import { COLOR_WHITE } from './constants' ;
9
9
10
10
const propTypes = {
11
11
isModalVisible : PropTypes . bool . isRequired ,
@@ -24,22 +24,14 @@ const propTypes = {
24
24
closeModal : PropTypes . func ,
25
25
} ;
26
26
27
- const defaultProps = {
28
- cwCookie : '' ,
29
- user : { } ,
30
- locale : 'en' ,
31
- colorScheme : 'light' ,
32
- customAttributes : { } ,
33
- } ;
34
-
35
27
const ChatWootWidget = ( {
36
28
isModalVisible,
37
29
baseUrl,
38
30
websiteToken,
39
- user,
40
- locale,
41
- colorScheme,
42
- customAttributes,
31
+ user = { } ,
32
+ locale = 'en' ,
33
+ colorScheme = 'light' ,
34
+ customAttributes = { } ,
43
35
closeModal,
44
36
} ) => {
45
37
const [ cwCookie , setCookie ] = useState ( '' ) ;
@@ -82,7 +74,6 @@ const ChatWootWidget = ({
82
74
) ;
83
75
} ;
84
76
85
- ChatWootWidget . defaultProps = defaultProps ;
86
77
ChatWootWidget . propTypes = propTypes ;
87
78
88
79
export default ChatWootWidget ;
Original file line number Diff line number Diff line change @@ -19,22 +19,14 @@ const propTypes = {
19
19
closeModal : PropTypes . func ,
20
20
} ;
21
21
22
- const defaultProps = {
23
- cwCookie : '' ,
24
- user : { } ,
25
- locale : 'en' ,
26
- customAttributes : { } ,
27
- colorScheme : 'light' ,
28
- } ;
29
-
30
22
const WebViewComponent = ( {
31
23
baseUrl,
32
24
websiteToken,
33
- cwCookie,
34
- locale,
35
- colorScheme,
36
- user,
37
- customAttributes,
25
+ cwCookie = '' ,
26
+ locale = 'en' ,
27
+ colorScheme = 'light' ,
28
+ user = { } ,
29
+ customAttributes = { } ,
38
30
closeModal,
39
31
} ) => {
40
32
const [ currentUrl , setCurrentUrl ] = React . useState ( null ) ;
@@ -113,6 +105,5 @@ const styles = StyleSheet.create({
113
105
flex : 1 ,
114
106
} ,
115
107
} ) ;
116
- WebViewComponent . defaultProps = defaultProps ;
117
108
WebViewComponent . propTypes = propTypes ;
118
109
export default WebViewComponent ;
You can’t perform that action at this time.
0 commit comments