react-native-camera-roll-gallery
Version:
An easy and simple to use React Native component to render a custom layout for CameraRoll photos (next update will have videos) and displayed on a custom interactive image viewer for manipulation. Includes animations and support for both iOS and Android.
23 lines (20 loc) • 621 B
JavaScript
import { Platform, Dimensions } from "react-native";
export function isIPhoneX() {
const X_WIDTH = 375;
const X_HEIGHT = 812;
return (
Platform.OS === "ios" &&
((Dimensions.get("window").height === X_HEIGHT &&
Dimensions.get("window").width === X_WIDTH) ||
(Dimensions.get("window").height === X_WIDTH &&
Dimensions.get("window").width === X_HEIGHT))
);
}
export function findUri (data) {
return data.source
? data.source : data.uri
? { uri: data.uri } : data.URI
? { uri: data.URI } : data.url
? { uri: data.url } : data.URL
? { uri: data.URL } : undefined;
}