mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 15:09:33 +01:00
fix
This commit is contained in:
@@ -7,6 +7,7 @@ import {
|
|||||||
eUnSubscribeEvent,
|
eUnSubscribeEvent,
|
||||||
openVault
|
openVault
|
||||||
} from '../../services/EventManager';
|
} from '../../services/EventManager';
|
||||||
|
import { dWidth } from '../../utils';
|
||||||
import { hexToRGBA } from '../../utils/ColorUtils';
|
import { hexToRGBA } from '../../utils/ColorUtils';
|
||||||
import {
|
import {
|
||||||
eCloseActionSheet,
|
eCloseActionSheet,
|
||||||
@@ -344,7 +345,7 @@ export class DialogManager extends Component {
|
|||||||
bounceOnOpen={false}
|
bounceOnOpen={false}
|
||||||
gestureEnabled={true}
|
gestureEnabled={true}
|
||||||
onClose={() => {
|
onClose={() => {
|
||||||
translatePrem.setValue(-800);
|
translatePrem.setValue(-dWidth * 5);
|
||||||
this.onActionSheetHide();
|
this.onActionSheetHide();
|
||||||
this.setState({
|
this.setState({
|
||||||
actionSheetVisible: false,
|
actionSheetVisible: false,
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import {
|
|||||||
eScrollEvent,
|
eScrollEvent,
|
||||||
} from '../../utils/Events';
|
} from '../../utils/Events';
|
||||||
import {SIZE} from '../../utils/SizeUtils';
|
import {SIZE} from '../../utils/SizeUtils';
|
||||||
|
import { sleep } from '../../utils/TimeUtils';
|
||||||
import {Button} from '../Button';
|
import {Button} from '../Button';
|
||||||
import {HeaderMenu} from '../Header/HeaderMenu';
|
import {HeaderMenu} from '../Header/HeaderMenu';
|
||||||
import Seperator from '../Seperator';
|
import Seperator from '../Seperator';
|
||||||
@@ -48,15 +49,15 @@ const SimpleList = ({
|
|||||||
loading,
|
loading,
|
||||||
}) => {
|
}) => {
|
||||||
const [state, dispatch] = useTracked();
|
const [state, dispatch] = useTracked();
|
||||||
const {colors} = state;
|
const {colors,searchResults} = state;
|
||||||
const searchResults = {...state.searchResults};
|
|
||||||
const [refreshing, setRefreshing] = useState(false);
|
const [refreshing, setRefreshing] = useState(false);
|
||||||
const insets = useSafeAreaInsets();
|
|
||||||
const [dataProvider, setDataProvider] = useState(
|
const [dataProvider, setDataProvider] = useState(
|
||||||
new DataProvider((r1, r2) => {
|
new DataProvider((r1, r2) => {
|
||||||
return r1 !== r2;
|
return r1 !== r2;
|
||||||
}).cloneWithRows([header, {type: 'empty'}]),
|
}).cloneWithRows([header, {type: 'empty'}]),
|
||||||
);
|
);
|
||||||
|
const insets = useSafeAreaInsets();
|
||||||
|
|
||||||
const {width, fontScale} = useWindowDimensions();
|
const {width, fontScale} = useWindowDimensions();
|
||||||
|
|
||||||
const listData = data;
|
const listData = data;
|
||||||
@@ -72,10 +73,12 @@ const SimpleList = ({
|
|||||||
}, [listData, searchResults.results]);
|
}, [listData, searchResults.results]);
|
||||||
|
|
||||||
const loadData = () => {
|
const loadData = () => {
|
||||||
let mainData = [header, {type: 'empty'}];
|
sleep(500).then(()=> {
|
||||||
mainData =
|
let mainData = [header, {type: 'empty'}];
|
||||||
!listData || listData.length === 0 ? mainData : [header, ...listData];
|
mainData =
|
||||||
setDataProvider(dataProvider.cloneWithRows(mainData));
|
!listData || listData.length === 0 ? mainData : [header, ...listData];
|
||||||
|
setDataProvider(dataProvider.cloneWithRows(mainData));
|
||||||
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
const RenderSectionHeader = ({item, index}) => (
|
const RenderSectionHeader = ({item, index}) => (
|
||||||
@@ -209,7 +212,7 @@ const SimpleList = ({
|
|||||||
break;
|
break;
|
||||||
case 'empty':
|
case 'empty':
|
||||||
dim.width = width;
|
dim.width = width;
|
||||||
dim.height = 600;
|
dim.height = dHeight - 250 - insets.top;
|
||||||
break;
|
break;
|
||||||
case 'topic':
|
case 'topic':
|
||||||
dim.width = width;
|
dim.width = width;
|
||||||
@@ -280,7 +283,7 @@ const SimpleList = ({
|
|||||||
dataProvider={dataProvider}
|
dataProvider={dataProvider}
|
||||||
rowRenderer={_renderRow}
|
rowRenderer={_renderRow}
|
||||||
onScroll={_onScroll}
|
onScroll={_onScroll}
|
||||||
canChangeSize
|
canChangeSize={true}
|
||||||
forceNonDeterministicRendering
|
forceNonDeterministicRendering
|
||||||
renderFooter={() => <View style={{height: 300}} />}
|
renderFooter={() => <View style={{height: 300}} />}
|
||||||
scrollViewProps={{
|
scrollViewProps={{
|
||||||
|
|||||||
Reference in New Issue
Block a user