remove warnings

This commit is contained in:
ammarahm-ed
2020-09-24 09:51:15 +05:00
parent 51d4921bbf
commit 7ed3939414
2 changed files with 18 additions and 16 deletions

View File

@@ -1,18 +1,21 @@
import React, {useEffect, useState} from 'react'; import React, {Fragment, useEffect, useState} from 'react';
import { import {
Modal, Modal,
Platform,
StyleSheet, StyleSheet,
Text, Text,
TouchableOpacity, TouchableOpacity,
View, View,
Platform,
} from 'react-native'; } from 'react-native';
import FileViewer from 'react-native-file-viewer';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import {opacity, ph, pv, SIZE, WEIGHT} from '../../common/common'; import {opacity, ph, pv, SIZE, WEIGHT} from '../../common/common';
import {useTracked} from '../../provider'; import {useTracked} from '../../provider';
import {DDS, getElevation, db, ToastEvent} from '../../utils/utils'; import storage from '../../utils/storage';
import {DDS, getElevation, ToastEvent} from '../../utils/utils';
import {Button} from '../Button/index';
import {Loading} from '../Loading'; import {Loading} from '../Loading';
import FileViewer from 'react-native-file-viewer'; import Seperator from '../Seperator';
const { const {
eSubscribeEvent, eSubscribeEvent,
@@ -22,10 +25,6 @@ const {
eOpenExportDialog, eOpenExportDialog,
eCloseExportDialog, eCloseExportDialog,
} = require('../../services/events'); } = require('../../services/events');
import {Button} from '../Button/index';
import Seperator from '../Seperator';
import storage from '../../utils/storage';
import RNFetchBlob from 'rn-fetch-blob';
const ExportDialog = () => { const ExportDialog = () => {
const [state, dispatch] = useTracked(); const [state, dispatch] = useTracked();
@@ -146,7 +145,7 @@ const ExportDialog = () => {
done={complete} done={complete}
doneText={doneText} doneText={doneText}
onDone={() => { onDone={() => {
console.log(result.type,result.filePath); console.log(result.type, result.filePath);
FileViewer.open(result.filePath, { FileViewer.open(result.filePath, {
showOpenWithDialog: true, showOpenWithDialog: true,
showAppsSuggestions: true, showAppsSuggestions: true,
@@ -174,7 +173,7 @@ const ExportDialog = () => {
</Text> </Text>
<View style={styles.buttonContainer}> <View style={styles.buttonContainer}>
{actions.map((item) => ( {actions.map((item) => (
<> <Fragment key={item.title}>
<Seperator half /> <Seperator half />
<Button <Button
width="100%" width="100%"
@@ -183,7 +182,7 @@ const ExportDialog = () => {
activeOpacity={opacity} activeOpacity={opacity}
onPress={item.func} onPress={item.func}
/> />
</> </Fragment>
))} ))}
</View> </View>
</> </>

View File

@@ -33,7 +33,9 @@ const SimpleList = ({
const {colors, selectionMode, user} = state; const {colors, selectionMode, user} = state;
const searchResults = {...state.searchResults}; const searchResults = {...state.searchResults};
const [refreshing, setRefreshing] = useState(false); const [refreshing, setRefreshing] = useState(false);
const [dataProvider, setDataProvider] = useState(null); const [dataProvider, setDataProvider] = useState(new DataProvider((r1, r2) => {
return r1 !== r2;
}).cloneWithRows([]));
const insets = useSafeAreaInsets(); const insets = useSafeAreaInsets();
const listData = data; const listData = data;
const _onScroll = (event) => { const _onScroll = (event) => {
@@ -52,6 +54,7 @@ const SimpleList = ({
/* for (var i = 0; i < 10000; i++) { /* for (var i = 0; i < 10000; i++) {
d = [...d,...data]; d = [...d,...data];
} */ } */
console.log(d,"D")
setDataProvider( setDataProvider(
new DataProvider((r1, r2) => { new DataProvider((r1, r2) => {
return r1 !== r2; return r1 !== r2;
@@ -228,10 +231,10 @@ const SimpleList = ({
width: '100%', width: '100%',
paddingTop: paddingTop:
Platform.OS == 'ios' Platform.OS == 'ios'
? data[0] && !selectionMode ? listData[0] && !selectionMode
? 115 ? 115
: 115 - 60 : 115 - 60
: data[0] && !selectionMode : listData[0] && !selectionMode
? 155 - insets.top ? 155 - insets.top
: 155 - insets.top - 60, : 155 - insets.top - 60,
}} }}
@@ -278,7 +281,7 @@ const SearchHeader = () => {
); );
}; };
const LoginCard = ({type,data}) => { const LoginCard = ({type, data}) => {
const [state, dispatch] = useTracked(); const [state, dispatch] = useTracked();
const {colors, selectionMode, user, currentScreen} = state; const {colors, selectionMode, user, currentScreen} = state;
@@ -361,7 +364,7 @@ const LoginCard = ({type,data}) => {
); );
}; };
const ListHeaderComponent = ({type,data}) => { const ListHeaderComponent = ({type, data}) => {
const [state, dispatch] = useTracked(); const [state, dispatch] = useTracked();
const searchResults = {...state.searchResults}; const searchResults = {...state.searchResults};