How to use the react-native-iphone-x-helper.isIphoneX function in react-native-iphone-x-helper

To help you get started, we’ve selected a few react-native-iphone-x-helper examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github react-navigation / search-layout / src / Header.js View on Github external
import React from 'react';
import {
  Animated,
  Dimensions,
  Platform,
  StatusBar,
  StyleSheet,
  View,
} from 'react-native';
import { withNavigation, HeaderBackButton } from 'react-navigation';
import { getInset, getStatusBarHeight } from 'react-native-safe-area-view';
import { isIphoneX } from 'react-native-iphone-x-helper';

// @todo: make this work properly when in landscape
const hasNotch = isIphoneX();

const APPBAR_HEIGHT = Platform.OS === 'ios' ? 50 : 56;
const TITLE_OFFSET = Platform.OS === 'ios' ? 70 : 56;

@withNavigation
export default class Header extends React.PureComponent {
  constructor(props) {
    super(props);

    // @todo: this is static and we don't know if it's visible or not on iOS.
    // need to use a more reliable and cross-platform API when one exists, like
    // LayoutContext. We also don't know if it's translucent or not on Android
    // and depend on react-native-safe-area-view to tell us.
    const ANDROID_STATUS_BAR_HEIGHT = getStatusBarHeight
      ? getStatusBarHeight()
      : StatusBar.currentHeight;
github ctlabvn / ReactNativeStarterKits / index.js View on Github external
const SafeView = ({ children }) => {
  const isiphoneX = isIphoneX();
  if (isiphoneX) {
    return {children};
  }
  return children;
};
github mongrov / roverz / src / chat / attachments / PhotoLibrary.js View on Github external
renderNavBar() {
    return (
      
         {
          this.setState({ imageData: {} });
          Actions.pop({ duration: 0 });
        }}
        >
          
            {t('lbl_nav_cancel')}
github rainbow-me / rainbow / src / screens / SendSheet.js View on Github external
}
                onChangeAssetAmount={this.onChangeAssetAmount}
                onChangeNativeAmount={this.onChangeNativeAmount}
                onResetAssetSelection={this.onResetAssetSelection}
                selected={selected}
                txSpeedRenderer={
                  isIphoneX() && (
                    
                  )
                }
              />
            )}
          
        
      
    );
  }
}
github mongrov / roverz / src / containers / profile / ProfileView.js View on Github external
onPress={() => {
              Alert.alert(
                t('txt_logout'),
                t('txt_want_to_logout'),
                [
                  { text: t('txt_no'), onPress: () => {}, style: 'cancel' },
                  { text: t('txt_yes'),
                    onPress: () => {
                      this._service.logout();
                    },
                  },
                ],
                { cancelable: false },
              );
            }}
            style={[styles.logout, { paddingBottom: isIphoneX() ? 50 : null }]}
          >
            
            
          
        
      
    );
  }
}
github mongrov / roverz / src / chat / ui / room / RoomView.js View on Github external
width: event.nativeEvent.layout.width,
                },
              });
            }}
          />
          {this.renderSendButton()}
        
      );
    }
    return (
github mongrov / roverz / src / chat / attachments / AttachAudio.js View on Github external
render() {
    const recT = this.state.recordTime;
    const recM = (recT - (recT % 60)) / 60;
    const recS = (recT % 60);
    return (

react-native-iphone-x-helper

A library to help you design your react-native app for the iPhone X

MIT
Latest version published 4 years ago

Package Health Score

53 / 100
Full package analysis