From ae836d3714da4bb5d5060b53a0d548ba1c41ecb6 Mon Sep 17 00:00:00 2001 From: Naod Yeheyes Date: Sun, 3 May 2020 03:49:14 -0400 Subject: [PATCH] Added temporary firestore fix for https://github.com/firebase/firebase-js-sdk/issues/2991 --- index.js | 1 + package.json | 9 +++++---- src/App.js | 22 +++++++++++++++++++--- src/api/firebase/config/.gitkeep | 0 src/components/SelfCheck/index.js | 2 +- src/screens/HomeScreen.js | 2 +- yarn.lock | 13 +++++++++---- 7 files changed, 36 insertions(+), 13 deletions(-) create mode 100644 src/api/firebase/config/.gitkeep diff --git a/index.js b/index.js index 21e2753..b7e6e83 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,5 @@ import 'react-native-gesture-handler'; + import { registerRootComponent } from 'expo'; import App from './src/App'; diff --git a/package.json b/package.json index a8337bb..dc11251 100644 --- a/package.json +++ b/package.json @@ -10,22 +10,23 @@ "deploy": "yarn deploy:hosting" }, "dependencies": { - "@react-native-community/masked-view": "^0.1.10", + "@react-native-community/masked-view": "^0.1.6", "@react-navigation/bottom-tabs": "^5.3.3", "@react-navigation/native": "^5.2.3", "@react-navigation/stack": "^5.2.18", + "base-64": "^0.1.0", "expo": "~37.0.3", "expo-localization": "^8.1.0", "expo-updates": "~0.1.0", - "firebase": "^7.14.2", + "firebase": "^7.9.0", "i18n-js": "^3.5.1", "react": "~16.9.0", "react-dom": "~16.9.0", "react-native": "~0.61.5", "react-native-gesture-handler": "^1.6.1", - "react-native-reanimated": "^1.8.0", + "react-native-reanimated": "^1.7.0", "react-native-safe-area-context": "^0.7.3", - "react-native-screens": "^2.7.0", + "react-native-screens": "^2.2.0", "react-native-unimodules": "~0.9.0", "react-native-web": "~0.11.7" }, diff --git a/src/App.js b/src/App.js index 6c50bca..3ddd07d 100644 --- a/src/App.js +++ b/src/App.js @@ -1,11 +1,27 @@ import React from 'react'; import * as Updates from 'expo-updates'; -import { StyleSheet, Text, View } from 'react-native'; -import * as Localization from 'expo-localization'; +import { StyleSheet } from 'react-native'; import i18n from 'i18n-js'; - import Navigation from './navigation'; +/** + * Temporary firestore issue fix + */ + +import { decode, encode } from 'base-64'; + +if (!global.btoa) { + global.btoa = encode; +} + +if (!global.atob) { + global.atob = decode; +} + +window.addEventListener = (x) => x; + +// End of fix + import eng from './localization/eng/translation.json'; import amh from './localization/amh/translation.json'; import orm from './localization/orm/translation.json'; diff --git a/src/api/firebase/config/.gitkeep b/src/api/firebase/config/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/src/components/SelfCheck/index.js b/src/components/SelfCheck/index.js index 3da0ccb..b0d36fc 100644 --- a/src/components/SelfCheck/index.js +++ b/src/components/SelfCheck/index.js @@ -46,4 +46,4 @@ const SelfCheck = () => { export default SelfCheck; -const styles = StyleSheet.create({ questions: { margin: 10, fontSize: 20 } }); +const styles = StyleSheet.create({ questions: { margin: 10, fontSize: 16 } }); diff --git a/src/screens/HomeScreen.js b/src/screens/HomeScreen.js index ab802b0..454ffe9 100644 --- a/src/screens/HomeScreen.js +++ b/src/screens/HomeScreen.js @@ -6,7 +6,7 @@ import { auth } from '../api/firebase'; const HomeScreen = ({ navigation }) => { return ( - Home Screen + Home Screen!