Created
April 24, 2019 04:40
-
-
Save lenivene/7d9506f69a51592259382e0d93b50f8f to your computer and use it in GitHub Desktop.
Constants React Native
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Dimensions } from "react-native"; | |
const { width, height } = Dimensions.get("window"); | |
const Constants = { | |
useReactotron: true, // Debug | |
Language: "en", | |
fontFamily: "system font", // Default font | |
WordPress: { // No required | |
defaultDateFormat: "YYYY-MM-DD HH:mm:ss" | |
}, | |
SplashScreen: { | |
Duration: 2000, | |
}, | |
EmitCode: { | |
SideMenuOpen: "OPEN_SIDE_MENU", | |
SideMenuClose: "CLOSE_SIDE_MENU", | |
SideMenuToggle: "TOGGLE_SIDE_MENU", | |
Toast: "toast", | |
MenuReload: "menu.reload", | |
}, | |
Window: { | |
width, | |
height, | |
headerHeight: (65 * height) / 100, | |
headerBannerAndroid: (55 * height) / 100, | |
profileHeight: (45 * height) / 100, | |
}, | |
Dimension: { | |
ScreenWidth(percent = 1) { | |
return Dimensions.get("window").width * percent; | |
}, | |
ScreenHeight(percent = 1) { | |
return Dimensions.get("window").height * percent; | |
} | |
} | |
} | |
export default Constants; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment