mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-30 00:52:42 +03:00
migrated login register refer and web screens
This commit is contained in:
parent
6407a74819
commit
60086c3b3a
@ -70,14 +70,14 @@ export const StackNavigator = () => {
|
||||
<Stack.Screen name={ROUTES.SCREENS.SPIN_GAME} component={SpinGame} />
|
||||
<Stack.Screen name={ROUTES.SCREENS.ACCOUNT_BOOST} component={AccountBoost} />
|
||||
<Stack.Screen name={ROUTES.SCREENS.COMMUNITY} component={Community} />
|
||||
{/* <Stack.Screen name={ROUTES.SCREENS.COMMUNITIES} component={Communities} /> */}
|
||||
{/* <Stack.Screen name={ROUTES.SCREENS.WEB_BROWSER} component={WebBrowser} /> */}
|
||||
{/* <Stack.Screen name={ROUTES.SCREENS.REFER} component={ReferScreen} /> */}
|
||||
<Stack.Screen name={ROUTES.SCREENS.COMMUNITIES} component={Communities} />
|
||||
<Stack.Screen name={ROUTES.SCREENS.WEB_BROWSER} component={WebBrowser} />
|
||||
<Stack.Screen name={ROUTES.SCREENS.REFER} component={ReferScreen} />
|
||||
<Stack.Screen name={ROUTES.SCREENS.COIN_DETAILS} component={CoinDetails} />
|
||||
<Stack.Screen name={ROUTES.SCREENS.EDIT_HISTORY} component={EditHistoryScreen} />
|
||||
|
||||
{/* <Stack.Screen name={ROUTES.SCREENS.REGISTER} component={Register} /> */}
|
||||
{/* <Stack.Screen name={ROUTES.SCREENS.LOGIN} component={Login} /> */}
|
||||
<Stack.Screen name={ROUTES.SCREENS.REGISTER} component={Register} />
|
||||
<Stack.Screen name={ROUTES.SCREENS.LOGIN} component={Login} />
|
||||
</Stack.Navigator>
|
||||
)
|
||||
}
|
||||
|
@ -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() {
|
||||
|
@ -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({
|
||||
|
@ -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);
|
||||
|
@ -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 }) => {
|
||||
<View style={styles.headerButton}>
|
||||
<TextButton
|
||||
onPress={() => {
|
||||
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;
|
||||
|
@ -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")
|
||||
|
Loading…
Reference in New Issue
Block a user