mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-22 22:49:45 +01:00
minor refactoring
This commit is contained in:
@@ -513,9 +513,9 @@ const styles = StyleSheet.create({
|
|||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
},
|
},
|
||||||
container: {
|
container: {
|
||||||
width: DDS.isTab ? '50%' : '100%',
|
width: DDS.isTab ? 500 : '100%',
|
||||||
height: DDS.isTab ? '80%' : '100%',
|
height: DDS.isTab ? 600 : '100%',
|
||||||
maxHeight: DDS.isTab ? '80%' : '100%',
|
maxHeight: DDS.isTab ? 600 : '100%',
|
||||||
borderRadius: DDS.isTab ? 5 : 0,
|
borderRadius: DDS.isTab ? 5 : 0,
|
||||||
paddingHorizontal: ph,
|
paddingHorizontal: ph,
|
||||||
paddingVertical: pv,
|
paddingVertical: pv,
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import {createDrawerNavigator} from '@react-navigation/drawer';
|
|||||||
import {NavigationContainer} from '@react-navigation/native';
|
import {NavigationContainer} from '@react-navigation/native';
|
||||||
import {createStackNavigator} from '@react-navigation/stack';
|
import {createStackNavigator} from '@react-navigation/stack';
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
|
import {Dimensions} from 'react-native';
|
||||||
import Container from '../components/Container';
|
import Container from '../components/Container';
|
||||||
import {Menu} from '../components/Menu';
|
import {Menu} from '../components/Menu';
|
||||||
import {rootNavigatorRef, sideMenuRef} from '../utils/refs';
|
import {rootNavigatorRef, sideMenuRef} from '../utils/refs';
|
||||||
@@ -61,7 +62,7 @@ const DrawerComponent = (props) => {
|
|||||||
<Menu
|
<Menu
|
||||||
menuProps={props}
|
menuProps={props}
|
||||||
hide={false}
|
hide={false}
|
||||||
noTextMode={DDS.isTab}
|
noTextMode={DDS.isTab && !DDS.isSmallTab}
|
||||||
close={() => NavigationService.closeDrawer()}
|
close={() => NavigationService.closeDrawer()}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
@@ -94,11 +95,15 @@ export const NavigationStack = ({component = MainComponent}) => {
|
|||||||
swipeEnabled: locked ? false : true,
|
swipeEnabled: locked ? false : true,
|
||||||
}}
|
}}
|
||||||
drawerStyle={{
|
drawerStyle={{
|
||||||
width:DDS.isTab? w *0.04 : w*0.75,
|
width: DDS.isTab && !DDS.isSmallTab
|
||||||
borderRightColor:'#f0f0f0'
|
? Dimensions.get('window').width * 0.05
|
||||||
|
: DDS.isSmallTab
|
||||||
|
? '40%'
|
||||||
|
: Dimensions.get('window').width * 0.75,
|
||||||
|
borderRightWidth: 0,
|
||||||
}}
|
}}
|
||||||
edgeWidth={200}
|
edgeWidth={200}
|
||||||
drawerType={DDS.isTab ? 'permanent' : 'slide'}
|
drawerType={DDS.isTab || DDS.isSmallTab ? 'permanent' : 'slide'}
|
||||||
drawerContent={DrawerComponent}
|
drawerContent={DrawerComponent}
|
||||||
initialRouteName="Main">
|
initialRouteName="Main">
|
||||||
<Drawer.Screen name="Main" component={component} />
|
<Drawer.Screen name="Main" component={component} />
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ import {generateSecureRandom} from 'react-native-securerandom';
|
|||||||
import Sodium from 'react-native-sodium';
|
import Sodium from 'react-native-sodium';
|
||||||
import RNFetchBlob from 'rn-fetch-blob';
|
import RNFetchBlob from 'rn-fetch-blob';
|
||||||
import {db, requestStoragePermission, ToastEvent} from './utils';
|
import {db, requestStoragePermission, ToastEvent} from './utils';
|
||||||
|
|
||||||
|
|
||||||
export const MMKV = new MMKVStorage.Loader().initialize();
|
export const MMKV = new MMKVStorage.Loader().initialize();
|
||||||
async function read(key, isArray = false) {
|
async function read(key, isArray = false) {
|
||||||
let data;
|
let data;
|
||||||
|
|||||||
Reference in New Issue
Block a user