mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-02-22 15:04:50 +01:00
FIX: Use existing file
This commit is contained in:
parent
51738e4628
commit
f7b3056360
3 changed files with 9 additions and 9 deletions
|
@ -1,6 +1,7 @@
|
|||
import { isTablet, getDeviceType } from 'react-native-device-info';
|
||||
|
||||
const isDesktop: boolean = getDeviceType() === 'Desktop';
|
||||
const isHandset: boolean = getDeviceType() === 'Handset';
|
||||
const isTabletDevice: boolean = isTablet();
|
||||
|
||||
export const isHandset: boolean = getDeviceType() === 'Handset';
|
||||
export { isDesktop, isTablet };
|
||||
export { isDesktop, isTabletDevice, isHandset };
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import React, { createContext, useState, useEffect, useMemo, ReactNode } from 'react';
|
||||
import { Dimensions } from 'react-native';
|
||||
import { isTablet } from 'react-native-device-info';
|
||||
import { isDesktop } from '../../blue_modules/environment';
|
||||
import { isDesktop, isTabletDevice } from '../../blue_modules/environment';
|
||||
|
||||
interface ILargeScreenContext {
|
||||
isLargeScreen: boolean;
|
||||
|
@ -30,11 +29,10 @@ export const LargeScreenProvider: React.FC<LargeScreenProviderProps> = ({ childr
|
|||
}, [windowWidth]);
|
||||
|
||||
const isLargeScreen: boolean = useMemo(() => {
|
||||
const isRunningOnTablet = isTablet();
|
||||
const halfScreenWidth = windowWidth >= screenWidth / 2;
|
||||
const condition = (isRunningOnTablet && halfScreenWidth) || isDesktop;
|
||||
const condition = (isTabletDevice && halfScreenWidth) || isDesktop;
|
||||
console.debug(
|
||||
`LargeScreenProvider.isLargeScreen: width: ${windowWidth}, Screen width: ${screenWidth}, Is tablet: ${isTablet()}, Is large screen: ${condition}, isDesktkop: ${isDesktop}`,
|
||||
`LargeScreenProvider.isLargeScreen: width: ${windowWidth}, Screen width: ${screenWidth}, Is tablet: ${isTabletDevice}, Is large screen: ${condition}, isDesktkop: ${isDesktop}`,
|
||||
);
|
||||
return condition;
|
||||
}, [windowWidth, screenWidth]);
|
||||
|
|
|
@ -21,7 +21,7 @@ import triggerHapticFeedback, { HapticFeedbackTypes } from '../../blue_modules/h
|
|||
import SafeArea from '../../components/SafeArea';
|
||||
import presentAlert from '../../components/Alert';
|
||||
import { scanQrHelper } from '../../helpers/scan-qr';
|
||||
import { isTablet } from 'react-native-device-info';
|
||||
import { isTabletDevice } from '../../blue_modules/environment';
|
||||
|
||||
const BROADCAST_RESULT = Object.freeze({
|
||||
none: 'Input transaction hex',
|
||||
|
@ -34,6 +34,7 @@ interface SuccessScreenProps {
|
|||
tx: string;
|
||||
}
|
||||
|
||||
|
||||
const Broadcast: React.FC = () => {
|
||||
const { name } = useRoute();
|
||||
const { navigate } = useNavigation();
|
||||
|
@ -117,7 +118,7 @@ const Broadcast: React.FC = () => {
|
|||
|
||||
return (
|
||||
<SafeArea>
|
||||
<KeyboardAvoidingView enabled={!isTablet()} behavior={Platform.OS === 'ios' ? 'position' : undefined}>
|
||||
<KeyboardAvoidingView enabled={!isTabletDevice} behavior={Platform.OS === 'ios' ? 'position' : undefined}>
|
||||
<View style={styles.wrapper} testID="BroadcastView">
|
||||
{BROADCAST_RESULT.success !== broadcastResult && (
|
||||
<BlueCard style={styles.mainCard}>
|
||||
|
|
Loading…
Add table
Reference in a new issue