diff --git a/src/navigation/stackNavigator.tsx b/src/navigation/stackNavigator.tsx index 7b7de3369..f63af232d 100644 --- a/src/navigation/stackNavigator.tsx +++ b/src/navigation/stackNavigator.tsx @@ -70,14 +70,14 @@ export const StackNavigator = () => { - {/* */} - {/* */} - {/* */} + + + - {/* */} - {/* */} + + ) } diff --git a/src/screens/login/container/loginContainer.js b/src/screens/login/container/loginContainer.js index fc94cdff2..0b55fd34d 100644 --- a/src/screens/login/container/loginContainer.js +++ b/src/screens/login/container/loginContainer.js @@ -82,7 +82,7 @@ class LoginContainer extends PureComponent { dispatch(openPinCodeModal({ navigateTo: ROUTES.DRAWER.MAIN })); } else { navigation.navigate({ - routeName: ROUTES.DRAWER.MAIN, + name: ROUTES.DRAWER.MAIN, }); } } @@ -157,9 +157,7 @@ class LoginContainer extends PureComponent { _handleSignUp = () => { const { navigation } = this.props; - navigation.navigate({ - routeName: ROUTES.SCREENS.REGISTER, - }); + navigation.replace(ROUTES.SCREENS.REGISTER); }; render() { diff --git a/src/screens/login/screen/loginScreen.js b/src/screens/login/screen/loginScreen.js index 7f4721e16..e718968dd 100644 --- a/src/screens/login/screen/loginScreen.js +++ b/src/screens/login/screen/loginScreen.js @@ -164,7 +164,7 @@ class LoginScreen extends PureComponent { style={styles.cancelButton} onPress={() => navigation.navigate({ - routeName: ROUTES.DRAWER.MAIN, + name: ROUTES.DRAWER.MAIN, }) } text={intl.formatMessage({ diff --git a/src/screens/referScreen/referScreen.tsx b/src/screens/referScreen/referScreen.tsx index 941e3df57..a0b5e34a7 100644 --- a/src/screens/referScreen/referScreen.tsx +++ b/src/screens/referScreen/referScreen.tsx @@ -28,7 +28,7 @@ import { navigate } from '../../navigation/service'; import { useAppSelector } from '../../hooks'; import { useDispatch } from 'react-redux'; -const ReferScreen = ({ navigation }) => { +const ReferScreen = () => { const intl = useIntl(); const dispatch = useDispatch(); const currentAccount = useAppSelector((state) => state.account.currentAccount); diff --git a/src/screens/register/registerScreen.js b/src/screens/register/registerScreen.js index c9104ed7b..c59a32f64 100644 --- a/src/screens/register/registerScreen.js +++ b/src/screens/register/registerScreen.js @@ -2,7 +2,6 @@ import React, { useState } from 'react'; import { View, StatusBar, Platform, Image, Text, SafeAreaView } from 'react-native'; import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view'; import { useIntl } from 'react-intl'; -import { withNavigation } from '@react-navigation/compat'; import RegisterContainer from './registerContainer'; @@ -18,14 +17,14 @@ import styles from './registerStyles'; import ESTEEM_LOGO from '../../assets/like_new.png'; import ESTEEM_SMALL_LOGO from '../../assets/ecency_logo_transparent.png'; -const RegisterScreen = ({ navigation }) => { +const RegisterScreen = ({ navigation, route }) => { const intl = useIntl(); const [keyboardIsOpen, setKeyboardIsOpen] = useState(false); const [username, setUsername] = useState(''); const [isUsernameValid, setIsUsernameValid] = useState(false); const [email, setEmail] = useState(''); const [isEmailValid, setIsEmailValid] = useState(false); - const [refUsername, setRefUsername] = useState(navigation.getParam('referredUser', '')); + const [refUsername, setRefUsername] = useState(route.params?.referredUser ?? ''); const [isRefUsernameValid, setIsRefUsernameValid] = useState(true); const _handleEmailChange = (value) => { @@ -68,9 +67,7 @@ const RegisterScreen = ({ navigation }) => { { - navigation.navigate({ - routeName: ROUTES.SCREENS.LOGIN, - }); + navigation.replace(ROUTES.SCREENS.LOGIN); }} text="LOGIN" textStyle={{ color: '#357ce6' }} @@ -150,7 +147,7 @@ const RegisterScreen = ({ navigation }) => { style={styles.cancelButton} onPress={() => { navigation.navigate({ - routeName: ROUTES.DRAWER.MAIN, + name: ROUTES.DRAWER.MAIN, }); }} text={intl.formatMessage({ @@ -176,4 +173,4 @@ const RegisterScreen = ({ navigation }) => { ); }; -export default withNavigation(RegisterScreen); +export default RegisterScreen; diff --git a/src/screens/webBrowser/screen/webBrowser.tsx b/src/screens/webBrowser/screen/webBrowser.tsx index db31b60cd..06b625f94 100644 --- a/src/screens/webBrowser/screen/webBrowser.tsx +++ b/src/screens/webBrowser/screen/webBrowser.tsx @@ -13,16 +13,16 @@ export interface WebBrowserParams { interface Props { navigation:{ - state:{ - params:WebBrowserParams - } goBack:()=>void; + }, + route:{ + params:WebBrowserParams } } -const WebBrowser = ({navigation}:Props) => { +const WebBrowser = ({navigation, route}:Props) => { - const url = useMemo(() => get(navigation, 'state.params.url'), []); + const url = useMemo(() => route.params?.url, []); if(!url){ Alert.alert("DEV: url parameter cannot be empty")