codenotch-react 1.0.1 → 1.0.2
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/index.js +25 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,7 +1,31 @@
|
|
|
1
|
+
const React = require('react');
|
|
2
|
+
|
|
1
3
|
const CODENOTCH_ENV = {
|
|
2
4
|
|
|
3
5
|
};
|
|
4
6
|
|
|
7
|
+
class CodenotchAppComponent extends React.Component {
|
|
8
|
+
constructor(props) {
|
|
9
|
+
super(props);
|
|
10
|
+
// Initialiser l'environnement Codenotch avec les props
|
|
11
|
+
if (props.clusterUrl) {
|
|
12
|
+
CODENOTCH_ENV.clusterUrl = props.clusterUrl;
|
|
13
|
+
}
|
|
14
|
+
if (props.serviceName) {
|
|
15
|
+
CODENOTCH_ENV.serviceName = props.serviceName;
|
|
16
|
+
}
|
|
17
|
+
if (props.tenantName) {
|
|
18
|
+
CODENOTCH_ENV.tenantName = props.tenantName;
|
|
19
|
+
}
|
|
20
|
+
if (props.userId) {
|
|
21
|
+
CODENOTCH_ENV.userId = props.userId;
|
|
22
|
+
}
|
|
23
|
+
if (props.accessToken) {
|
|
24
|
+
CODENOTCH_ENV.accessToken = props.accessToken;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
5
29
|
function useCodenotch() {
|
|
6
30
|
console.log("useCodenotch has been called");
|
|
7
31
|
return {
|
|
@@ -103,4 +127,4 @@ function useCodenotchApp(props) {
|
|
|
103
127
|
return useCodenotch();
|
|
104
128
|
}
|
|
105
129
|
|
|
106
|
-
module.exports = { useCodenotch, useCodenotchApp };
|
|
130
|
+
module.exports = { useCodenotch, useCodenotchApp, CodenotchAppComponent };
|