Add install call
This commit is contained in:
parent
f9f0707687
commit
9a77fef3dc
7 changed files with 5349 additions and 31 deletions
|
|
@ -1,3 +1,6 @@
|
|||
# ComApp
|
||||
## Dependencies
|
||||
- i18n-js
|
||||
- i18n-js
|
||||
- @react-native-community/netinfo
|
||||
- axios
|
||||
- lodash
|
||||
4246
ComApp/package-lock.json
generated
4246
ComApp/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -10,7 +10,12 @@
|
|||
"lint": "eslint ."
|
||||
},
|
||||
"dependencies": {
|
||||
"@react-native-community/netinfo": "^9.3.2",
|
||||
"axios": "^0.27.2",
|
||||
"i18n-js": "^4.1.1",
|
||||
"install": "^0.13.0",
|
||||
"lodash": "^4.17.21",
|
||||
"npm": "^8.19.2",
|
||||
"react": "18.1.0",
|
||||
"react-native": "0.70.1"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,7 +1,61 @@
|
|||
// Lodash
|
||||
import _ from 'lodash';
|
||||
// Http Client
|
||||
import axios from 'axios';
|
||||
// Network Infos
|
||||
import NetInfo from "@react-native-community/netinfo";
|
||||
// Translations
|
||||
import i18n from "../../I18n";
|
||||
|
||||
const api_token = 'toto';
|
||||
|
||||
class InstallController {
|
||||
|
||||
getConfig(url) {
|
||||
console.log(url);
|
||||
NetInfo.fetch().then(state => {
|
||||
if (state.isConnected) {
|
||||
axios({
|
||||
method: 'GET',
|
||||
url: url + '/api/settings',
|
||||
responseType: 'json',
|
||||
params: {
|
||||
token: api_token
|
||||
},
|
||||
})
|
||||
.then(function (response) {
|
||||
if (response.data) {
|
||||
if (response.data.status === "OK") {
|
||||
_.forEach(response.data.datas, function (value, key) {
|
||||
switch (key) {
|
||||
case "MainColor":
|
||||
console.log("MainColor");
|
||||
break;
|
||||
case "SquaredLogo":
|
||||
console.log("SquaredLogo");
|
||||
break;
|
||||
case "RectangleLogo":
|
||||
console.log("RectangleLogo");
|
||||
break;
|
||||
case "BackgroundImage":
|
||||
console.log("BackgroundImage");
|
||||
break;
|
||||
case "HomeButtonImage":
|
||||
console.log("HomeButtonImage");
|
||||
break;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
alert(i18n.t("error.error_has_occurred"));
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
alert(i18n.t("error.error_has_occurred"));
|
||||
})
|
||||
} else {
|
||||
alert(i18n.t("error.tablet_not_connected_internet"));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import React from 'react';
|
||||
import { ImageBackground, View, Image, TextInput, Button, StyleSheet } from 'react-native';
|
||||
// Helpers
|
||||
import Helpers from '../../Helpers';
|
||||
import Helpers from '../Lib/Helpers';
|
||||
// Common Styles
|
||||
import commonStyles from '../../Resources/CommonStyles';
|
||||
// Translations
|
||||
|
|
@ -11,7 +11,7 @@ import InstallController from '../Controllers/InstallController';
|
|||
|
||||
class InstallScreen extends React.Component {
|
||||
state = {
|
||||
url: "",
|
||||
url: "https://dev-app.rhd-ldc.fr",
|
||||
}
|
||||
|
||||
render() {
|
||||
|
|
|
|||
1064
ComApp/yarn.lock
1064
ComApp/yarn.lock
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue