@plusscommunities/pluss-webview-app 7.0.1 → 8.0.1-auth.0

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,115 +1,135 @@
1
- import React, { Component } from 'react';
2
- import { View, Text, StyleSheet } from 'react-native';
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';
1
+ import React, { Component } from "react";
2
+ import { View, StyleSheet } from "react-native";
3
+ import { Text } from "@plusscommunities/pluss-core-app/components";
4
+ import { WebView } from "react-native-webview";
5
+ import { connect } from "react-redux";
6
+ import _ from "lodash";
7
+ import { Colours, Components } from "../core.config";
8
+ import { Services } from "../feature.config";
8
9
 
9
10
  class WidgetLarge extends Component {
10
- constructor(props) {
11
- super(props);
12
- this.state = {};
13
- }
11
+ constructor(props) {
12
+ super(props);
13
+ this.state = {};
14
+ }
14
15
 
15
- onLoadStart = () => {};
16
- onLoadEnd = () => {};
16
+ onLoadStart = () => {};
17
+ onLoadEnd = () => {};
17
18
 
18
- onGoToFullpage = () => {
19
- const { options } = this.props;
20
- Services.navigation.navigate('webViewPage', { url: options['webUrl'], headerTitle: this.getTitle() });
21
- };
19
+ onGoToFullpage = () => {
20
+ const { options } = this.props;
21
+ Services.navigation.navigate("webViewPage", {
22
+ url: options["webUrl"],
23
+ headerTitle: this.getTitle(),
24
+ });
25
+ };
22
26
 
23
- getTitle = () => {
24
- const { options } = this.props;
25
- if (options && !_.isEmpty(options.Title)) return options.Title;
26
- return 'Web View';
27
- };
27
+ getTitle = () => {
28
+ const { options } = this.props;
29
+ if (options && !_.isEmpty(options.Title)) return options.Title;
30
+ return "Web View";
31
+ };
28
32
 
29
- render() {
30
- const { options, colourBrandingMain } = this.props;
31
- if (options.isWebViewSeparatePage) {
32
- return (
33
- <View style={[styles.buttonContainer, { backgroundColor: Colours.hexToRGBAstring(colourBrandingMain, 0.2) }]}>
34
- <View style={styles.upperContainer}>
35
- <View>
36
- <Text style={[styles.title, { color: colourBrandingMain }]}>{this.getTitle()}</Text>
37
- </View>
38
- </View>
39
- <Components.InlineButton onPress={this.onGoToFullpage} color={colourBrandingMain} style={styles.button} large>
40
- {options.buttonText}
41
- </Components.InlineButton>
42
- </View>
43
- );
44
- // return (
45
- // <View style={styles.sectionContainer}>
46
- // <View style={styles.sectionPadding}>
47
- // <View style={styles.sectionHeading}>
48
- // <Text style={styles.sectionTitle}>{this.getTitle()}</Text>
49
- // </View>
50
- // </View>
51
- // <View style={styles.buttonContainer}>
52
- // <Components.InlineButton
53
- // onPress={this.onGoToFullpage}
54
- // color={colourBrandingMain}
55
- // touchableStyle={{ paddingTop: 6 }}
56
- // textStyle={{ color: '#fff' }}
57
- // large
58
- // >
59
- // {options.buttonText}
60
- // </Components.InlineButton>
61
- // </View>
62
- // </View>
63
- // );
64
- }
65
- return (
66
- <View style={styles.container}>
67
- {this.props.ListHeaderComponent}
68
- <WebView
69
- source={{ uri: options['webUrl'] }}
70
- style={styles.webContainer}
71
- onLoadStart={this.onLoadStart}
72
- onLoadEnd={this.onLoadEnd}
73
- />
74
- </View>
75
- );
76
- }
33
+ render() {
34
+ const { options, colourBrandingMain } = this.props;
35
+ if (options.isWebViewSeparatePage) {
36
+ return (
37
+ <View
38
+ style={[
39
+ styles.buttonContainer,
40
+ {
41
+ backgroundColor: Colours.hexToRGBAstring(colourBrandingMain, 0.2),
42
+ },
43
+ ]}
44
+ >
45
+ <View style={styles.upperContainer}>
46
+ <View>
47
+ <Text style={[styles.title, { color: colourBrandingMain }]}>
48
+ {this.getTitle()}
49
+ </Text>
50
+ </View>
51
+ </View>
52
+ <Components.InlineButton
53
+ onPress={this.onGoToFullpage}
54
+ color={colourBrandingMain}
55
+ style={styles.button}
56
+ large
57
+ >
58
+ {options.buttonText}
59
+ </Components.InlineButton>
60
+ </View>
61
+ );
62
+ // return (
63
+ // <View style={styles.sectionContainer}>
64
+ // <View style={styles.sectionPadding}>
65
+ // <View style={styles.sectionHeading}>
66
+ // <Text style={styles.sectionTitle}>{this.getTitle()}</Text>
67
+ // </View>
68
+ // </View>
69
+ // <View style={styles.buttonContainer}>
70
+ // <Components.InlineButton
71
+ // onPress={this.onGoToFullpage}
72
+ // color={colourBrandingMain}
73
+ // touchableStyle={{ paddingTop: 6 }}
74
+ // textStyle={{ color: '#fff' }}
75
+ // large
76
+ // >
77
+ // {options.buttonText}
78
+ // </Components.InlineButton>
79
+ // </View>
80
+ // </View>
81
+ // );
82
+ }
83
+ return (
84
+ <View style={styles.container}>
85
+ {this.props.ListHeaderComponent}
86
+ <WebView
87
+ source={{ uri: options["webUrl"] }}
88
+ style={styles.webContainer}
89
+ onLoadStart={this.onLoadStart}
90
+ onLoadEnd={this.onLoadEnd}
91
+ />
92
+ </View>
93
+ );
94
+ }
77
95
  }
78
96
 
79
97
  const styles = StyleSheet.create({
80
- container: {
81
- flex: 1,
82
- },
83
- webContainer: {
84
- flex: 1,
85
- alignItems: 'center',
86
- justifyContent: 'center',
87
- },
88
- buttonContainer: {
89
- width: '100%',
90
- alignItems: 'center',
91
- justifyContent: 'center',
92
- padding: 16,
93
- },
94
- upperContainer: {
95
- flexDirection: 'row',
96
- alignItems: 'center',
97
- justifyContent: 'space-between',
98
- },
99
- title: {
100
- fontFamily: 'sf-semibold',
101
- fontSize: 16,
102
- },
103
- button: {
104
- paddingHorizontal: 40,
105
- marginTop: 16,
106
- },
98
+ container: {
99
+ flex: 1,
100
+ },
101
+ webContainer: {
102
+ flex: 1,
103
+ alignItems: "center",
104
+ justifyContent: "center",
105
+ },
106
+ buttonContainer: {
107
+ width: "100%",
108
+ alignItems: "center",
109
+ justifyContent: "center",
110
+ padding: 16,
111
+ },
112
+ upperContainer: {
113
+ flexDirection: "row",
114
+ alignItems: "center",
115
+ justifyContent: "space-between",
116
+ },
117
+ title: {
118
+ fontFamily: "sf-semibold",
119
+ fontSize: 16,
120
+ },
121
+ button: {
122
+ paddingHorizontal: 40,
123
+ marginTop: 16,
124
+ },
107
125
  });
108
126
 
109
- const mapStateToProps = state => {
110
- return {
111
- colourBrandingMain: Colours.getMainBrandingColourFromState(state),
112
- };
127
+ const mapStateToProps = (state) => {
128
+ return {
129
+ colourBrandingMain: Colours.getMainBrandingColourFromState(state),
130
+ };
113
131
  };
114
132
 
115
- export default connect(mapStateToProps, {}, null, { forwardRef: true })(WidgetLarge);
133
+ export default connect(mapStateToProps, {}, null, { forwardRef: true })(
134
+ WidgetLarge,
135
+ );
@@ -1,116 +1,136 @@
1
- import React, { Component } from 'react';
2
- import { View, Text, StyleSheet } from 'react-native';
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';
1
+ import React, { Component } from "react";
2
+ import { View, StyleSheet } from "react-native";
3
+ import { Text } from "@plusscommunities/pluss-core-app/components";
4
+ import { WebView } from "react-native-webview";
5
+ import { connect } from "react-redux";
6
+ import _ from "lodash";
7
+ import { Colours, Components } from "../core.config";
8
+ import { Services } from "../feature.config";
8
9
 
9
10
  class WidgetSmall extends Component {
10
- constructor(props) {
11
- super(props);
12
- this.state = {};
13
- }
11
+ constructor(props) {
12
+ super(props);
13
+ this.state = {};
14
+ }
14
15
 
15
- onLoadStart = () => {};
16
- onLoadEnd = () => {};
16
+ onLoadStart = () => {};
17
+ onLoadEnd = () => {};
17
18
 
18
- onGoToFullpage = () => {
19
- const { options } = this.props;
20
- Services.navigation.navigate('webViewPage', { url: options['webUrl'], headerTitle: this.getTitle() });
21
- };
19
+ onGoToFullpage = () => {
20
+ const { options } = this.props;
21
+ Services.navigation.navigate("webViewPage", {
22
+ url: options["webUrl"],
23
+ headerTitle: this.getTitle(),
24
+ });
25
+ };
22
26
 
23
- getTitle = () => {
24
- const { options } = this.props;
25
- if (options && !_.isEmpty(options.Title)) return options.Title;
26
- return 'Web View';
27
- };
27
+ getTitle = () => {
28
+ const { options } = this.props;
29
+ if (options && !_.isEmpty(options.Title)) return options.Title;
30
+ return "Web View";
31
+ };
28
32
 
29
- render() {
30
- const { options, colourBrandingMain } = this.props;
31
- if (options.isWebViewSeparatePage) {
32
- return (
33
- <View style={[styles.buttonContainer, { backgroundColor: Colours.hexToRGBAstring(colourBrandingMain, 0.2) }]}>
34
- <View style={styles.upperContainer}>
35
- <View>
36
- <Text style={[styles.title, { color: colourBrandingMain }]}>{this.getTitle()}</Text>
37
- </View>
38
- </View>
39
- <Components.InlineButton onPress={this.onGoToFullpage} color={colourBrandingMain} style={styles.button} large>
40
- {options.buttonText}
41
- </Components.InlineButton>
42
- </View>
43
- );
44
- // return (
45
- // <View style={styles.sectionContainer}>
46
- // <View style={styles.sectionPadding}>
47
- // <View style={styles.sectionHeading}>
48
- // <Text style={styles.sectionTitle}>{this.getTitle()}</Text>
49
- // </View>
50
- // </View>
51
- // <View style={styles.buttonContainer}>
52
- // <Components.InlineButton
53
- // onPress={this.onGoToFullpage}
54
- // color={colourBrandingMain}
55
- // touchableStyle={{ paddingTop: 6 }}
56
- // textStyle={{ color: '#fff' }}
57
- // large
58
- // >
59
- // {options.buttonText}
60
- // </Components.InlineButton>
61
- // </View>
62
- // </View>
63
- // );
64
- }
65
- return (
66
- <View style={styles.container}>
67
- <WebView
68
- source={{ uri: options['webUrl'] }}
69
- style={styles.webContainer}
70
- onLoadStart={this.onLoadStart}
71
- onLoadEnd={this.onLoadEnd}
72
- />
73
- </View>
74
- );
75
- }
33
+ render() {
34
+ const { options, colourBrandingMain } = this.props;
35
+ if (options.isWebViewSeparatePage) {
36
+ return (
37
+ <View
38
+ style={[
39
+ styles.buttonContainer,
40
+ {
41
+ backgroundColor: Colours.hexToRGBAstring(colourBrandingMain, 0.2),
42
+ },
43
+ ]}
44
+ >
45
+ <View style={styles.upperContainer}>
46
+ <View>
47
+ <Text style={[styles.title, { color: colourBrandingMain }]}>
48
+ {this.getTitle()}
49
+ </Text>
50
+ </View>
51
+ </View>
52
+ <Components.InlineButton
53
+ onPress={this.onGoToFullpage}
54
+ color={colourBrandingMain}
55
+ style={styles.button}
56
+ large
57
+ >
58
+ {options.buttonText}
59
+ </Components.InlineButton>
60
+ </View>
61
+ );
62
+ // return (
63
+ // <View style={styles.sectionContainer}>
64
+ // <View style={styles.sectionPadding}>
65
+ // <View style={styles.sectionHeading}>
66
+ // <Text style={styles.sectionTitle}>{this.getTitle()}</Text>
67
+ // </View>
68
+ // </View>
69
+ // <View style={styles.buttonContainer}>
70
+ // <Components.InlineButton
71
+ // onPress={this.onGoToFullpage}
72
+ // color={colourBrandingMain}
73
+ // touchableStyle={{ paddingTop: 6 }}
74
+ // textStyle={{ color: '#fff' }}
75
+ // large
76
+ // >
77
+ // {options.buttonText}
78
+ // </Components.InlineButton>
79
+ // </View>
80
+ // </View>
81
+ // );
82
+ }
83
+ return (
84
+ <View style={styles.container}>
85
+ <WebView
86
+ source={{ uri: options["webUrl"] }}
87
+ style={styles.webContainer}
88
+ onLoadStart={this.onLoadStart}
89
+ onLoadEnd={this.onLoadEnd}
90
+ />
91
+ </View>
92
+ );
93
+ }
76
94
  }
77
95
 
78
96
  const styles = StyleSheet.create({
79
- container: {
80
- height: 300,
81
- paddingTop: 8,
82
- paddingBottom: 8,
83
- },
84
- webContainer: {
85
- flex: 1,
86
- alignItems: 'center',
87
- justifyContent: 'center',
88
- },
89
- buttonContainer: {
90
- width: '100%',
91
- alignItems: 'center',
92
- justifyContent: 'center',
93
- padding: 16,
94
- },
95
- upperContainer: {
96
- flexDirection: 'row',
97
- alignItems: 'center',
98
- justifyContent: 'space-between',
99
- },
100
- title: {
101
- fontFamily: 'sf-semibold',
102
- fontSize: 16,
103
- },
104
- button: {
105
- paddingHorizontal: 40,
106
- marginTop: 16,
107
- },
97
+ container: {
98
+ height: 300,
99
+ paddingTop: 8,
100
+ paddingBottom: 8,
101
+ },
102
+ webContainer: {
103
+ flex: 1,
104
+ alignItems: "center",
105
+ justifyContent: "center",
106
+ },
107
+ buttonContainer: {
108
+ width: "100%",
109
+ alignItems: "center",
110
+ justifyContent: "center",
111
+ padding: 16,
112
+ },
113
+ upperContainer: {
114
+ flexDirection: "row",
115
+ alignItems: "center",
116
+ justifyContent: "space-between",
117
+ },
118
+ title: {
119
+ fontFamily: "sf-semibold",
120
+ fontSize: 16,
121
+ },
122
+ button: {
123
+ paddingHorizontal: 40,
124
+ marginTop: 16,
125
+ },
108
126
  });
109
127
 
110
- const mapStateToProps = state => {
111
- return {
112
- colourBrandingMain: Colours.getMainBrandingColourFromState(state),
113
- };
128
+ const mapStateToProps = (state) => {
129
+ return {
130
+ colourBrandingMain: Colours.getMainBrandingColourFromState(state),
131
+ };
114
132
  };
115
133
 
116
- export default connect(mapStateToProps, {}, null, { forwardRef: true })(WidgetSmall);
134
+ export default connect(mapStateToProps, {}, null, { forwardRef: true })(
135
+ WidgetSmall,
136
+ );
@@ -1,5 +1,27 @@
1
1
  // import * as PlussCore from '../../pluss-core/src';
2
- import * as PlussCore from '@plusscommunities/pluss-core-app';
2
+ import * as PlussCore from "@plusscommunities/pluss-core-app";
3
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 };
4
+ const {
5
+ Apis,
6
+ Actions,
7
+ ActionTypes,
8
+ Config,
9
+ Components,
10
+ Styles,
11
+ Session,
12
+ Helper,
13
+ Constants,
14
+ Colours,
15
+ } = PlussCore;
16
+ export {
17
+ Apis,
18
+ Actions,
19
+ ActionTypes,
20
+ Config,
21
+ Components,
22
+ Styles,
23
+ Session,
24
+ Helper,
25
+ Constants,
26
+ Colours,
27
+ };
@@ -1,44 +1,44 @@
1
1
  // import * as PlussCore from '../../pluss-core/src';
2
- import * as PlussCore from '@plusscommunities/pluss-core-app';
2
+ import * as PlussCore from "@plusscommunities/pluss-core-app";
3
3
 
4
4
  export const Services = {
5
- navigation: null,
5
+ navigation: null,
6
6
  };
7
7
 
8
8
  export const BaseComponents = {
9
- NotificationBell: null,
9
+ NotificationBell: null,
10
10
  };
11
11
 
12
12
  const FeatureConfig = {
13
- key: 'web',
14
- title: 'Web',
15
- gridMenu: {
16
- icon: 'tab_news2',
17
- viewBox: '0 0 24 24',
18
- navigate: 'web',
19
- },
20
- hideTabBar: ['webViewPage'],
21
- env: {
22
- baseStage: '',
23
- baseAPIUrl: '',
24
- hasGradientHeader: false,
25
- defaultProfileImage: '',
26
- tinyChatDefault: '',
27
- baseUploadsUrl: '',
28
- allowMediaDownload: false,
29
- allowMediaSharing: false,
30
- awsUploadsBucket: '',
31
- awsStorageBucket: '',
32
- preferredSite: '',
33
- strings: {},
34
- newEventDefaults: '',
35
- defaultAllowComments: true,
36
- },
37
- init: (environment, navigation, notificationBell) => {
38
- BaseComponents.NotificationBell = notificationBell;
39
- PlussCore.Config.init(environment, navigation);
40
- FeatureConfig.env = environment;
41
- Services.navigation = navigation;
42
- },
13
+ key: "web",
14
+ title: "Web",
15
+ gridMenu: {
16
+ icon: "tab_news2",
17
+ viewBox: "0 0 24 24",
18
+ navigate: "web",
19
+ },
20
+ hideTabBar: ["webViewPage"],
21
+ env: {
22
+ baseStage: "",
23
+ baseAPIUrl: "",
24
+ hasGradientHeader: false,
25
+ defaultProfileImage: "",
26
+ tinyChatDefault: "",
27
+ baseUploadsUrl: "",
28
+ allowMediaDownload: false,
29
+ allowMediaSharing: false,
30
+ awsUploadsBucket: "",
31
+ awsStorageBucket: "",
32
+ preferredSite: "",
33
+ strings: {},
34
+ newEventDefaults: "",
35
+ defaultAllowComments: true,
36
+ },
37
+ init: (environment, navigation, notificationBell) => {
38
+ BaseComponents.NotificationBell = notificationBell;
39
+ PlussCore.Config.init(environment, navigation);
40
+ FeatureConfig.env = environment;
41
+ Services.navigation = navigation;
42
+ },
43
43
  };
44
44
  export default FeatureConfig;
package/src/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import WebPage from './screens/WebPage';
2
- import WebViewPage from './screens/WebViewPage';
1
+ import WebPage from "./screens/WebPage";
2
+ import WebViewPage from "./screens/WebViewPage";
3
3
 
4
4
  export const Screens = { web: WebPage, webViewPage: WebViewPage };
5
- export { default as Config } from './feature.config';
6
- export { default as WidgetSmall } from './components/WidgetSmall';
7
- export { default as WidgetLarge } from './components/WidgetLarge';
5
+ export { default as Config } from "./feature.config";
6
+ export { default as WidgetSmall } from "./components/WidgetSmall";
7
+ export { default as WidgetLarge } from "./components/WidgetLarge";
@@ -1,10 +1,10 @@
1
- import React, { PureComponent } from 'react';
2
- import WidgetLarge from '../components/WidgetLarge';
1
+ import React, { PureComponent } from "react";
2
+ import WidgetLarge from "../components/WidgetLarge";
3
3
 
4
4
  class WebPage extends PureComponent {
5
- render() {
6
- return <WidgetLarge {...this.props} />;
7
- }
5
+ render() {
6
+ return <WidgetLarge {...this.props} />;
7
+ }
8
8
  }
9
9
 
10
10
  export default WebPage;