Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
interpolateNavBarStyle() {
const { position, scene, scenes } = this.props;
const { index } = scene;
const positionValue = getAnimatedStyleValue(position);
if (positionValue === index) {
// We are not in a transition, do not override the
// default style to allow any custom animations that
// the screen may want to perform on the NavigationBar
return {};
} else if (this.props.inline) {
// The navigation bar is rendered inline with the screen,
// it will be animated together with the screen, so there
// is no need for custom animations in this case.
return {};
}
// resolveSceneProps will return the latest version of the props
// from the parent component. This is necessary to perform the
// animations to the final state of the navigation bar. Otherwise
// we are often getting various delays and flickers during transitions.
interpolateNavBarStyle() {
const { position, scene, scenes } = this.props;
const { index } = scene;
const positionValue = getAnimatedStyleValue(position);
if (positionValue === index) {
// We are not in a transition, do not override the
// default style to allow any custom animations that
// the screen may want to perform on the NavigationBar
return {};
} else if (this.props.inline) {
// The navigation bar is rendered inline with the screen,
// it will be animated together with the screen, so there
// is no need for custom animations in this case.
return {};
}
// resolveSceneProps will return the latest version of the props
// from the parent component. This is necessary to perform the
// animations to the final state of the navigation bar. Otherwise
// we are often getting various delays and flickers during transitions.
resolveStatusBarStyle(color, animated) {
const colorValue = getAnimatedStyleValue(color);
const barStyle = tinyColor(colorValue).isDark() ? 'light-content' : 'dark-content';
StatusBar.setBarStyle(barStyle, animated);
}
getColor(colorName, props) {
const color = _.get(props, `style.container.${colorName}`, 'white');
return getAnimatedStyleValue(color);
}
getColor(colorName, props) {
const color = _.get(props, `style.container.${colorName}`, 'white');
return getAnimatedStyleValue(color);
}
resolveStatusBarStyle(color, animated) {
const colorValue = getAnimatedStyleValue(color);
const barStyle = tinyColor(colorValue).isDark() ? 'dark-content' : 'light-content';
StatusBar.setBarStyle(barStyle, animated);
}