mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2024-11-20 02:09:10 +01:00
commit
7a2740b506
@ -67,7 +67,7 @@ import PsbtWithHardwareWallet from './screen/send/psbtWithHardwareWallet';
|
||||
import Success from './screen/send/success';
|
||||
|
||||
import UnlockWith from './screen/UnlockWith';
|
||||
import { isDesktop } from './blue_modules/environment';
|
||||
import { isDesktop, isHandset } from './blue_modules/environment';
|
||||
import navigationStyle from './components/navigationStyle';
|
||||
import { useTheme } from './components/themes';
|
||||
import loc from './loc';
|
||||
@ -665,8 +665,7 @@ const NavigationDefaultOptionsForDesktop: NativeStackNavigationOptions = { heade
|
||||
const StatusBarLightOptions: NativeStackNavigationOptions = { statusBarStyle: 'light' };
|
||||
|
||||
const MainRoot = () => {
|
||||
const isLargeScreen = useIsLargeScreen();
|
||||
return isLargeScreen ? <DrawerRoot /> : <DetailViewStackScreensStack />;
|
||||
return isHandset ? <DetailViewStackScreensStack /> : <DrawerRoot />;
|
||||
};
|
||||
|
||||
export default MainRoot;
|
||||
|
@ -28,11 +28,11 @@ export const useIsLargeScreen = () => {
|
||||
|
||||
// Determine if the window width is at least half of the screen width
|
||||
const isLargeScreen = useMemo(() => {
|
||||
const isRunningOnTabletOrDesktop = isTablet() || isDesktop;
|
||||
const isRunningOnTablet = isTablet();
|
||||
const halfScreenWidth = windowWidth >= screenWidth / 2;
|
||||
const condition = isRunningOnTabletOrDesktop && halfScreenWidth;
|
||||
const condition = (isRunningOnTablet && halfScreenWidth) || isDesktop;
|
||||
console.debug(
|
||||
`Window width: ${windowWidth}, Screen width: ${screenWidth}, Is tablet: ${isRunningOnTabletOrDesktop}, Is large screen: ${condition}`,
|
||||
`Window width: ${windowWidth}, Screen width: ${screenWidth}, Is tablet: ${isTablet}, Is large screen: ${condition}, isDesktkop: ${isDesktop}`,
|
||||
);
|
||||
return condition;
|
||||
}, [windowWidth, screenWidth]);
|
||||
|
Loading…
Reference in New Issue
Block a user