Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save AllGistsEqual/f36192e8bf6c529ccf310031e2aba76b to your computer and use it in GitHub Desktop.
Save AllGistsEqual/f36192e8bf6c529ccf310031e2aba76b to your computer and use it in GitHub Desktop.
import React, { useState, useEffect } from 'react'
import PropTypes from 'prop-types'
import { connect } from 'react-redux'
import { Text, StyleSheet } from 'react-native'
import BackgroundPage from '../../components/global/layout/BackgroundPage'
import { initialiseApplication } from '../../redux/actions/application.actions'
import background from '../../../assets/bg_abstract_01.jpg'
const SceneDataCheck = ({ initApp }) => {
const [timestamp] = useState(Date.now())
useEffect(() => {
initApp(timestamp)
}, [timestamp])
return (
<BackgroundPage background={background}>
<Text style={styles.headline}>
Checking Data
</Text>
</BackgroundPage>
)
}
const styles = StyleSheet.create({
headline: {
fontWeight: 'bold',
fontSize: 23,
},
})
SceneDataCheck.propTypes = {
isUserLoggedIn: PropTypes.bool.isRequired,
initApp: PropTypes.func.isRequired,
navigation: PropTypes.object.isRequired,
}
const mapStateToProps = (state) => ({
isUserLoggedIn: state.user.isLoggedIn,
})
const mapDispatchToProps = (dispatch) => ({
initApp: (timestamp) => dispatch(initialiseApplication(timestamp)),
})
export default connect(mapStateToProps, mapDispatchToProps)(SceneDataCheck)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment