Skip to content

Instantly share code, notes, and snippets.

@slamus
slamus / .babelrc
Last active May 2, 2016 11:13
My react-native Jest configuration
{
"presets": ["react-native"]
}
@slamus
slamus / Style.js
Last active March 29, 2018 23:15
Responsive Design in React Native - Style
import React from "react-native";
import Dimensions from 'Dimensions';
// Precalculate Device Dimensions for better performance
const x = Dimensions.get('window').width;
const y = Dimensions.get('window').height;
// Calculating ratio from iPhone breakpoints
const ratioX = x < 375 ? (x < 320 ? 0.75 : 0.875) : 1 ;
const ratioY = y < 568 ? (y < 480 ? 0.75 : 0.875) : 1 ;
@slamus
slamus / Card.js
Last active January 29, 2016 15:26
Responsive Design in React Native - Component
"use strict"
import React from "react-native";
// We Import our Stylesheet
import Style from "./Style";
const {
View,
Text,
StyleSheet,