Skip to content

Instantly share code, notes, and snippets.

@AllGistsEqual
Created April 18, 2021 19:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AllGistsEqual/f54b5be748aa78423e63cc93c08c7d5c to your computer and use it in GitHub Desktop.
Save AllGistsEqual/f54b5be748aa78423e63cc93c08c7d5c to your computer and use it in GitHub Desktop.
// 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