@plusscommunities/pluss-webview-app 1.3.0 → 1.3.1
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/dist/module/components/WidgetLarge.js +83 -3
- package/dist/module/components/WidgetLarge.js.map +1 -1
- package/dist/module/components/WidgetSmall.js +83 -3
- package/dist/module/components/WidgetSmall.js.map +1 -1
- package/dist/module/core.config.js +17 -0
- package/dist/module/core.config.js.map +1 -0
- package/dist/module/feature.config.js +9 -1
- package/dist/module/feature.config.js.map +1 -1
- package/dist/module/index.js +3 -1
- package/dist/module/index.js.map +1 -1
- package/dist/module/screens/WebViewPage.js +58 -0
- package/dist/module/screens/WebViewPage.js.map +1 -0
- package/package.json +3 -1
- package/src/components/WidgetLarge.js +69 -3
- package/src/components/WidgetSmall.js +69 -3
- package/src/core.config.js +5 -0
- package/src/feature.config.js +11 -1
- package/src/index.js +2 -1
- package/src/screens/WebViewPage.js +42 -0
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
2
|
|
|
3
3
|
import React, { Component } from 'react';
|
|
4
|
-
import { View, StyleSheet } from 'react-native';
|
|
4
|
+
import { View, Text, StyleSheet } from 'react-native';
|
|
5
5
|
import { WebView } from 'react-native-webview';
|
|
6
|
+
import { connect } from 'react-redux';
|
|
7
|
+
import _ from 'lodash';
|
|
8
|
+
import { Colours, Components } from '../core.config';
|
|
9
|
+
import { Services } from '../feature.config';
|
|
6
10
|
|
|
7
11
|
class WidgetLarge extends Component {
|
|
8
12
|
constructor(props) {
|
|
@@ -12,13 +16,57 @@ class WidgetLarge extends Component {
|
|
|
12
16
|
|
|
13
17
|
_defineProperty(this, "onLoadEnd", () => {});
|
|
14
18
|
|
|
19
|
+
_defineProperty(this, "onGoToFullpage", () => {
|
|
20
|
+
const {
|
|
21
|
+
options
|
|
22
|
+
} = this.props;
|
|
23
|
+
Services.navigation.navigate('webViewPage', {
|
|
24
|
+
url: options['webUrl'],
|
|
25
|
+
headerTitle: this.getTitle()
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
_defineProperty(this, "getTitle", () => {
|
|
30
|
+
const {
|
|
31
|
+
options
|
|
32
|
+
} = this.props;
|
|
33
|
+
if (options && !_.isEmpty(options.Title)) return options.Title;
|
|
34
|
+
return 'Web View';
|
|
35
|
+
});
|
|
36
|
+
|
|
15
37
|
this.state = {};
|
|
16
38
|
}
|
|
17
39
|
|
|
18
40
|
render() {
|
|
19
41
|
const {
|
|
20
|
-
options
|
|
42
|
+
options,
|
|
43
|
+
colourBrandingMain
|
|
21
44
|
} = this.props;
|
|
45
|
+
|
|
46
|
+
if (options.isWebViewSeparatePage) {
|
|
47
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
48
|
+
style: styles.sectionContainer
|
|
49
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
50
|
+
style: styles.sectionPadding
|
|
51
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
52
|
+
style: styles.sectionHeading
|
|
53
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
54
|
+
style: styles.sectionTitle
|
|
55
|
+
}, this.getTitle()))), /*#__PURE__*/React.createElement(View, {
|
|
56
|
+
style: styles.buttonContainer
|
|
57
|
+
}, /*#__PURE__*/React.createElement(Components.InlineButton, {
|
|
58
|
+
onPress: this.onGoToFullpage,
|
|
59
|
+
color: colourBrandingMain,
|
|
60
|
+
touchableStyle: {
|
|
61
|
+
paddingTop: 6
|
|
62
|
+
},
|
|
63
|
+
textStyle: {
|
|
64
|
+
color: '#fff'
|
|
65
|
+
},
|
|
66
|
+
large: true
|
|
67
|
+
}, options.buttonText)));
|
|
68
|
+
}
|
|
69
|
+
|
|
22
70
|
return /*#__PURE__*/React.createElement(View, {
|
|
23
71
|
style: styles.container
|
|
24
72
|
}, this.props.ListHeaderComponent, /*#__PURE__*/React.createElement(WebView, {
|
|
@@ -41,7 +89,39 @@ const styles = StyleSheet.create({
|
|
|
41
89
|
flex: 1,
|
|
42
90
|
alignItems: 'center',
|
|
43
91
|
justifyContent: 'center'
|
|
92
|
+
},
|
|
93
|
+
sectionContainer: {
|
|
94
|
+
backgroundColor: '#fff',
|
|
95
|
+
paddingTop: 16
|
|
96
|
+
},
|
|
97
|
+
sectionPadding: {
|
|
98
|
+
paddingHorizontal: 16,
|
|
99
|
+
paddingBottom: 6
|
|
100
|
+
},
|
|
101
|
+
sectionHeading: {
|
|
102
|
+
marginBottom: 4,
|
|
103
|
+
flexDirection: 'row',
|
|
104
|
+
alignContent: 'flex-start',
|
|
105
|
+
justifyContent: 'space-between'
|
|
106
|
+
},
|
|
107
|
+
sectionTitle: {
|
|
108
|
+
fontFamily: 'sf-bold',
|
|
109
|
+
fontSize: 24,
|
|
110
|
+
color: Colours.TEXT_DARKEST
|
|
111
|
+
},
|
|
112
|
+
buttonContainer: {
|
|
113
|
+
alignItems: 'center',
|
|
114
|
+
justifyContent: 'center'
|
|
44
115
|
}
|
|
45
116
|
});
|
|
46
|
-
|
|
117
|
+
|
|
118
|
+
const mapStateToProps = state => {
|
|
119
|
+
return {
|
|
120
|
+
colourBrandingMain: Colours.getMainBrandingColourFromState(state)
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
export default connect(mapStateToProps, {}, null, {
|
|
125
|
+
forwardRef: true
|
|
126
|
+
})(WidgetLarge);
|
|
47
127
|
//# sourceMappingURL=WidgetLarge.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Component","View","StyleSheet","WebView","WidgetLarge","constructor","props","state","render","
|
|
1
|
+
{"version":3,"names":["React","Component","View","Text","StyleSheet","WebView","connect","_","Colours","Components","Services","WidgetLarge","constructor","props","options","navigation","navigate","url","headerTitle","getTitle","isEmpty","Title","state","render","colourBrandingMain","isWebViewSeparatePage","styles","sectionContainer","sectionPadding","sectionHeading","sectionTitle","buttonContainer","onGoToFullpage","paddingTop","color","buttonText","container","ListHeaderComponent","uri","webContainer","onLoadStart","onLoadEnd","create","flex","alignItems","justifyContent","backgroundColor","paddingHorizontal","paddingBottom","marginBottom","flexDirection","alignContent","fontFamily","fontSize","TEXT_DARKEST","mapStateToProps","getMainBrandingColourFromState","forwardRef"],"sources":["WidgetLarge.js"],"sourcesContent":["import React, { Component } from 'react';\nimport { View, Text, StyleSheet } from 'react-native';\nimport { WebView } from 'react-native-webview';\nimport { connect } from 'react-redux';\nimport _ from 'lodash';\nimport { Colours, Components } from '../core.config';\nimport { Services } from '../feature.config';\n\nclass WidgetLarge extends Component {\n constructor(props) {\n super(props);\n this.state = {};\n }\n\n onLoadStart = () => {};\n onLoadEnd = () => {};\n\n onGoToFullpage = () => {\n const { options } = this.props;\n Services.navigation.navigate('webViewPage', { url: options['webUrl'], headerTitle: this.getTitle() });\n };\n\n getTitle = () => {\n const { options } = this.props;\n if (options && !_.isEmpty(options.Title)) return options.Title;\n return 'Web View';\n };\n\n render() {\n const { options, colourBrandingMain } = this.props;\n if (options.isWebViewSeparatePage) {\n return (\n <View style={styles.sectionContainer}>\n <View style={styles.sectionPadding}>\n <View style={styles.sectionHeading}>\n <Text style={styles.sectionTitle}>{this.getTitle()}</Text>\n </View>\n </View>\n <View style={styles.buttonContainer}>\n <Components.InlineButton\n onPress={this.onGoToFullpage}\n color={colourBrandingMain}\n touchableStyle={{ paddingTop: 6 }}\n textStyle={{ color: '#fff' }}\n large\n >\n {options.buttonText}\n </Components.InlineButton>\n </View>\n </View>\n );\n }\n return (\n <View style={styles.container}>\n {this.props.ListHeaderComponent}\n <WebView\n source={{ uri: options['webUrl'] }}\n style={styles.webContainer}\n onLoadStart={this.onLoadStart}\n onLoadEnd={this.onLoadEnd}\n />\n </View>\n );\n }\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n webContainer: {\n flex: 1,\n alignItems: 'center',\n justifyContent: 'center',\n },\n sectionContainer: {\n backgroundColor: '#fff',\n paddingTop: 16,\n },\n sectionPadding: {\n paddingHorizontal: 16,\n paddingBottom: 6,\n },\n sectionHeading: {\n marginBottom: 4,\n flexDirection: 'row',\n alignContent: 'flex-start',\n justifyContent: 'space-between',\n },\n sectionTitle: {\n fontFamily: 'sf-bold',\n fontSize: 24,\n color: Colours.TEXT_DARKEST,\n },\n buttonContainer: {\n alignItems: 'center',\n justifyContent: 'center',\n },\n});\n\nconst mapStateToProps = state => {\n return {\n colourBrandingMain: Colours.getMainBrandingColourFromState(state),\n };\n};\n\nexport default connect(mapStateToProps, {}, null, { forwardRef: true })(WidgetLarge);\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAgBC,SAAhB,QAAiC,OAAjC;AACA,SAASC,IAAT,EAAeC,IAAf,EAAqBC,UAArB,QAAuC,cAAvC;AACA,SAASC,OAAT,QAAwB,sBAAxB;AACA,SAASC,OAAT,QAAwB,aAAxB;AACA,OAAOC,CAAP,MAAc,QAAd;AACA,SAASC,OAAT,EAAkBC,UAAlB,QAAoC,gBAApC;AACA,SAASC,QAAT,QAAyB,mBAAzB;;AAEA,MAAMC,WAAN,SAA0BV,SAA1B,CAAoC;EAClCW,WAAW,CAACC,KAAD,EAAQ;IACjB,MAAMA,KAAN;;IADiB,qCAKL,MAAM,CAAE,CALH;;IAAA,mCAMP,MAAM,CAAE,CAND;;IAAA,wCAQF,MAAM;MACrB,MAAM;QAAEC;MAAF,IAAc,KAAKD,KAAzB;MACAH,QAAQ,CAACK,UAAT,CAAoBC,QAApB,CAA6B,aAA7B,EAA4C;QAAEC,GAAG,EAAEH,OAAO,CAAC,QAAD,CAAd;QAA0BI,WAAW,EAAE,KAAKC,QAAL;MAAvC,CAA5C;IACD,CAXkB;;IAAA,kCAaR,MAAM;MACf,MAAM;QAAEL;MAAF,IAAc,KAAKD,KAAzB;MACA,IAAIC,OAAO,IAAI,CAACP,CAAC,CAACa,OAAF,CAAUN,OAAO,CAAC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,CADoB;EAI/BJ,YAAY,EAAE;IACZI,IAAI,EAAE,CADM;IAEZC,UAAU,EAAE,QAFA;IAGZC,cAAc,EAAE;EAHJ,CAJiB;EAS/BlB,gBAAgB,EAAE;IAChBmB,eAAe,EAAE,MADD;IAEhBb,UAAU,EAAE;EAFI,CATa;EAa/BL,cAAc,EAAE;IACdmB,iBAAiB,EAAE,EADL;IAEdC,aAAa,EAAE;EAFD,CAbe;EAiB/BnB,cAAc,EAAE;IACdoB,YAAY,EAAE,CADA;IAEdC,aAAa,EAAE,KAFD;IAGdC,YAAY,EAAE,YAHA;IAIdN,cAAc,EAAE;EAJF,CAjBe;EAuB/Bf,YAAY,EAAE;IACZsB,UAAU,EAAE,SADA;IAEZC,QAAQ,EAAE,EAFE;IAGZnB,KAAK,EAAE1B,OAAO,CAAC8C;EAHH,CAvBiB;EA4B/BvB,eAAe,EAAE;IACfa,UAAU,EAAE,QADG;IAEfC,cAAc,EAAE;EAFD;AA5Bc,CAAlB,CAAf;;AAkCA,MAAMU,eAAe,GAAGjC,KAAK,IAAI;EAC/B,OAAO;IACLE,kBAAkB,EAAEhB,OAAO,CAACgD,8BAAR,CAAuClC,KAAvC;EADf,CAAP;AAGD,CAJD;;AAMA,eAAehB,OAAO,CAACiD,eAAD,EAAkB,EAAlB,EAAsB,IAAtB,EAA4B;EAAEE,UAAU,EAAE;AAAd,CAA5B,CAAP,CAAyD9C,WAAzD,CAAf"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
2
|
|
|
3
3
|
import React, { Component } from 'react';
|
|
4
|
-
import { View, StyleSheet } from 'react-native';
|
|
4
|
+
import { View, Text, StyleSheet } from 'react-native';
|
|
5
5
|
import { WebView } from 'react-native-webview';
|
|
6
|
+
import { connect } from 'react-redux';
|
|
7
|
+
import _ from 'lodash';
|
|
8
|
+
import { Colours, Components } from '../core.config';
|
|
9
|
+
import { Services } from '../feature.config';
|
|
6
10
|
|
|
7
11
|
class WidgetSmall extends Component {
|
|
8
12
|
constructor(props) {
|
|
@@ -12,13 +16,57 @@ class WidgetSmall extends Component {
|
|
|
12
16
|
|
|
13
17
|
_defineProperty(this, "onLoadEnd", () => {});
|
|
14
18
|
|
|
19
|
+
_defineProperty(this, "onGoToFullpage", () => {
|
|
20
|
+
const {
|
|
21
|
+
options
|
|
22
|
+
} = this.props;
|
|
23
|
+
Services.navigation.navigate('webViewPage', {
|
|
24
|
+
url: options['webUrl'],
|
|
25
|
+
headerTitle: this.getTitle()
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
_defineProperty(this, "getTitle", () => {
|
|
30
|
+
const {
|
|
31
|
+
options
|
|
32
|
+
} = this.props;
|
|
33
|
+
if (options && !_.isEmpty(options.Title)) return options.Title;
|
|
34
|
+
return 'Web View';
|
|
35
|
+
});
|
|
36
|
+
|
|
15
37
|
this.state = {};
|
|
16
38
|
}
|
|
17
39
|
|
|
18
40
|
render() {
|
|
19
41
|
const {
|
|
20
|
-
options
|
|
42
|
+
options,
|
|
43
|
+
colourBrandingMain
|
|
21
44
|
} = this.props;
|
|
45
|
+
|
|
46
|
+
if (options.isWebViewSeparatePage) {
|
|
47
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
48
|
+
style: styles.sectionContainer
|
|
49
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
50
|
+
style: styles.sectionPadding
|
|
51
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
52
|
+
style: styles.sectionHeading
|
|
53
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
54
|
+
style: styles.sectionTitle
|
|
55
|
+
}, this.getTitle()))), /*#__PURE__*/React.createElement(View, {
|
|
56
|
+
style: styles.buttonContainer
|
|
57
|
+
}, /*#__PURE__*/React.createElement(Components.InlineButton, {
|
|
58
|
+
onPress: this.onGoToFullpage,
|
|
59
|
+
color: colourBrandingMain,
|
|
60
|
+
touchableStyle: {
|
|
61
|
+
paddingTop: 6
|
|
62
|
+
},
|
|
63
|
+
textStyle: {
|
|
64
|
+
color: '#fff'
|
|
65
|
+
},
|
|
66
|
+
large: true
|
|
67
|
+
}, options.buttonText)));
|
|
68
|
+
}
|
|
69
|
+
|
|
22
70
|
return /*#__PURE__*/React.createElement(View, {
|
|
23
71
|
style: styles.container
|
|
24
72
|
}, /*#__PURE__*/React.createElement(WebView, {
|
|
@@ -43,7 +91,39 @@ const styles = StyleSheet.create({
|
|
|
43
91
|
flex: 1,
|
|
44
92
|
alignItems: 'center',
|
|
45
93
|
justifyContent: 'center'
|
|
94
|
+
},
|
|
95
|
+
sectionContainer: {
|
|
96
|
+
backgroundColor: '#fff',
|
|
97
|
+
paddingTop: 16
|
|
98
|
+
},
|
|
99
|
+
sectionPadding: {
|
|
100
|
+
paddingHorizontal: 16,
|
|
101
|
+
paddingBottom: 6
|
|
102
|
+
},
|
|
103
|
+
sectionHeading: {
|
|
104
|
+
marginBottom: 4,
|
|
105
|
+
flexDirection: 'row',
|
|
106
|
+
alignContent: 'flex-start',
|
|
107
|
+
justifyContent: 'space-between'
|
|
108
|
+
},
|
|
109
|
+
sectionTitle: {
|
|
110
|
+
fontFamily: 'sf-bold',
|
|
111
|
+
fontSize: 24,
|
|
112
|
+
color: Colours.TEXT_DARKEST
|
|
113
|
+
},
|
|
114
|
+
buttonContainer: {
|
|
115
|
+
alignItems: 'center',
|
|
116
|
+
justifyContent: 'center'
|
|
46
117
|
}
|
|
47
118
|
});
|
|
48
|
-
|
|
119
|
+
|
|
120
|
+
const mapStateToProps = state => {
|
|
121
|
+
return {
|
|
122
|
+
colourBrandingMain: Colours.getMainBrandingColourFromState(state)
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
export default connect(mapStateToProps, {}, null, {
|
|
127
|
+
forwardRef: true
|
|
128
|
+
})(WidgetSmall);
|
|
49
129
|
//# sourceMappingURL=WidgetSmall.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Component","View","StyleSheet","WebView","WidgetSmall","constructor","props","state","render","
|
|
1
|
+
{"version":3,"names":["React","Component","View","Text","StyleSheet","WebView","connect","_","Colours","Components","Services","WidgetSmall","constructor","props","options","navigation","navigate","url","headerTitle","getTitle","isEmpty","Title","state","render","colourBrandingMain","isWebViewSeparatePage","styles","sectionContainer","sectionPadding","sectionHeading","sectionTitle","buttonContainer","onGoToFullpage","paddingTop","color","buttonText","container","uri","webContainer","onLoadStart","onLoadEnd","create","height","paddingBottom","flex","alignItems","justifyContent","backgroundColor","paddingHorizontal","marginBottom","flexDirection","alignContent","fontFamily","fontSize","TEXT_DARKEST","mapStateToProps","getMainBrandingColourFromState","forwardRef"],"sources":["WidgetSmall.js"],"sourcesContent":["import React, { Component } from 'react';\nimport { View, Text, StyleSheet } from 'react-native';\nimport { WebView } from 'react-native-webview';\nimport { connect } from 'react-redux';\nimport _ from 'lodash';\nimport { Colours, Components } from '../core.config';\nimport { Services } from '../feature.config';\n\nclass WidgetSmall extends Component {\n constructor(props) {\n super(props);\n this.state = {};\n }\n\n onLoadStart = () => {};\n onLoadEnd = () => {};\n\n onGoToFullpage = () => {\n const { options } = this.props;\n Services.navigation.navigate('webViewPage', { url: options['webUrl'], headerTitle: this.getTitle() });\n };\n\n getTitle = () => {\n const { options } = this.props;\n if (options && !_.isEmpty(options.Title)) return options.Title;\n return 'Web View';\n };\n\n render() {\n const { options, colourBrandingMain } = this.props;\n if (options.isWebViewSeparatePage) {\n return (\n <View style={styles.sectionContainer}>\n <View style={styles.sectionPadding}>\n <View style={styles.sectionHeading}>\n <Text style={styles.sectionTitle}>{this.getTitle()}</Text>\n </View>\n </View>\n <View style={styles.buttonContainer}>\n <Components.InlineButton\n onPress={this.onGoToFullpage}\n color={colourBrandingMain}\n touchableStyle={{ paddingTop: 6 }}\n textStyle={{ color: '#fff' }}\n large\n >\n {options.buttonText}\n </Components.InlineButton>\n </View>\n </View>\n );\n }\n return (\n <View style={styles.container}>\n <WebView\n source={{ uri: options['webUrl'] }}\n style={styles.webContainer}\n onLoadStart={this.onLoadStart}\n onLoadEnd={this.onLoadEnd}\n />\n </View>\n );\n }\n}\n\nconst styles = StyleSheet.create({\n container: {\n height: 300,\n paddingTop: 8,\n paddingBottom: 8,\n },\n webContainer: {\n flex: 1,\n alignItems: 'center',\n justifyContent: 'center',\n },\n sectionContainer: {\n backgroundColor: '#fff',\n paddingTop: 16,\n },\n sectionPadding: {\n paddingHorizontal: 16,\n paddingBottom: 6,\n },\n sectionHeading: {\n marginBottom: 4,\n flexDirection: 'row',\n alignContent: 'flex-start',\n justifyContent: 'space-between',\n },\n sectionTitle: {\n fontFamily: 'sf-bold',\n fontSize: 24,\n color: Colours.TEXT_DARKEST,\n },\n buttonContainer: {\n alignItems: 'center',\n justifyContent: 'center',\n },\n});\n\nconst mapStateToProps = state => {\n return {\n colourBrandingMain: Colours.getMainBrandingColourFromState(state),\n };\n};\n\nexport default connect(mapStateToProps, {}, null, { forwardRef: true })(WidgetSmall);\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAgBC,SAAhB,QAAiC,OAAjC;AACA,SAASC,IAAT,EAAeC,IAAf,EAAqBC,UAArB,QAAuC,cAAvC;AACA,SAASC,OAAT,QAAwB,sBAAxB;AACA,SAASC,OAAT,QAAwB,aAAxB;AACA,OAAOC,CAAP,MAAc,QAAd;AACA,SAASC,OAAT,EAAkBC,UAAlB,QAAoC,gBAApC;AACA,SAASC,QAAT,QAAyB,mBAAzB;;AAEA,MAAMC,WAAN,SAA0BV,SAA1B,CAAoC;EAClCW,WAAW,CAACC,KAAD,EAAQ;IACjB,MAAMA,KAAN;;IADiB,qCAKL,MAAM,CAAE,CALH;;IAAA,mCAMP,MAAM,CAAE,CAND;;IAAA,wCAQF,MAAM;MACrB,MAAM;QAAEC;MAAF,IAAc,KAAKD,KAAzB;MACAH,QAAQ,CAACK,UAAT,C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/src';
|
|
2
|
+
import * as PlussCore from '@plusscommunities/pluss-core-app';
|
|
3
|
+
const {
|
|
4
|
+
Apis,
|
|
5
|
+
Fonts,
|
|
6
|
+
Actions,
|
|
7
|
+
ActionTypes,
|
|
8
|
+
Config,
|
|
9
|
+
Components,
|
|
10
|
+
Styles,
|
|
11
|
+
Session,
|
|
12
|
+
Helper,
|
|
13
|
+
Constants,
|
|
14
|
+
Colours
|
|
15
|
+
} = PlussCore;
|
|
16
|
+
export { Apis, Fonts, Actions, ActionTypes, Config, Components, Styles, Session, Helper, Constants, Colours };
|
|
17
|
+
//# sourceMappingURL=core.config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["PlussCore","Apis","Fonts","Actions","ActionTypes","Config","Components","Styles","Session","Helper","Constants","Colours"],"sources":["core.config.js"],"sourcesContent":["// import * as PlussCore from '../../pluss-core/src';\nimport * as PlussCore from '@plusscommunities/pluss-core-app';\n\nconst { Apis, Fonts, Actions, ActionTypes, Config, Components, Styles, Session, Helper, Constants, Colours } = PlussCore;\nexport { Apis, Fonts, Actions, ActionTypes, Config, Components, Styles, Session, Helper, Constants, Colours };\n"],"mappings":"AAAA;AACA,OAAO,KAAKA,SAAZ,MAA2B,kCAA3B;AAEA,MAAM;EAAEC,IAAF;EAAQC,KAAR;EAAeC,OAAf;EAAwBC,WAAxB;EAAqCC,MAArC;EAA6CC,UAA7C;EAAyDC,MAAzD;EAAiEC,OAAjE;EAA0EC,MAA1E;EAAkFC,SAAlF;EAA6FC;AAA7F,IAAyGX,SAA/G;AACA,SAASC,IAAT,EAAeC,KAAf,EAAsBC,OAAtB,EAA+BC,WAA/B,EAA4CC,MAA5C,EAAoDC,UAApD,EAAgEC,MAAhE,EAAwEC,OAAxE,EAAiFC,MAAjF,EAAyFC,SAAzF,EAAoGC,OAApG"}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
// import * as PlussCore from '../../pluss-core/src';
|
|
2
|
+
import * as PlussCore from '@plusscommunities/pluss-core-app';
|
|
1
3
|
export const Services = {
|
|
2
4
|
navigation: null
|
|
3
5
|
};
|
|
6
|
+
export const BaseComponents = {
|
|
7
|
+
NotificationBell: null
|
|
8
|
+
};
|
|
4
9
|
const FeatureConfig = {
|
|
5
10
|
key: 'web',
|
|
6
11
|
title: 'Web',
|
|
@@ -9,6 +14,7 @@ const FeatureConfig = {
|
|
|
9
14
|
viewBox: '0 0 24 24',
|
|
10
15
|
navigate: 'web'
|
|
11
16
|
},
|
|
17
|
+
hideTabBar: ['webViewPage'],
|
|
12
18
|
env: {
|
|
13
19
|
baseStage: '',
|
|
14
20
|
baseAPIUrl: '',
|
|
@@ -25,7 +31,9 @@ const FeatureConfig = {
|
|
|
25
31
|
newEventDefaults: '',
|
|
26
32
|
defaultAllowComments: true
|
|
27
33
|
},
|
|
28
|
-
init: (environment, navigation) => {
|
|
34
|
+
init: (environment, navigation, notificationBell) => {
|
|
35
|
+
BaseComponents.NotificationBell = notificationBell;
|
|
36
|
+
PlussCore.Config.init(environment, navigation);
|
|
29
37
|
FeatureConfig.env = environment;
|
|
30
38
|
Services.navigation = navigation;
|
|
31
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Services","navigation","FeatureConfig","key","title","gridMenu","icon","viewBox","navigate","env","baseStage","baseAPIUrl","hasGradientHeader","defaultProfileImage","tinyChatDefault","baseUploadsUrl","allowMediaDownload","allowMediaSharing","awsUploadsBucket","awsStorageBucket","preferredSite","strings","newEventDefaults","defaultAllowComments","init","environment"],"sources":["feature.config.js"],"sourcesContent":["
|
|
1
|
+
{"version":3,"names":["PlussCore","Services","navigation","BaseComponents","NotificationBell","FeatureConfig","key","title","gridMenu","icon","viewBox","navigate","hideTabBar","env","baseStage","baseAPIUrl","hasGradientHeader","defaultProfileImage","tinyChatDefault","baseUploadsUrl","allowMediaDownload","allowMediaSharing","awsUploadsBucket","awsStorageBucket","preferredSite","strings","newEventDefaults","defaultAllowComments","init","environment","notificationBell","Config"],"sources":["feature.config.js"],"sourcesContent":["// import * as PlussCore from '../../pluss-core/src';\nimport * as PlussCore from '@plusscommunities/pluss-core-app';\n\nexport const Services = {\n navigation: null,\n};\n\nexport const BaseComponents = {\n NotificationBell: null,\n};\n\nconst FeatureConfig = {\n key: 'web',\n title: 'Web',\n gridMenu: {\n icon: 'tab_news2',\n viewBox: '0 0 24 24',\n navigate: 'web',\n },\n hideTabBar: ['webViewPage'],\n env: {\n baseStage: '',\n baseAPIUrl: '',\n hasGradientHeader: false,\n defaultProfileImage: '',\n tinyChatDefault: '',\n baseUploadsUrl: '',\n allowMediaDownload: false,\n allowMediaSharing: false,\n awsUploadsBucket: '',\n awsStorageBucket: '',\n preferredSite: '',\n strings: {},\n newEventDefaults: '',\n defaultAllowComments: true,\n },\n init: (environment, navigation, notificationBell) => {\n BaseComponents.NotificationBell = notificationBell;\n PlussCore.Config.init(environment, navigation);\n FeatureConfig.env = environment;\n Services.navigation = navigation;\n },\n};\nexport default FeatureConfig;\n"],"mappings":"AAAA;AACA,OAAO,KAAKA,SAAZ,MAA2B,kCAA3B;AAEA,OAAO,MAAMC,QAAQ,GAAG;EACtBC,UAAU,EAAE;AADU,CAAjB;AAIP,OAAO,MAAMC,cAAc,GAAG;EAC5BC,gBAAgB,EAAE;AADU,CAAvB;AAIP,MAAMC,aAAa,GAAG;EACpBC,GAAG,EAAE,KADe;EAEpBC,KAAK,EAAE,KAFa;EAGpBC,QAAQ,EAAE;IACRC,IAAI,EAAE,WADE;IAERC,OAAO,EAAE,WAFD;IAGRC,QAAQ,EAAE;EAHF,CAHU;EAQpBC,UAAU,EAAE,CAAC,aAAD,CARQ;EASpBC,GAAG,EAAE;IACHC,SAAS,EAAE,EADR;IAEHC,UAAU,EAAE,EAFT;IAGHC,iBAAiB,EAAE,KAHhB;IAIHC,mBAAmB,EAAE,EAJlB;IAKHC,eAAe,EAAE,EALd;IAMHC,cAAc,EAAE,EANb;IAOHC,kBAAkB,EAAE,KAPjB;IAQHC,iBAAiB,EAAE,KARhB;IASHC,gBAAgB,EAAE,EATf;IAUHC,gBAAgB,EAAE,EAVf;IAWHC,aAAa,EAAE,EAXZ;IAYHC,OAAO,EAAE,EAZN;IAaHC,gBAAgB,EAAE,EAbf;IAcHC,oBAAoB,EAAE;EAdnB,CATe;EAyBpBC,IAAI,EAAE,CAACC,WAAD,EAAc3B,UAAd,EAA0B4B,gBAA1B,KAA+C;IACnD3B,cAAc,CAACC,gBAAf,GAAkC0B,gBAAlC;IACA9B,SAAS,CAAC+B,MAAV,CAAiBH,IAAjB,CAAsBC,WAAtB,EAAmC3B,UAAnC;IACAG,aAAa,CAACQ,GAAd,GAAoBgB,WAApB;IACA5B,QAAQ,CAACC,UAAT,GAAsBA,UAAtB;EACD;AA9BmB,CAAtB;AAgCA,eAAeG,aAAf"}
|
package/dist/module/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import WebPage from './screens/WebPage';
|
|
2
|
+
import WebViewPage from './screens/WebViewPage';
|
|
2
3
|
export const Screens = {
|
|
3
|
-
web: WebPage
|
|
4
|
+
web: WebPage,
|
|
5
|
+
webViewPage: WebViewPage
|
|
4
6
|
};
|
|
5
7
|
export { default as Config } from './feature.config';
|
|
6
8
|
export { default as WidgetSmall } from './components/WidgetSmall';
|
package/dist/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["WebPage","Screens","web","default","Config","WidgetSmall","WidgetLarge"],"sources":["index.js"],"sourcesContent":["import WebPage from './screens/WebPage';\n\nexport const Screens = { web: WebPage };\nexport { default as Config } from './feature.config';\nexport { default as WidgetSmall } from './components/WidgetSmall';\nexport { default as WidgetLarge } from './components/WidgetLarge';\n"],"mappings":"AAAA,OAAOA,OAAP,MAAoB,mBAApB;AAEA,OAAO,MAAMC,OAAO,GAAG;EAAEC,GAAG,
|
|
1
|
+
{"version":3,"names":["WebPage","WebViewPage","Screens","web","webViewPage","default","Config","WidgetSmall","WidgetLarge"],"sources":["index.js"],"sourcesContent":["import WebPage from './screens/WebPage';\nimport WebViewPage from './screens/WebViewPage';\n\nexport const Screens = { web: WebPage, webViewPage: WebViewPage };\nexport { default as Config } from './feature.config';\nexport { default as WidgetSmall } from './components/WidgetSmall';\nexport { default as WidgetLarge } from './components/WidgetLarge';\n"],"mappings":"AAAA,OAAOA,OAAP,MAAoB,mBAApB;AACA,OAAOC,WAAP,MAAwB,uBAAxB;AAEA,OAAO,MAAMC,OAAO,GAAG;EAAEC,GAAG,EAAEH,OAAP;EAAgBI,WAAW,EAAEH;AAA7B,CAAhB;AACP,SAASI,OAAO,IAAIC,MAApB,QAAkC,kBAAlC;AACA,SAASD,OAAO,IAAIE,WAApB,QAAuC,0BAAvC;AACA,SAASF,OAAO,IAAIG,WAApB,QAAuC,0BAAvC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
|
|
3
|
+
import React, { Component } from 'react';
|
|
4
|
+
import { View, StyleSheet } from 'react-native';
|
|
5
|
+
import { WebView } from 'react-native-webview';
|
|
6
|
+
import { Components } from '../core.config';
|
|
7
|
+
import { Services } from '../feature.config';
|
|
8
|
+
|
|
9
|
+
class WebViewPage extends Component {
|
|
10
|
+
constructor(props) {
|
|
11
|
+
super(props);
|
|
12
|
+
|
|
13
|
+
_defineProperty(this, "onLoadStart", () => {});
|
|
14
|
+
|
|
15
|
+
_defineProperty(this, "onLoadEnd", () => {});
|
|
16
|
+
|
|
17
|
+
_defineProperty(this, "onPressBack", () => {
|
|
18
|
+
Services.navigation.goBack();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
this.state = {};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
render() {
|
|
25
|
+
const {
|
|
26
|
+
url,
|
|
27
|
+
headerTitle
|
|
28
|
+
} = this.props;
|
|
29
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
30
|
+
style: styles.container
|
|
31
|
+
}, /*#__PURE__*/React.createElement(Components.Header, {
|
|
32
|
+
leftIcon: "angle-left",
|
|
33
|
+
onPressLeft: this.onPressBack,
|
|
34
|
+
text: headerTitle
|
|
35
|
+
}), /*#__PURE__*/React.createElement(WebView, {
|
|
36
|
+
source: {
|
|
37
|
+
uri: url
|
|
38
|
+
},
|
|
39
|
+
style: styles.webContainer,
|
|
40
|
+
onLoadStart: this.onLoadStart,
|
|
41
|
+
onLoadEnd: this.onLoadEnd
|
|
42
|
+
}));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const styles = StyleSheet.create({
|
|
48
|
+
container: {
|
|
49
|
+
flex: 1
|
|
50
|
+
},
|
|
51
|
+
webContainer: {
|
|
52
|
+
flex: 1,
|
|
53
|
+
alignItems: 'center',
|
|
54
|
+
justifyContent: 'center'
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
export default WebViewPage;
|
|
58
|
+
//# sourceMappingURL=WebViewPage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Component","View","StyleSheet","WebView","Components","Services","WebViewPage","constructor","props","navigation","goBack","state","render","url","headerTitle","styles","container","onPressBack","uri","webContainer","onLoadStart","onLoadEnd","create","flex","alignItems","justifyContent"],"sources":["WebViewPage.js"],"sourcesContent":["import React, { Component } from 'react';\nimport { View, StyleSheet } from 'react-native';\nimport { WebView } from 'react-native-webview';\nimport { Components } from '../core.config';\nimport { Services } from '../feature.config';\n\nclass WebViewPage extends Component {\n constructor(props) {\n super(props);\n this.state = {};\n }\n\n onLoadStart = () => {};\n onLoadEnd = () => {};\n\n onPressBack = () => {\n Services.navigation.goBack();\n };\n\n render() {\n const { url, headerTitle } = this.props;\n return (\n <View style={styles.container}>\n <Components.Header leftIcon=\"angle-left\" onPressLeft={this.onPressBack} text={headerTitle} />\n <WebView source={{ uri: url }} style={styles.webContainer} onLoadStart={this.onLoadStart} onLoadEnd={this.onLoadEnd} />\n </View>\n );\n }\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n webContainer: {\n flex: 1,\n alignItems: 'center',\n justifyContent: 'center',\n },\n});\n\nexport default WebViewPage;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAgBC,SAAhB,QAAiC,OAAjC;AACA,SAASC,IAAT,EAAeC,UAAf,QAAiC,cAAjC;AACA,SAASC,OAAT,QAAwB,sBAAxB;AACA,SAASC,UAAT,QAA2B,gBAA3B;AACA,SAASC,QAAT,QAAyB,mBAAzB;;AAEA,MAAMC,WAAN,SAA0BN,SAA1B,CAAoC;EAClCO,WAAW,CAACC,KAAD,EAAQ;IACjB,MAAMA,KAAN;;IADiB,qCAKL,MAAM,CAAE,CALH;;IAAA,mCAMP,MAAM,CAAE,CAND;;IAAA,qCAQL,MAAM;MAClBH,QAAQ,CAACI,UAAT,CAAoBC,MAApB;IACD,CAVkB;;IAEjB,KAAKC,KAAL,GAAa,EAAb;EACD;;EASDC,MAAM,GAAG;IACP,MAAM;MAAEC,GAAF;MAAOC;IAAP,IAAuB,KAAKN,KAAlC;IACA,oBACE,oBAAC,IAAD;MAAM,KAAK,EAAEO,MAAM,CAACC;IAApB,gBACE,oBAAC,UAAD,CAAY,MAAZ;MAAmB,QAAQ,EAAC,YAA5B;MAAyC,WAAW,EAAE,KAAKC,WAA3D;MAAwE,IAAI,EAAEH;IAA9E,EADF,eAEE,oBAAC,OAAD;MAAS,MAAM,EAAE;QAAEI,GAAG,EAAEL;MAAP,CAAjB;MAA+B,KAAK,EAAEE,MAAM,CAACI,YAA7C;MAA2D,WAAW,EAAE,KAAKC,WAA7E;MAA0F,SAAS,EAAE,KAAKC;IAA1G,EAFF,CADF;EAMD;;AArBiC;;AAwBpC,MAAMN,MAAM,GAAGb,UAAU,CAACoB,MAAX,CAAkB;EAC/BN,SAAS,EAAE;IACTO,IAAI,EAAE;EADG,CADoB;EAI/BJ,YAAY,EAAE;IACZI,IAAI,EAAE,CADM;IAEZC,UAAU,EAAE,QAFA;IAGZC,cAAc,EAAE;EAHJ;AAJiB,CAAlB,CAAf;AAWA,eAAenB,WAAf"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plusscommunities/pluss-webview-app",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "Extension package to enable webview on Pluss Communities Platform",
|
|
5
5
|
"main": "dist/module/index.js",
|
|
6
6
|
"module": "dist/module/index.js",
|
|
@@ -21,6 +21,8 @@
|
|
|
21
21
|
"author": "Phillip Suh",
|
|
22
22
|
"license": "ISC",
|
|
23
23
|
"dependencies": {
|
|
24
|
+
"@plusscommunities/pluss-core-app": "1.8.4",
|
|
25
|
+
"lodash": "^4.17.4",
|
|
24
26
|
"react": "17.0.2",
|
|
25
27
|
"react-native": "0.68.2",
|
|
26
28
|
"react-native-webview": "11.18.1"
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
|
-
import { View, StyleSheet } from 'react-native';
|
|
2
|
+
import { View, Text, StyleSheet } from 'react-native';
|
|
3
3
|
import { WebView } from 'react-native-webview';
|
|
4
|
+
import { connect } from 'react-redux';
|
|
5
|
+
import _ from 'lodash';
|
|
6
|
+
import { Colours, Components } from '../core.config';
|
|
7
|
+
import { Services } from '../feature.config';
|
|
4
8
|
|
|
5
9
|
class WidgetLarge extends Component {
|
|
6
10
|
constructor(props) {
|
|
@@ -11,8 +15,41 @@ class WidgetLarge extends Component {
|
|
|
11
15
|
onLoadStart = () => {};
|
|
12
16
|
onLoadEnd = () => {};
|
|
13
17
|
|
|
14
|
-
|
|
18
|
+
onGoToFullpage = () => {
|
|
19
|
+
const { options } = this.props;
|
|
20
|
+
Services.navigation.navigate('webViewPage', { url: options['webUrl'], headerTitle: this.getTitle() });
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
getTitle = () => {
|
|
15
24
|
const { options } = this.props;
|
|
25
|
+
if (options && !_.isEmpty(options.Title)) return options.Title;
|
|
26
|
+
return 'Web View';
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
render() {
|
|
30
|
+
const { options, colourBrandingMain } = this.props;
|
|
31
|
+
if (options.isWebViewSeparatePage) {
|
|
32
|
+
return (
|
|
33
|
+
<View style={styles.sectionContainer}>
|
|
34
|
+
<View style={styles.sectionPadding}>
|
|
35
|
+
<View style={styles.sectionHeading}>
|
|
36
|
+
<Text style={styles.sectionTitle}>{this.getTitle()}</Text>
|
|
37
|
+
</View>
|
|
38
|
+
</View>
|
|
39
|
+
<View style={styles.buttonContainer}>
|
|
40
|
+
<Components.InlineButton
|
|
41
|
+
onPress={this.onGoToFullpage}
|
|
42
|
+
color={colourBrandingMain}
|
|
43
|
+
touchableStyle={{ paddingTop: 6 }}
|
|
44
|
+
textStyle={{ color: '#fff' }}
|
|
45
|
+
large
|
|
46
|
+
>
|
|
47
|
+
{options.buttonText}
|
|
48
|
+
</Components.InlineButton>
|
|
49
|
+
</View>
|
|
50
|
+
</View>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
16
53
|
return (
|
|
17
54
|
<View style={styles.container}>
|
|
18
55
|
{this.props.ListHeaderComponent}
|
|
@@ -36,6 +73,35 @@ const styles = StyleSheet.create({
|
|
|
36
73
|
alignItems: 'center',
|
|
37
74
|
justifyContent: 'center',
|
|
38
75
|
},
|
|
76
|
+
sectionContainer: {
|
|
77
|
+
backgroundColor: '#fff',
|
|
78
|
+
paddingTop: 16,
|
|
79
|
+
},
|
|
80
|
+
sectionPadding: {
|
|
81
|
+
paddingHorizontal: 16,
|
|
82
|
+
paddingBottom: 6,
|
|
83
|
+
},
|
|
84
|
+
sectionHeading: {
|
|
85
|
+
marginBottom: 4,
|
|
86
|
+
flexDirection: 'row',
|
|
87
|
+
alignContent: 'flex-start',
|
|
88
|
+
justifyContent: 'space-between',
|
|
89
|
+
},
|
|
90
|
+
sectionTitle: {
|
|
91
|
+
fontFamily: 'sf-bold',
|
|
92
|
+
fontSize: 24,
|
|
93
|
+
color: Colours.TEXT_DARKEST,
|
|
94
|
+
},
|
|
95
|
+
buttonContainer: {
|
|
96
|
+
alignItems: 'center',
|
|
97
|
+
justifyContent: 'center',
|
|
98
|
+
},
|
|
39
99
|
});
|
|
40
100
|
|
|
41
|
-
|
|
101
|
+
const mapStateToProps = state => {
|
|
102
|
+
return {
|
|
103
|
+
colourBrandingMain: Colours.getMainBrandingColourFromState(state),
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
export default connect(mapStateToProps, {}, null, { forwardRef: true })(WidgetLarge);
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
|
-
import { View, StyleSheet } from 'react-native';
|
|
2
|
+
import { View, Text, StyleSheet } from 'react-native';
|
|
3
3
|
import { WebView } from 'react-native-webview';
|
|
4
|
+
import { connect } from 'react-redux';
|
|
5
|
+
import _ from 'lodash';
|
|
6
|
+
import { Colours, Components } from '../core.config';
|
|
7
|
+
import { Services } from '../feature.config';
|
|
4
8
|
|
|
5
9
|
class WidgetSmall extends Component {
|
|
6
10
|
constructor(props) {
|
|
@@ -11,8 +15,41 @@ class WidgetSmall extends Component {
|
|
|
11
15
|
onLoadStart = () => {};
|
|
12
16
|
onLoadEnd = () => {};
|
|
13
17
|
|
|
14
|
-
|
|
18
|
+
onGoToFullpage = () => {
|
|
19
|
+
const { options } = this.props;
|
|
20
|
+
Services.navigation.navigate('webViewPage', { url: options['webUrl'], headerTitle: this.getTitle() });
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
getTitle = () => {
|
|
15
24
|
const { options } = this.props;
|
|
25
|
+
if (options && !_.isEmpty(options.Title)) return options.Title;
|
|
26
|
+
return 'Web View';
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
render() {
|
|
30
|
+
const { options, colourBrandingMain } = this.props;
|
|
31
|
+
if (options.isWebViewSeparatePage) {
|
|
32
|
+
return (
|
|
33
|
+
<View style={styles.sectionContainer}>
|
|
34
|
+
<View style={styles.sectionPadding}>
|
|
35
|
+
<View style={styles.sectionHeading}>
|
|
36
|
+
<Text style={styles.sectionTitle}>{this.getTitle()}</Text>
|
|
37
|
+
</View>
|
|
38
|
+
</View>
|
|
39
|
+
<View style={styles.buttonContainer}>
|
|
40
|
+
<Components.InlineButton
|
|
41
|
+
onPress={this.onGoToFullpage}
|
|
42
|
+
color={colourBrandingMain}
|
|
43
|
+
touchableStyle={{ paddingTop: 6 }}
|
|
44
|
+
textStyle={{ color: '#fff' }}
|
|
45
|
+
large
|
|
46
|
+
>
|
|
47
|
+
{options.buttonText}
|
|
48
|
+
</Components.InlineButton>
|
|
49
|
+
</View>
|
|
50
|
+
</View>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
16
53
|
return (
|
|
17
54
|
<View style={styles.container}>
|
|
18
55
|
<WebView
|
|
@@ -37,6 +74,35 @@ const styles = StyleSheet.create({
|
|
|
37
74
|
alignItems: 'center',
|
|
38
75
|
justifyContent: 'center',
|
|
39
76
|
},
|
|
77
|
+
sectionContainer: {
|
|
78
|
+
backgroundColor: '#fff',
|
|
79
|
+
paddingTop: 16,
|
|
80
|
+
},
|
|
81
|
+
sectionPadding: {
|
|
82
|
+
paddingHorizontal: 16,
|
|
83
|
+
paddingBottom: 6,
|
|
84
|
+
},
|
|
85
|
+
sectionHeading: {
|
|
86
|
+
marginBottom: 4,
|
|
87
|
+
flexDirection: 'row',
|
|
88
|
+
alignContent: 'flex-start',
|
|
89
|
+
justifyContent: 'space-between',
|
|
90
|
+
},
|
|
91
|
+
sectionTitle: {
|
|
92
|
+
fontFamily: 'sf-bold',
|
|
93
|
+
fontSize: 24,
|
|
94
|
+
color: Colours.TEXT_DARKEST,
|
|
95
|
+
},
|
|
96
|
+
buttonContainer: {
|
|
97
|
+
alignItems: 'center',
|
|
98
|
+
justifyContent: 'center',
|
|
99
|
+
},
|
|
40
100
|
});
|
|
41
101
|
|
|
42
|
-
|
|
102
|
+
const mapStateToProps = state => {
|
|
103
|
+
return {
|
|
104
|
+
colourBrandingMain: Colours.getMainBrandingColourFromState(state),
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
export default connect(mapStateToProps, {}, null, { forwardRef: true })(WidgetSmall);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// import * as PlussCore from '../../pluss-core/src';
|
|
2
|
+
import * as PlussCore from '@plusscommunities/pluss-core-app';
|
|
3
|
+
|
|
4
|
+
const { Apis, Fonts, Actions, ActionTypes, Config, Components, Styles, Session, Helper, Constants, Colours } = PlussCore;
|
|
5
|
+
export { Apis, Fonts, Actions, ActionTypes, Config, Components, Styles, Session, Helper, Constants, Colours };
|
package/src/feature.config.js
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
|
+
// import * as PlussCore from '../../pluss-core/src';
|
|
2
|
+
import * as PlussCore from '@plusscommunities/pluss-core-app';
|
|
3
|
+
|
|
1
4
|
export const Services = {
|
|
2
5
|
navigation: null,
|
|
3
6
|
};
|
|
4
7
|
|
|
8
|
+
export const BaseComponents = {
|
|
9
|
+
NotificationBell: null,
|
|
10
|
+
};
|
|
11
|
+
|
|
5
12
|
const FeatureConfig = {
|
|
6
13
|
key: 'web',
|
|
7
14
|
title: 'Web',
|
|
@@ -10,6 +17,7 @@ const FeatureConfig = {
|
|
|
10
17
|
viewBox: '0 0 24 24',
|
|
11
18
|
navigate: 'web',
|
|
12
19
|
},
|
|
20
|
+
hideTabBar: ['webViewPage'],
|
|
13
21
|
env: {
|
|
14
22
|
baseStage: '',
|
|
15
23
|
baseAPIUrl: '',
|
|
@@ -26,7 +34,9 @@ const FeatureConfig = {
|
|
|
26
34
|
newEventDefaults: '',
|
|
27
35
|
defaultAllowComments: true,
|
|
28
36
|
},
|
|
29
|
-
init: (environment, navigation) => {
|
|
37
|
+
init: (environment, navigation, notificationBell) => {
|
|
38
|
+
BaseComponents.NotificationBell = notificationBell;
|
|
39
|
+
PlussCore.Config.init(environment, navigation);
|
|
30
40
|
FeatureConfig.env = environment;
|
|
31
41
|
Services.navigation = navigation;
|
|
32
42
|
},
|
package/src/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import WebPage from './screens/WebPage';
|
|
2
|
+
import WebViewPage from './screens/WebViewPage';
|
|
2
3
|
|
|
3
|
-
export const Screens = { web: WebPage };
|
|
4
|
+
export const Screens = { web: WebPage, webViewPage: WebViewPage };
|
|
4
5
|
export { default as Config } from './feature.config';
|
|
5
6
|
export { default as WidgetSmall } from './components/WidgetSmall';
|
|
6
7
|
export { default as WidgetLarge } from './components/WidgetLarge';
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import { View, StyleSheet } from 'react-native';
|
|
3
|
+
import { WebView } from 'react-native-webview';
|
|
4
|
+
import { Components } from '../core.config';
|
|
5
|
+
import { Services } from '../feature.config';
|
|
6
|
+
|
|
7
|
+
class WebViewPage extends Component {
|
|
8
|
+
constructor(props) {
|
|
9
|
+
super(props);
|
|
10
|
+
this.state = {};
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
onLoadStart = () => {};
|
|
14
|
+
onLoadEnd = () => {};
|
|
15
|
+
|
|
16
|
+
onPressBack = () => {
|
|
17
|
+
Services.navigation.goBack();
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
render() {
|
|
21
|
+
const { url, headerTitle } = this.props;
|
|
22
|
+
return (
|
|
23
|
+
<View style={styles.container}>
|
|
24
|
+
<Components.Header leftIcon="angle-left" onPressLeft={this.onPressBack} text={headerTitle} />
|
|
25
|
+
<WebView source={{ uri: url }} style={styles.webContainer} onLoadStart={this.onLoadStart} onLoadEnd={this.onLoadEnd} />
|
|
26
|
+
</View>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const styles = StyleSheet.create({
|
|
32
|
+
container: {
|
|
33
|
+
flex: 1,
|
|
34
|
+
},
|
|
35
|
+
webContainer: {
|
|
36
|
+
flex: 1,
|
|
37
|
+
alignItems: 'center',
|
|
38
|
+
justifyContent: 'center',
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
export default WebViewPage;
|