Skip to content

Instantly share code, notes, and snippets.

View Royovo's full-sized avatar

Roy Mok Royovo

  • Hong Kong
View GitHub Profile
@Royovo
Royovo / react-native-font-weight.js
Last active March 2, 2018 06:40
Font weight definition
const fontWeight = {
thin: "100", //Thin
ultraLight: "200", //Ultra Light
light: "300", //Light
regular: "400", //Regular
medium: "500", //Medium
semiBold: "600", //Semi Bold
bold: "700", //Bold
heavy: "800", //Heavy
black: "900" //Black
import { Dimensions, Platform } from "react-native";
const { height, width, scale, fontScale } = Dimension.get('window');
const renderHeight = height;
const renderWidth = width;
const resolution ={
height: renderHeight * scale,
width: renderWidth * scale
}
DECLARE @dt DATETIME
SET @dt = GETDATE()
@dt = DATEADD(ms,-DATEPART(ms,@dt),@dt)
import { Dimensions, Platform } from 'react-native';
export const isIphoneX = () => {
const { height, width } = Dimensions.get('window');
return Platform.OS === 'ios' && (height === 812 || width === 812)
}