Created
April 18, 2021 19:15
-
-
Save AllGistsEqual/f54b5be748aa78423e63cc93c08c7d5c 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/SplashScreen.tsx | |
import React from 'react' | |
import { Text, View, TouchableWithoutFeedback, StyleSheet } from 'react-native' | |
import { useReduxDispatch } from '../redux' | |
import { setLogin } from '../redux/ducks/user' | |
const SplashScreen = (): React.ReactElement => { | |
const dispatch = useReduxDispatch() | |
const handleClick = (): void => { | |
dispatch(setLogin(true)) | |
} | |
return ( | |
<TouchableWithoutFeedback onPress={() => handleClick()}> | |
<View style={styles.page}> | |
<View style={styles.titleBox}> | |
<Text>ALL BITS EQUAL</Text> | |
<Text>presents</Text> | |
<Text>The Expo Starter Kit</Text> | |
</View> | |
<View style={styles.contentBox}> | |
<Text>Touch Screen to start!</Text> | |
</View> | |
<View style={styles.footer}> | |
<Text>written by Konrad Abe</Text> | |
</View> | |
</View> | |
</TouchableWithoutFeedback> | |
) | |
} | |
const styles = StyleSheet.create({ | |
page: { | |
flex: 1, | |
backgroundColor: '#fff', | |
alignItems: 'center', | |
justifyContent: 'center', | |
}, | |
titleBox: { | |
width: '100%', | |
height: '50%', | |
alignItems: 'center', | |
justifyContent: 'center', | |
}, | |
contentBox: { | |
width: '100%', | |
height: '45%', | |
alignItems: 'center', | |
justifyContent: 'center', | |
}, | |
footer: { | |
width: '100%', | |
height: '10%', | |
paddingRight: '3%', | |
alignItems: 'flex-end', | |
justifyContent: 'center', | |
}, | |
}) | |
export default SplashScreen |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment