Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
static push(currentComponentId, newComponentName, title, param) {
Navigation.push(currentComponentId, this.getRNNComponent(newComponentName, title, param))
.then((result) => {
console.log({result});
}).catch((error) => {
console.log({error});
});
}
onClickPushWaitForRender = async () => {
await Navigation.push(this.props.componentId, {
component: {
name: 'navigation.playground.PushedScreen',
passProps: {
stackPosition: this.getStackPosition() + 1,
previousScreenIds: _.concat([], this.props.previousScreenIds || [], this.props.componentId),
simulateLongRunningTask: true
},
options: {
layout: {
backgroundColor: 'transparent'
},
topBar: {
title: {
text: `Pushed ${this.getStackPosition() + 1}`
}
},
_oddsCalculatorPressed = () => {
const {
componentId,
campaign,
allInvestigators,
} = this.props;
this.setState({
menuOpen: false,
});
if (campaign) {
Navigation.push(componentId, {
component: {
name: 'OddsCalculator',
passProps: {
campaign,
allInvestigators,
},
},
});
}
};
onThemePress() {
Navigation.push(UI.componentId, {
component: {
name: SETTINGS_THEME_SCREEN,
},
});
}
push({ componentId }, screenName, passProps, options) {
return Navigation.push(componentId, uber.getComponent(screenName, passProps, options))
},
onSearchCommentsPress() {
Navigation.push(this.props.componentId, {
component: {
name: RESULT_SCREEN,
passProps: {
type: 'comments',
query: this.query,
},
},
});
}
navigateToMedia = (mediaType, mediaId) => Navigation.push(this.props.componentId, {
component: {
name: Screens.MEDIA_PAGE,
passProps: { mediaId, mediaType },
},
});
const navigateToMedia = (media, componentId) => {
if (media) {
Navigation.push(componentId, {
component: {
name: Screens.MEDIA_PAGE,
passProps: { mediaId: media.id, mediaType: media.type },
},
});
}
};
UNSAFE_componentWillReceiveProps(props: Props) {
if (props.areas.length === 0 && props.loggedIn) {
Navigation.push(this.props.componentId, {
component: {
name: 'ForestWatcher.SetupCountry'
}
});
}
}
showNewDeckDialog() {
const {
componentId,
onDeckSelect,
} = this.props;
Navigation.push(componentId, {
component: {
name: 'Deck.New',
passProps: {
onCreateDeck: onDeckSelect,
filterInvestigators: this.filterInvestigators(),
},
},
});
}