diff --git a/components/CustomModal.js b/components/CustomModal.js
new file mode 100644
index 0000000..99b38d6
--- /dev/null
+++ b/components/CustomModal.js
@@ -0,0 +1,23 @@
+// @flow
+
+import * as React from 'react';
+import {withTheme} from 'react-native-paper';
+import {Modalize} from "react-native-modalize";
+
+function CustomModal(props) {
+ const { colors } = props.theme;
+ return (
+
+ {props.children}
+
+ );
+}
+
+export default withTheme(CustomModal);
+
diff --git a/screens/About/AboutScreen.js b/screens/About/AboutScreen.js
index 54e257e..69edff9 100644
--- a/screens/About/AboutScreen.js
+++ b/screens/About/AboutScreen.js
@@ -5,7 +5,7 @@ import {FlatList, Linking, Platform, View} from 'react-native';
import i18n from "i18n-js";
import appJson from '../../app';
import AsyncStorageManager from "../../utils/AsyncStorageManager";
-import {Modalize} from "react-native-modalize";
+import CustomModal from "../../components/CustomModal";
import ThemeManager from "../../utils/ThemeManager";
import {Avatar, Button, Card, List, Text, Title} from 'react-native-paper';
@@ -62,7 +62,7 @@ function openWebLink(link) {
export default class AboutScreen extends React.Component {
debugTapCounter = 0;
- modalRef: { current: null | Modalize };
+ modalRef: Object;
state = {
isDebugUnlocked: AsyncStorageManager.getInstance().preferences.debugUnlocked.current === '1'
@@ -186,12 +186,13 @@ export default class AboutScreen extends React.Component {
getCardItem: Function;
getMainCard: Function;
+ onModalRef: Function;
constructor(props: any) {
super(props);
- this.modalRef = React.createRef();
this.getCardItem = this.getCardItem.bind(this);
this.getMainCard = this.getMainCard.bind(this);
+ this.onModalRef = this.onModalRef.bind(this);
}
getAppCard() {
@@ -309,54 +310,47 @@ export default class AboutScreen extends React.Component {
const onPressMail = openWebLink.bind(this, links.bugsMail);
const onPressGit = openWebLink.bind(this, links.bugsGit);
return (
-
-
- {i18n.t('aboutScreen.bugs')}
-
- {i18n.t('aboutScreen.bugsDescription')}
-
-
-
-
-
+
+ {i18n.t('aboutScreen.bugs')}
+
+ {i18n.t('aboutScreen.bugsDescription')}
+
+
+
+
);
}
openBugReportModal() {
- if (this.modalRef.current) {
- this.modalRef.current.open();
+ if (this.modalRef) {
+ this.modalRef.open();
}
}
@@ -372,10 +366,16 @@ export default class AboutScreen extends React.Component {
return ;
}
+ onModalRef(ref: Object) {
+ this.modalRef = ref;
+ }
+
render() {
return (
- {this.getBugReportModal()}
+
+ {this.getBugReportModal()}
+
{
- modalRef: { current: null | Modalize };
+ modalRef: Object;
modalInputValue = '';
state = {
modalCurrentDisplayItem: {},
currentPreferences: JSON.parse(JSON.stringify(AsyncStorageManager.getInstance().preferences))
};
+ onModalRef: Function;
+
constructor(props: any) {
super(props);
- this.modalRef = React.createRef();
+ this.onModalRef = this.onModalRef.bind(this);
}
static getGeneralItem(onPressCallback: Function, icon: ?string, title: string, subtitle: string) {
@@ -76,8 +78,8 @@ export default class DebugScreen extends React.Component {
this.setState({
modalCurrentDisplayItem: item
});
- if (this.modalRef.current) {
- this.modalRef.current.open();
+ if (this.modalRef) {
+ this.modalRef.open();
}
}
@@ -127,15 +129,16 @@ export default class DebugScreen extends React.Component {
AsyncStorageManager.getInstance().savePref(key, value);
}
+ onModalRef(ref: Object) {
+ this.modalRef = ref;
+ }
+
render() {
return (
-
+
{this.getModalContent()}
-
+
{
- modalRef: { current: null | Modalize };
+ modalRef: Object;
originalData: Array