REF: isTablet

This commit is contained in:
Marcos Rodriguez Velez 2024-05-15 08:05:42 -04:00
parent fc73266b2f
commit 7b3b48e3b5
No known key found for this signature in database
GPG key ID: 6030B2F48CCE86D7
3 changed files with 5 additions and 8 deletions

View file

@ -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';

View file

@ -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]);

View file

@ -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}>