This file contains 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 React, { Component } from "react"; | |
import Orientation, { orientation } from "react-native-orientation"; | |
import Navigator from "./navigation/Navigator"; | |
interface Props {} | |
export default class App extends Component<Props> { | |
componentDidMount = () => { | |
Orientation.lockToPortrait(); | |
}; |
This file contains 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
// ... imports | |
import { Icon } from "react-native-elements"; | |
// You only need NavigationScreenProps for TypeScript | |
import { NavigationScreenProps } from "react-navigation"; | |
class HomeScreen extends Component { | |
static navigationOptions = ({ navigation }: NavigationScreenProps) => ({ | |
headerTitle: "Home", | |
headerLeft: Platform.select({ | |
ios: null, |
This file contains 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
// ... imports, remember to omit NavigationScreenProp without TypeScript | |
import { Button, Icon } from "react-native-elements"; | |
import { NavigationScreenProp } from "react-navigation"; | |
interface Props { | |
navigation: navigation: NavigationScreenProp<any, any>; | |
} | |
class HomeScreen extends Component<Props, object> { | |
// ... navigationOptions |
This file contains 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 { Platform, StyleSheet } from "react-native"; | |
const primaryBlue = Platform.select({ | |
ios: "#007aff", // rgb(0, 122, 255) | |
android: "#2196f3" // rgb(33, 150, 243) | |
}); | |
const imageWidth = "80%"; | |
const styles = StyleSheet.create({ |