rn-erxes-sdk 0.1.3 → 0.1.5
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/README.md +39 -20
- package/lib/commonjs/App.js +9 -44
- package/lib/commonjs/App.js.map +1 -1
- package/lib/commonjs/FAQ.js +175 -0
- package/lib/commonjs/FAQ.js.map +1 -0
- package/lib/commonjs/Greetings.js +57 -0
- package/lib/commonjs/Greetings.js.map +1 -0
- package/lib/commonjs/Social.js +46 -0
- package/lib/commonjs/Social.js.map +1 -0
- package/lib/commonjs/Support.js +93 -0
- package/lib/commonjs/Support.js.map +1 -0
- package/lib/commonjs/Supporters.js +73 -0
- package/lib/commonjs/Supporters.js.map +1 -0
- package/lib/commonjs/Widget.js +132 -0
- package/lib/commonjs/Widget.js.map +1 -0
- package/lib/commonjs/apolloClient.js +55 -0
- package/lib/commonjs/apolloClient.js.map +1 -0
- package/lib/commonjs/assets/images/Facebook.png +0 -0
- package/lib/commonjs/assets/images/Twitter.png +0 -0
- package/lib/commonjs/assets/images/Youtube.png +0 -0
- package/lib/commonjs/assets/images/avatar.png +0 -0
- package/lib/commonjs/assets/images/index.js +15 -0
- package/lib/commonjs/assets/images/index.js.map +1 -0
- package/lib/commonjs/graphql/graphql.js +108 -0
- package/lib/commonjs/graphql/graphql.js.map +1 -0
- package/lib/commonjs/graphql/mutation.js +47 -0
- package/lib/commonjs/graphql/mutation.js.map +1 -0
- package/lib/module/App.js +9 -44
- package/lib/module/App.js.map +1 -1
- package/lib/module/FAQ.js +165 -0
- package/lib/module/FAQ.js.map +1 -0
- package/lib/module/Greetings.js +48 -0
- package/lib/module/Greetings.js.map +1 -0
- package/lib/module/Social.js +37 -0
- package/lib/module/Social.js.map +1 -0
- package/lib/module/Support.js +84 -0
- package/lib/module/Support.js.map +1 -0
- package/lib/module/Supporters.js +64 -0
- package/lib/module/Supporters.js.map +1 -0
- package/lib/module/Widget.js +123 -0
- package/lib/module/Widget.js.map +1 -0
- package/lib/module/apolloClient.js +46 -0
- package/lib/module/apolloClient.js.map +1 -0
- package/lib/module/assets/images/Facebook.png +0 -0
- package/lib/module/assets/images/Twitter.png +0 -0
- package/lib/module/assets/images/Youtube.png +0 -0
- package/lib/module/assets/images/avatar.png +0 -0
- package/lib/module/assets/images/index.js +8 -0
- package/lib/module/assets/images/index.js.map +1 -0
- package/lib/module/graphql/graphql.js +99 -0
- package/lib/module/graphql/graphql.js.map +1 -0
- package/lib/module/graphql/mutation.js +41 -0
- package/lib/module/graphql/mutation.js.map +1 -0
- package/lib/typescript/App.d.ts +1 -1
- package/lib/typescript/App.d.ts.map +1 -1
- package/lib/typescript/FAQ.d.ts +4 -0
- package/lib/typescript/FAQ.d.ts.map +1 -0
- package/lib/typescript/Greetings.d.ts +4 -0
- package/lib/typescript/Greetings.d.ts.map +1 -0
- package/lib/typescript/Social.d.ts +4 -0
- package/lib/typescript/Social.d.ts.map +1 -0
- package/lib/typescript/Support.d.ts +4 -0
- package/lib/typescript/Support.d.ts.map +1 -0
- package/lib/typescript/Supporters.d.ts +4 -0
- package/lib/typescript/Supporters.d.ts.map +1 -0
- package/lib/typescript/Widget.d.ts +4 -0
- package/lib/typescript/Widget.d.ts.map +1 -0
- package/lib/typescript/apolloClient.d.ts +6 -0
- package/lib/typescript/apolloClient.d.ts.map +1 -0
- package/lib/typescript/assets/images/index.d.ts +8 -0
- package/lib/typescript/assets/images/index.d.ts.map +1 -0
- package/lib/typescript/graphql/graphql.d.ts +6 -0
- package/lib/typescript/graphql/graphql.d.ts.map +1 -0
- package/lib/typescript/graphql/mutation.d.ts +3 -0
- package/lib/typescript/graphql/mutation.d.ts.map +1 -0
- package/package.json +9 -5
- package/src/App.tsx +8 -42
- package/src/FAQ.tsx +166 -0
- package/src/Greetings.tsx +37 -0
- package/src/Social.tsx +46 -0
- package/src/Support.tsx +74 -0
- package/src/Supporters.tsx +63 -0
- package/src/Widget.tsx +138 -0
- package/src/apolloClient.ts +57 -0
- package/src/assets/images/Facebook.png +0 -0
- package/src/assets/images/Twitter.png +0 -0
- package/src/assets/images/Youtube.png +0 -0
- package/src/assets/images/avatar.png +0 -0
- package/src/assets/images/index.ts +8 -0
- package/src/graphql/graphql.ts +108 -0
- package/src/graphql/mutation.ts +42 -0
- package/lib/commonjs/index.html +0 -114
- package/lib/module/index.html +0 -114
- package/src/index.html +0 -114
package/src/Widget.tsx
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/* eslint-disable react-native/no-inline-styles */
|
|
2
|
+
import { View, StyleSheet, TouchableOpacity, Text } from 'react-native';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { useMutation } from '@apollo/client';
|
|
5
|
+
import { connect } from './graphql/mutation';
|
|
6
|
+
import Greetings from './Greetings';
|
|
7
|
+
import Support from './Support';
|
|
8
|
+
import FAQ from './FAQ';
|
|
9
|
+
|
|
10
|
+
const Widget = (props: any) => {
|
|
11
|
+
const { brandCode } = props;
|
|
12
|
+
const [response, setResponse] = React.useState<any>(null);
|
|
13
|
+
const [index, setIndex] = React.useState<number>(0);
|
|
14
|
+
const [connectMutation] = useMutation(connect);
|
|
15
|
+
|
|
16
|
+
React.useEffect(() => {
|
|
17
|
+
connectMutation({
|
|
18
|
+
variables: {
|
|
19
|
+
brandCode,
|
|
20
|
+
cachedCustomerId: null,
|
|
21
|
+
visitorId: '20675ab50c23e7c8c615a8f4ab9107e2',
|
|
22
|
+
isUser: false,
|
|
23
|
+
},
|
|
24
|
+
})
|
|
25
|
+
.then((res: any) => {
|
|
26
|
+
setResponse(res);
|
|
27
|
+
console.log(res);
|
|
28
|
+
})
|
|
29
|
+
.catch((err) => {
|
|
30
|
+
console.log(err);
|
|
31
|
+
});
|
|
32
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
33
|
+
}, []);
|
|
34
|
+
|
|
35
|
+
const bgColor = response?.data?.widgetsMessengerConnect?.uiOptions?.color;
|
|
36
|
+
const integrationId = response?.data?.widgetsMessengerConnect?.integrationId;
|
|
37
|
+
const knowledgeBaseTopicId =
|
|
38
|
+
response?.data?.widgetsMessengerConnect?.messengerData
|
|
39
|
+
?.knowledgeBaseTopicId;
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<View style={styles.container}>
|
|
43
|
+
<Greetings
|
|
44
|
+
greetings={response?.data?.widgetsMessengerConnect?.messengerData}
|
|
45
|
+
bgColor={bgColor}
|
|
46
|
+
integrationId={integrationId}
|
|
47
|
+
/>
|
|
48
|
+
<TabBar index={index} setIndex={setIndex} bgColor={bgColor} />
|
|
49
|
+
{index === 0 ? (
|
|
50
|
+
<Support
|
|
51
|
+
customerId={'7o6DA3tFhM5EXRWZX'}
|
|
52
|
+
integrationId={integrationId}
|
|
53
|
+
/>
|
|
54
|
+
) : (
|
|
55
|
+
<FAQ knowledgeBaseTopicId={knowledgeBaseTopicId} />
|
|
56
|
+
)}
|
|
57
|
+
</View>
|
|
58
|
+
);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export default Widget;
|
|
62
|
+
|
|
63
|
+
const TabBar = (props: any) => {
|
|
64
|
+
const { index, setIndex, bgColor } = props;
|
|
65
|
+
return (
|
|
66
|
+
<View
|
|
67
|
+
style={{
|
|
68
|
+
backgroundColor: '#fff',
|
|
69
|
+
flexDirection: 'row',
|
|
70
|
+
padding: 3,
|
|
71
|
+
marginBottom: 3,
|
|
72
|
+
borderColor: '#E5E5E5',
|
|
73
|
+
borderWidth: 0.3,
|
|
74
|
+
}}
|
|
75
|
+
>
|
|
76
|
+
<TouchableOpacity onPress={() => setIndex(0)} style={{ flex: 1 }}>
|
|
77
|
+
<View
|
|
78
|
+
style={{
|
|
79
|
+
backgroundColor: index === 0 ? bgColor : 'transparent',
|
|
80
|
+
borderRadius: 5,
|
|
81
|
+
shadowColor: bgColor,
|
|
82
|
+
shadowOffset: {
|
|
83
|
+
width: 0,
|
|
84
|
+
height: index === 0 ? 2 : 0,
|
|
85
|
+
},
|
|
86
|
+
shadowOpacity: 0.5,
|
|
87
|
+
shadowRadius: index === 0 ? 3.84 : 0,
|
|
88
|
+
elevation: index === 0 ? 5 : 0,
|
|
89
|
+
}}
|
|
90
|
+
>
|
|
91
|
+
<Text
|
|
92
|
+
style={{
|
|
93
|
+
textAlign: 'center',
|
|
94
|
+
color: index === 0 ? 'white' : 'black',
|
|
95
|
+
paddingVertical: 10,
|
|
96
|
+
fontWeight: '600',
|
|
97
|
+
}}
|
|
98
|
+
>
|
|
99
|
+
Support
|
|
100
|
+
</Text>
|
|
101
|
+
</View>
|
|
102
|
+
</TouchableOpacity>
|
|
103
|
+
<TouchableOpacity
|
|
104
|
+
onPress={() => setIndex(1)}
|
|
105
|
+
style={{
|
|
106
|
+
flex: 1,
|
|
107
|
+
backgroundColor: index === 1 ? bgColor : 'transparent',
|
|
108
|
+
borderRadius: 5,
|
|
109
|
+
shadowColor: bgColor,
|
|
110
|
+
shadowOffset: {
|
|
111
|
+
width: 0,
|
|
112
|
+
height: index === 1 ? 2 : 0,
|
|
113
|
+
},
|
|
114
|
+
shadowOpacity: 0.5,
|
|
115
|
+
shadowRadius: index === 1 ? 3.84 : 0,
|
|
116
|
+
elevation: index === 1 ? 5 : 0,
|
|
117
|
+
}}
|
|
118
|
+
>
|
|
119
|
+
<Text
|
|
120
|
+
style={{
|
|
121
|
+
paddingVertical: 10,
|
|
122
|
+
color: index === 1 ? 'white' : 'black',
|
|
123
|
+
textAlign: 'center',
|
|
124
|
+
fontWeight: '600',
|
|
125
|
+
}}
|
|
126
|
+
>
|
|
127
|
+
FAQ
|
|
128
|
+
</Text>
|
|
129
|
+
</TouchableOpacity>
|
|
130
|
+
</View>
|
|
131
|
+
);
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
const styles = StyleSheet.create({
|
|
135
|
+
container: {
|
|
136
|
+
flex: 1,
|
|
137
|
+
},
|
|
138
|
+
});
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ApolloClient,
|
|
3
|
+
InMemoryCache,
|
|
4
|
+
split,
|
|
5
|
+
from,
|
|
6
|
+
createHttpLink,
|
|
7
|
+
} from '@apollo/client/core';
|
|
8
|
+
import { onError } from '@apollo/client/link/error';
|
|
9
|
+
import { getMainDefinition } from '@apollo/client/utilities';
|
|
10
|
+
import { createClient } from 'graphql-ws';
|
|
11
|
+
import { GraphQLWsLink } from '@apollo/client/link/subscriptions';
|
|
12
|
+
|
|
13
|
+
const baseUrl = 'office.erxes.io/gateway';
|
|
14
|
+
|
|
15
|
+
export const apiUrl = `https://${baseUrl}`;
|
|
16
|
+
|
|
17
|
+
// Subscription config
|
|
18
|
+
export const wsLink: any = new GraphQLWsLink(
|
|
19
|
+
createClient({
|
|
20
|
+
url: `wss://${baseUrl}/graphql` || 'ws://localhost:4000/graphql',
|
|
21
|
+
retryAttempts: 1000,
|
|
22
|
+
retryWait: async () => {
|
|
23
|
+
await new Promise((resolve) => setTimeout(resolve, 5000));
|
|
24
|
+
},
|
|
25
|
+
})
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
const logoutLink = onError(({ networkError, graphQLErrors }) => {
|
|
29
|
+
console.log('--netError', networkError);
|
|
30
|
+
console.log('--gqlError', graphQLErrors);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const httpLink = createHttpLink({
|
|
34
|
+
uri: `${apiUrl}/graphql`,
|
|
35
|
+
credentials: 'include',
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const splitLink = split(
|
|
39
|
+
({ query }) => {
|
|
40
|
+
const definition = getMainDefinition(query);
|
|
41
|
+
return (
|
|
42
|
+
definition.kind === 'OperationDefinition' &&
|
|
43
|
+
definition.operation === 'subscription'
|
|
44
|
+
);
|
|
45
|
+
},
|
|
46
|
+
wsLink,
|
|
47
|
+
from([logoutLink, httpLink])
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
const ClientProvider = () =>
|
|
51
|
+
new ApolloClient({
|
|
52
|
+
link: splitLink,
|
|
53
|
+
cache: new InMemoryCache(),
|
|
54
|
+
defaultOptions: { watchQuery: { fetchPolicy: 'network-only' } },
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
export default ClientProvider;
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { gql } from '@apollo/client';
|
|
2
|
+
|
|
3
|
+
const widgetsMessengerSupporters = gql`
|
|
4
|
+
query widgetsMessengerSupporters($integrationId: String!) {
|
|
5
|
+
widgetsMessengerSupporters(integrationId: $integrationId) {
|
|
6
|
+
supporters {
|
|
7
|
+
_id
|
|
8
|
+
isActive
|
|
9
|
+
details {
|
|
10
|
+
avatar
|
|
11
|
+
fullName
|
|
12
|
+
shortName
|
|
13
|
+
location
|
|
14
|
+
__typename
|
|
15
|
+
}
|
|
16
|
+
isOnline
|
|
17
|
+
__typename
|
|
18
|
+
}
|
|
19
|
+
isOnline
|
|
20
|
+
__typename
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
|
|
25
|
+
const widgetsConversations = gql`
|
|
26
|
+
query widgetsConversations(
|
|
27
|
+
$integrationId: String!
|
|
28
|
+
$customerId: String
|
|
29
|
+
$visitorId: String
|
|
30
|
+
) {
|
|
31
|
+
widgetsConversations(
|
|
32
|
+
integrationId: $integrationId
|
|
33
|
+
customerId: $customerId
|
|
34
|
+
visitorId: $visitorId
|
|
35
|
+
) {
|
|
36
|
+
_id
|
|
37
|
+
content
|
|
38
|
+
createdAt
|
|
39
|
+
participatedUsers {
|
|
40
|
+
details {
|
|
41
|
+
avatar
|
|
42
|
+
fullName
|
|
43
|
+
__typename
|
|
44
|
+
}
|
|
45
|
+
__typename
|
|
46
|
+
}
|
|
47
|
+
__typename
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
`;
|
|
51
|
+
|
|
52
|
+
const knowledgeBaseTopicDetail = gql`
|
|
53
|
+
query knowledgeBaseTopicDetail($_id: String!) {
|
|
54
|
+
knowledgeBaseTopicDetail(_id: $_id) {
|
|
55
|
+
title
|
|
56
|
+
description
|
|
57
|
+
categories {
|
|
58
|
+
_id
|
|
59
|
+
title
|
|
60
|
+
description
|
|
61
|
+
numOfArticles
|
|
62
|
+
parentCategoryId
|
|
63
|
+
icon
|
|
64
|
+
__typename
|
|
65
|
+
}
|
|
66
|
+
parentCategories {
|
|
67
|
+
_id
|
|
68
|
+
title
|
|
69
|
+
description
|
|
70
|
+
numOfArticles
|
|
71
|
+
parentCategoryId
|
|
72
|
+
icon
|
|
73
|
+
__typename
|
|
74
|
+
}
|
|
75
|
+
__typename
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
`;
|
|
79
|
+
|
|
80
|
+
const knowledgeBaseCategoryDetail = gql`
|
|
81
|
+
query knowledgeBaseCategoryDetail($_id: String!) {
|
|
82
|
+
knowledgeBaseCategoryDetail(_id: $_id) {
|
|
83
|
+
_id
|
|
84
|
+
title
|
|
85
|
+
description
|
|
86
|
+
numOfArticles
|
|
87
|
+
parentCategoryId
|
|
88
|
+
icon
|
|
89
|
+
parentCategoryId
|
|
90
|
+
articles {
|
|
91
|
+
_id
|
|
92
|
+
title
|
|
93
|
+
summary
|
|
94
|
+
content
|
|
95
|
+
createdDate
|
|
96
|
+
__typename
|
|
97
|
+
}
|
|
98
|
+
__typename
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
`;
|
|
102
|
+
|
|
103
|
+
export {
|
|
104
|
+
widgetsMessengerSupporters,
|
|
105
|
+
widgetsConversations,
|
|
106
|
+
knowledgeBaseTopicDetail,
|
|
107
|
+
knowledgeBaseCategoryDetail,
|
|
108
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { gql } from '@apollo/client';
|
|
2
|
+
|
|
3
|
+
const connect = gql`
|
|
4
|
+
mutation connect(
|
|
5
|
+
$brandCode: String!
|
|
6
|
+
$email: String
|
|
7
|
+
$phone: String
|
|
8
|
+
$code: String
|
|
9
|
+
$isUser: Boolean
|
|
10
|
+
$data: JSON
|
|
11
|
+
$companyData: JSON
|
|
12
|
+
$cachedCustomerId: String
|
|
13
|
+
$visitorId: String
|
|
14
|
+
) {
|
|
15
|
+
widgetsMessengerConnect(
|
|
16
|
+
brandCode: $brandCode
|
|
17
|
+
email: $email
|
|
18
|
+
phone: $phone
|
|
19
|
+
code: $code
|
|
20
|
+
isUser: $isUser
|
|
21
|
+
data: $data
|
|
22
|
+
companyData: $companyData
|
|
23
|
+
cachedCustomerId: $cachedCustomerId
|
|
24
|
+
visitorId: $visitorId
|
|
25
|
+
) {
|
|
26
|
+
integrationId
|
|
27
|
+
messengerData
|
|
28
|
+
languageCode
|
|
29
|
+
uiOptions
|
|
30
|
+
customerId
|
|
31
|
+
visitorId
|
|
32
|
+
brand {
|
|
33
|
+
name
|
|
34
|
+
description
|
|
35
|
+
__typename
|
|
36
|
+
}
|
|
37
|
+
__typename
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
`;
|
|
41
|
+
|
|
42
|
+
export { connect };
|
package/lib/commonjs/index.html
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
<html>
|
|
2
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
3
|
-
<meta charset="utf-8" />
|
|
4
|
-
|
|
5
|
-
<body id="mbody" onload="openMessenger()"></body>
|
|
6
|
-
<script>
|
|
7
|
-
function openMessenger() {
|
|
8
|
-
setTimeout(function () {
|
|
9
|
-
window.Erxes.showMessenger();
|
|
10
|
-
}, 3000);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
window.addEventListener('message', (e) => {
|
|
14
|
-
const { data } = e;
|
|
15
|
-
const { notificationCount } = data;
|
|
16
|
-
|
|
17
|
-
if (notificationCount !== undefined) {
|
|
18
|
-
window.ReactNativeWebView.postMessage(JSON.stringify(data));
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
</script>
|
|
22
|
-
|
|
23
|
-
<style>
|
|
24
|
-
#mbody {
|
|
25
|
-
align-items: center;
|
|
26
|
-
justify-content: center;
|
|
27
|
-
background-color: rgb(189, 189, 188);
|
|
28
|
-
display: flex;
|
|
29
|
-
/* flex-direction: column; */
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.topbar-button {
|
|
33
|
-
visibility: hidden;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.loader {
|
|
37
|
-
border: 5px solid #f3f3f3;
|
|
38
|
-
/* Light grey */
|
|
39
|
-
border-top: 5px solid #3498db;
|
|
40
|
-
/* Blue */
|
|
41
|
-
border-radius: 50%;
|
|
42
|
-
width: 50px;
|
|
43
|
-
height: 50px;
|
|
44
|
-
animation: spin 5s linear infinite;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
@keyframes spin {
|
|
48
|
-
0% {
|
|
49
|
-
transform: rotate(0deg);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
100% {
|
|
53
|
-
transform: rotate(360deg);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/* CSS */
|
|
58
|
-
.button-75 {
|
|
59
|
-
align-items: center;
|
|
60
|
-
background-image: linear-gradient(135deg, #f34079 40%, #fc894d);
|
|
61
|
-
border: 0;
|
|
62
|
-
border-radius: 10px;
|
|
63
|
-
box-sizing: border-box;
|
|
64
|
-
color: #fff;
|
|
65
|
-
cursor: pointer;
|
|
66
|
-
display: flex;
|
|
67
|
-
flex-direction: column;
|
|
68
|
-
/* font-family: "Codec cold", sans-serif; */
|
|
69
|
-
font-size: 16px;
|
|
70
|
-
font-weight: 700;
|
|
71
|
-
height: 54px;
|
|
72
|
-
justify-content: center;
|
|
73
|
-
letter-spacing: 0.4px;
|
|
74
|
-
line-height: 1;
|
|
75
|
-
max-width: 100%;
|
|
76
|
-
padding-left: 20px;
|
|
77
|
-
padding-right: 20px;
|
|
78
|
-
padding-top: 3px;
|
|
79
|
-
text-decoration: none;
|
|
80
|
-
text-transform: uppercase;
|
|
81
|
-
user-select: none;
|
|
82
|
-
-webkit-user-select: none;
|
|
83
|
-
touch-action: manipulation;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.button-75:active {
|
|
87
|
-
outline: 0;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.button-75:hover {
|
|
91
|
-
outline: 0;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.button-75 span {
|
|
95
|
-
transition: all 200ms;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.button-75:hover span {
|
|
99
|
-
transform: scale(0.9);
|
|
100
|
-
opacity: 0.75;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
@media screen and (max-width: 991px) {
|
|
104
|
-
.button-75 {
|
|
105
|
-
font-size: 15px;
|
|
106
|
-
height: 50px;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
.button-75 span {
|
|
110
|
-
line-height: 50px;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
</style>
|
|
114
|
-
</html>
|
package/lib/module/index.html
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
<html>
|
|
2
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
3
|
-
<meta charset="utf-8" />
|
|
4
|
-
|
|
5
|
-
<body id="mbody" onload="openMessenger()"></body>
|
|
6
|
-
<script>
|
|
7
|
-
function openMessenger() {
|
|
8
|
-
setTimeout(function () {
|
|
9
|
-
window.Erxes.showMessenger();
|
|
10
|
-
}, 3000);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
window.addEventListener('message', (e) => {
|
|
14
|
-
const { data } = e;
|
|
15
|
-
const { notificationCount } = data;
|
|
16
|
-
|
|
17
|
-
if (notificationCount !== undefined) {
|
|
18
|
-
window.ReactNativeWebView.postMessage(JSON.stringify(data));
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
</script>
|
|
22
|
-
|
|
23
|
-
<style>
|
|
24
|
-
#mbody {
|
|
25
|
-
align-items: center;
|
|
26
|
-
justify-content: center;
|
|
27
|
-
background-color: rgb(189, 189, 188);
|
|
28
|
-
display: flex;
|
|
29
|
-
/* flex-direction: column; */
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.topbar-button {
|
|
33
|
-
visibility: hidden;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.loader {
|
|
37
|
-
border: 5px solid #f3f3f3;
|
|
38
|
-
/* Light grey */
|
|
39
|
-
border-top: 5px solid #3498db;
|
|
40
|
-
/* Blue */
|
|
41
|
-
border-radius: 50%;
|
|
42
|
-
width: 50px;
|
|
43
|
-
height: 50px;
|
|
44
|
-
animation: spin 5s linear infinite;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
@keyframes spin {
|
|
48
|
-
0% {
|
|
49
|
-
transform: rotate(0deg);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
100% {
|
|
53
|
-
transform: rotate(360deg);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/* CSS */
|
|
58
|
-
.button-75 {
|
|
59
|
-
align-items: center;
|
|
60
|
-
background-image: linear-gradient(135deg, #f34079 40%, #fc894d);
|
|
61
|
-
border: 0;
|
|
62
|
-
border-radius: 10px;
|
|
63
|
-
box-sizing: border-box;
|
|
64
|
-
color: #fff;
|
|
65
|
-
cursor: pointer;
|
|
66
|
-
display: flex;
|
|
67
|
-
flex-direction: column;
|
|
68
|
-
/* font-family: "Codec cold", sans-serif; */
|
|
69
|
-
font-size: 16px;
|
|
70
|
-
font-weight: 700;
|
|
71
|
-
height: 54px;
|
|
72
|
-
justify-content: center;
|
|
73
|
-
letter-spacing: 0.4px;
|
|
74
|
-
line-height: 1;
|
|
75
|
-
max-width: 100%;
|
|
76
|
-
padding-left: 20px;
|
|
77
|
-
padding-right: 20px;
|
|
78
|
-
padding-top: 3px;
|
|
79
|
-
text-decoration: none;
|
|
80
|
-
text-transform: uppercase;
|
|
81
|
-
user-select: none;
|
|
82
|
-
-webkit-user-select: none;
|
|
83
|
-
touch-action: manipulation;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.button-75:active {
|
|
87
|
-
outline: 0;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.button-75:hover {
|
|
91
|
-
outline: 0;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.button-75 span {
|
|
95
|
-
transition: all 200ms;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.button-75:hover span {
|
|
99
|
-
transform: scale(0.9);
|
|
100
|
-
opacity: 0.75;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
@media screen and (max-width: 991px) {
|
|
104
|
-
.button-75 {
|
|
105
|
-
font-size: 15px;
|
|
106
|
-
height: 50px;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
.button-75 span {
|
|
110
|
-
line-height: 50px;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
</style>
|
|
114
|
-
</html>
|
package/src/index.html
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
<html>
|
|
2
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
3
|
-
<meta charset="utf-8" />
|
|
4
|
-
|
|
5
|
-
<body id="mbody" onload="openMessenger()"></body>
|
|
6
|
-
<script>
|
|
7
|
-
function openMessenger() {
|
|
8
|
-
setTimeout(function () {
|
|
9
|
-
window.Erxes.showMessenger();
|
|
10
|
-
}, 3000);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
window.addEventListener('message', (e) => {
|
|
14
|
-
const { data } = e;
|
|
15
|
-
const { notificationCount } = data;
|
|
16
|
-
|
|
17
|
-
if (notificationCount !== undefined) {
|
|
18
|
-
window.ReactNativeWebView.postMessage(JSON.stringify(data));
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
</script>
|
|
22
|
-
|
|
23
|
-
<style>
|
|
24
|
-
#mbody {
|
|
25
|
-
align-items: center;
|
|
26
|
-
justify-content: center;
|
|
27
|
-
background-color: rgb(189, 189, 188);
|
|
28
|
-
display: flex;
|
|
29
|
-
/* flex-direction: column; */
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.topbar-button {
|
|
33
|
-
visibility: hidden;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.loader {
|
|
37
|
-
border: 5px solid #f3f3f3;
|
|
38
|
-
/* Light grey */
|
|
39
|
-
border-top: 5px solid #3498db;
|
|
40
|
-
/* Blue */
|
|
41
|
-
border-radius: 50%;
|
|
42
|
-
width: 50px;
|
|
43
|
-
height: 50px;
|
|
44
|
-
animation: spin 5s linear infinite;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
@keyframes spin {
|
|
48
|
-
0% {
|
|
49
|
-
transform: rotate(0deg);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
100% {
|
|
53
|
-
transform: rotate(360deg);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/* CSS */
|
|
58
|
-
.button-75 {
|
|
59
|
-
align-items: center;
|
|
60
|
-
background-image: linear-gradient(135deg, #f34079 40%, #fc894d);
|
|
61
|
-
border: 0;
|
|
62
|
-
border-radius: 10px;
|
|
63
|
-
box-sizing: border-box;
|
|
64
|
-
color: #fff;
|
|
65
|
-
cursor: pointer;
|
|
66
|
-
display: flex;
|
|
67
|
-
flex-direction: column;
|
|
68
|
-
/* font-family: "Codec cold", sans-serif; */
|
|
69
|
-
font-size: 16px;
|
|
70
|
-
font-weight: 700;
|
|
71
|
-
height: 54px;
|
|
72
|
-
justify-content: center;
|
|
73
|
-
letter-spacing: 0.4px;
|
|
74
|
-
line-height: 1;
|
|
75
|
-
max-width: 100%;
|
|
76
|
-
padding-left: 20px;
|
|
77
|
-
padding-right: 20px;
|
|
78
|
-
padding-top: 3px;
|
|
79
|
-
text-decoration: none;
|
|
80
|
-
text-transform: uppercase;
|
|
81
|
-
user-select: none;
|
|
82
|
-
-webkit-user-select: none;
|
|
83
|
-
touch-action: manipulation;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.button-75:active {
|
|
87
|
-
outline: 0;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.button-75:hover {
|
|
91
|
-
outline: 0;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.button-75 span {
|
|
95
|
-
transition: all 200ms;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.button-75:hover span {
|
|
99
|
-
transform: scale(0.9);
|
|
100
|
-
opacity: 0.75;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
@media screen and (max-width: 991px) {
|
|
104
|
-
.button-75 {
|
|
105
|
-
font-size: 15px;
|
|
106
|
-
height: 50px;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
.button-75 span {
|
|
110
|
-
line-height: 50px;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
</style>
|
|
114
|
-
</html>
|