mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-02-23 15:20:55 +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';
|
import { isTablet, getDeviceType } from 'react-native-device-info';
|
||||||
|
|
||||||
const isDesktop: boolean = getDeviceType() === 'Desktop';
|
const isDesktop: boolean = getDeviceType() === 'Desktop';
|
||||||
|
const isHandset: boolean = getDeviceType() === 'Handset';
|
||||||
|
const isTabletDevice: boolean = isTablet();
|
||||||
|
|
||||||
export const isHandset: boolean = getDeviceType() === 'Handset';
|
export { isDesktop, isTabletDevice, isHandset };
|
||||||
export { isDesktop, isTablet };
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import React, { createContext, useState, useEffect, useMemo, ReactNode } from 'react';
|
import React, { createContext, useState, useEffect, useMemo, ReactNode } from 'react';
|
||||||
import { Dimensions } from 'react-native';
|
import { Dimensions } from 'react-native';
|
||||||
import { isTablet } from 'react-native-device-info';
|
import { isDesktop, isTabletDevice } from '../../blue_modules/environment';
|
||||||
import { isDesktop } from '../../blue_modules/environment';
|
|
||||||
|
|
||||||
interface ILargeScreenContext {
|
interface ILargeScreenContext {
|
||||||
isLargeScreen: boolean;
|
isLargeScreen: boolean;
|
||||||
|
@ -30,11 +29,10 @@ export const LargeScreenProvider: React.FC<LargeScreenProviderProps> = ({ childr
|
||||||
}, [windowWidth]);
|
}, [windowWidth]);
|
||||||
|
|
||||||
const isLargeScreen: boolean = useMemo(() => {
|
const isLargeScreen: boolean = useMemo(() => {
|
||||||
const isRunningOnTablet = isTablet();
|
|
||||||
const halfScreenWidth = windowWidth >= screenWidth / 2;
|
const halfScreenWidth = windowWidth >= screenWidth / 2;
|
||||||
const condition = (isRunningOnTablet && halfScreenWidth) || isDesktop;
|
const condition = (isTabletDevice && halfScreenWidth) || isDesktop;
|
||||||
console.debug(
|
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;
|
return condition;
|
||||||
}, [windowWidth, screenWidth]);
|
}, [windowWidth, screenWidth]);
|
||||||
|
|
|
@ -21,7 +21,7 @@ import triggerHapticFeedback, { HapticFeedbackTypes } from '../../blue_modules/h
|
||||||
import SafeArea from '../../components/SafeArea';
|
import SafeArea from '../../components/SafeArea';
|
||||||
import presentAlert from '../../components/Alert';
|
import presentAlert from '../../components/Alert';
|
||||||
import { scanQrHelper } from '../../helpers/scan-qr';
|
import { scanQrHelper } from '../../helpers/scan-qr';
|
||||||
import { isTablet } from 'react-native-device-info';
|
import { isTabletDevice } from '../../blue_modules/environment';
|
||||||
|
|
||||||
const BROADCAST_RESULT = Object.freeze({
|
const BROADCAST_RESULT = Object.freeze({
|
||||||
none: 'Input transaction hex',
|
none: 'Input transaction hex',
|
||||||
|
@ -34,6 +34,7 @@ interface SuccessScreenProps {
|
||||||
tx: string;
|
tx: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const Broadcast: React.FC = () => {
|
const Broadcast: React.FC = () => {
|
||||||
const { name } = useRoute();
|
const { name } = useRoute();
|
||||||
const { navigate } = useNavigation();
|
const { navigate } = useNavigation();
|
||||||
|
@ -117,7 +118,7 @@ const Broadcast: React.FC = () => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SafeArea>
|
<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">
|
<View style={styles.wrapper} testID="BroadcastView">
|
||||||
{BROADCAST_RESULT.success !== broadcastResult && (
|
{BROADCAST_RESULT.success !== broadcastResult && (
|
||||||
<BlueCard style={styles.mainCard}>
|
<BlueCard style={styles.mainCard}>
|
||||||
|
|
Loading…
Add table
Reference in a new issue