mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-03-26 08:55:56 +01:00
REF: isTablet
This commit is contained in:
parent
fc73266b2f
commit
7b3b48e3b5
3 changed files with 5 additions and 8 deletions
|
@ -1,5 +1,6 @@
|
|||
import { isTablet, getDeviceType } from 'react-native-device-info';
|
||||
import { isTablet as checkIsTablet, getDeviceType } from 'react-native-device-info';
|
||||
|
||||
const isTablet: boolean = checkIsTablet();
|
||||
const isDesktop: boolean = getDeviceType() === 'Desktop';
|
||||
const isHandset: boolean = getDeviceType() === 'Handset';
|
||||
|
||||
|
|
|
@ -6,9 +6,6 @@ interface ILargeScreenContext {
|
|||
isLargeScreen: boolean;
|
||||
}
|
||||
|
||||
|
||||
const isTabletDevice: boolean = isTablet()
|
||||
|
||||
export const LargeScreenContext = createContext<ILargeScreenContext | undefined>(undefined);
|
||||
|
||||
interface LargeScreenProviderProps {
|
||||
|
@ -33,9 +30,9 @@ export const LargeScreenProvider: React.FC<LargeScreenProviderProps> = ({ childr
|
|||
|
||||
const isLargeScreen: boolean = useMemo(() => {
|
||||
const halfScreenWidth = windowWidth >= screenWidth / 2;
|
||||
const condition = (isTabletDevice && halfScreenWidth) || isDesktop;
|
||||
const condition = (isTablet && halfScreenWidth) || isDesktop;
|
||||
console.debug(
|
||||
`LargeScreenProvider.isLargeScreen: width: ${windowWidth}, Screen width: ${screenWidth}, Is tablet: ${isTabletDevice}, Is large screen: ${condition}, isDesktkop: ${isDesktop}`,
|
||||
`LargeScreenProvider.isLargeScreen: width: ${windowWidth}, Screen width: ${screenWidth}, Is tablet: ${isTablet}, Is large screen: ${condition}, isDesktkop: ${isDesktop}`,
|
||||
);
|
||||
return condition;
|
||||
}, [windowWidth, screenWidth]);
|
||||
|
|
|
@ -23,7 +23,6 @@ import presentAlert from '../../components/Alert';
|
|||
import { scanQrHelper } from '../../helpers/scan-qr';
|
||||
import { isTablet } from '../../blue_modules/environment';
|
||||
|
||||
const isTabletDevice = isTablet();
|
||||
const BROADCAST_RESULT = Object.freeze({
|
||||
none: 'Input transaction hex',
|
||||
pending: 'pending',
|
||||
|
@ -118,7 +117,7 @@ const Broadcast: React.FC = () => {
|
|||
|
||||
return (
|
||||
<SafeArea>
|
||||
<KeyboardAvoidingView enabled={!isTabletDevice} behavior={Platform.OS === 'ios' ? 'position' : undefined}>
|
||||
<KeyboardAvoidingView enabled={!isTablet} 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