-
-
Save AllGistsEqual/c4fc023bfae94d02c890480852f91099 to your computer and use it in GitHub Desktop.
This file contains 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
// File: src/screens/SignInScreen.tsx | SignUpScreen.ts | |
import React from 'react' | |
import { Text, View, StyleSheet, Button } from 'react-native' | |
import { MainNavigationProp } from '../../routing/types' | |
import { MainRoutes } from '../../routing/routes' | |
import { useReduxDispatch } from '../../redux' | |
import { setLogin } from '../../redux/ducks/user' | |
type SignInScreenProps = { | |
navigation: MainNavigationProp<MainRoutes.SignIn> | |
} | |
const SignInScreen = ({ navigation }: SignInScreenProps): React.ReactElement => { | |
const dispatch = useReduxDispatch() | |
const handleClick = (): void => { | |
dispatch(setLogin(true)) | |
} | |
return ( | |
<View style={styles.page}> | |
<Text>Sign In</Text> | |
<Button title="Continue" onPress={() => handleClick()} /> | |
<Button title="Sign Up" onPress={() => navigation.navigate(MainRoutes.SignUp)} /> | |
</View> | |
) | |
} | |
const styles = StyleSheet.create({ | |
page: { | |
flex: 1, | |
backgroundColor: '#fff', | |
alignItems: 'center', | |
justifyContent: 'center', | |
}, | |
}) | |
export default SignInScreen |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment