Browse Source

Send locale to notification server, fixed sidebar image on long displays

keplyx 4 years ago
parent
commit
a99e8da6e4
4 changed files with 8 additions and 3 deletions
  1. 1
    1
      app.json
  2. 1
    2
      components/Sidebar.js
  3. 4
    0
      utils/LocaleManager.js
  4. 2
    0
      utils/NotificationsManager.js

+ 1
- 1
app.json View File

10
       "android",
10
       "android",
11
       "web"
11
       "web"
12
     ],
12
     ],
13
-    "version": "0.0.10",
13
+    "version": "0.0.12",
14
     "orientation": "portrait",
14
     "orientation": "portrait",
15
     "primaryColor": "#be1522",
15
     "primaryColor": "#be1522",
16
     "icon": "./assets/android.icon.png",
16
     "icon": "./assets/android.icon.png",

+ 1
- 2
components/Sidebar.js View File

130
 
130
 
131
 const styles = StyleSheet.create({
131
 const styles = StyleSheet.create({
132
     drawerCover: {
132
     drawerCover: {
133
-        alignSelf: "stretch",
134
-        height: deviceHeight / 4,
133
+        height: deviceHeight / 5,
135
         width: null,
134
         width: null,
136
         position: "relative",
135
         position: "relative",
137
         marginBottom: 10,
136
         marginBottom: 10,

+ 4
- 0
utils/LocaleManager.js View File

19
         i18n.translations = {fr, en};
19
         i18n.translations = {fr, en};
20
         i18n.locale = Localization.locale;
20
         i18n.locale = Localization.locale;
21
     }
21
     }
22
+
23
+    static getCurrentLocale() {
24
+        return Localization.locale;
25
+    }
22
 }
26
 }

+ 2
- 0
utils/NotificationsManager.js View File

3
 import * as Permissions from 'expo-permissions';
3
 import * as Permissions from 'expo-permissions';
4
 import {Notifications} from 'expo';
4
 import {Notifications} from 'expo';
5
 import AsyncStorageManager from "./AsyncStorageManager";
5
 import AsyncStorageManager from "./AsyncStorageManager";
6
+import LocaleManager from "./LocaleManager";
6
 
7
 
7
 const EXPO_TOKEN_SERVER = 'https://srv-falcon.etud.insa-toulouse.fr/~amicale_app/expo_notifications/save_token.php';
8
 const EXPO_TOKEN_SERVER = 'https://srv-falcon.etud.insa-toulouse.fr/~amicale_app/expo_notifications/save_token.php';
8
 
9
 
139
         }
140
         }
140
         let data = {
141
         let data = {
141
             function: 'setup_machine_notification',
142
             function: 'setup_machine_notification',
143
+            locale: LocaleManager.getCurrentLocale(),
142
             token: token,
144
             token: token,
143
             machine_id: machineID,
145
             machine_id: machineID,
144
             enabled: isEnabled
146
             enabled: isEnabled

Loading…
Cancel
Save