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
const URL = 'https://api.github.com/repos/facebook/react-native' | |
class Stars extends Component { | |
state : { | |
stars: number | |
} = { | |
stars: 0 | |
} | |
async componentDidMount() { |
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
const URL = 'https://api.github.com/repos/facebook/react-native' | |
class Stars extends Component { | |
state : { | |
stars: number | |
} = { | |
stars: 0 | |
} | |
async componentDidMount() { |
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
// @flow | |
'use strict'; | |
import { | |
Platform, | |
StatusBar, | |
Dimensions | |
} from 'react-native'; | |
import { isIphoneX } from 'react-native-iphone-x-helper'; | |
export const statusBarHeight = Platform.OS === 'ios' ? (isIphoneX() ? 44 : 20) : StatusBar.currentHeight; |
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 { | |
statusBarHeight, | |
headerHeight, | |
SafeAreaWithHeader, | |
} from './DimensionsHelper'; | |
const vw: number = SafeAreaWithHeader.vw; | |
const vh: number = SafeAreaWithHeader.vh; | |
class ViewWithTitle extends Component { |
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
renderTitle = () => { | |
if (this.props.title) { | |
if (Platform.OS === 'ios') { | |
return ( | |
<View style={[styles.iOSTitleContainer, {height: this.headerHeight}]}> | |
<Text style={styles.iOSTitle}> | |
{this.props.title} | |
</Text> | |
</View> | |
) |
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
state: { | |
scrollY: Animated.Value, | |
} = { | |
scrollY: new Animated.Value(0) | |
}; | |
renderContentArea = () => { | |
if (this.props.children) { | |
return ( | |
<ScrollView |
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
if (Platform.OS === 'ios') { | |
let titleOpacity = this.state.scrollY.interpolate({ | |
inputRange: [0, 41, 48], | |
outputRange: [0, 0, 1], | |
extrapolate: 'clamp' | |
}); | |
let borderBottomColor = this.state.scrollY.interpolate({ | |
inputRange: [56, 57], | |
outputRange: ["#ffffff", '#f2f2f2'], | |
extrapolate: 'clamp' |
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
renderIOSBigTitle = () => { | |
if (Platform.OS === 'ios' && this.props.title) { | |
const fontSize = this.state.scrollY.interpolate({ | |
inputRange: [-50, 0], | |
outputRange: [40, 34], | |
extrapolate: 'clamp' | |
}); | |
const top = this.state.scrollY.interpolate({ | |
inputRange: [0, 70], | |
outputRange: [0, -70] |
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
// @flow | |
'use strict'; | |
import React, {Component} from 'react'; | |
import { | |
StyleSheet, | |
Text, | |
View, | |
Platform, | |
FlatList, | |
Animated, |
OlderNewer