Moves Logo component to separate file

This commit is contained in:
mashazyu
2020-03-24 12:33:50 +01:00
committed by Sofiya Tepikin
parent 4d6f0db30a
commit bf4446c742
2 changed files with 48 additions and 47 deletions
+41
View File
@@ -0,0 +1,41 @@
import React from 'react'
import { StyleSheet, TouchableOpacity } from 'react-native'
import PropTypes from 'prop-types'
import AppText from '../common/app-text'
import { connect } from 'react-redux'
import { navigate } from '../../slices/navigation'
import { Colors, Fonts, Sizes } from '../../styles/redesign'
const Logo = ({ navigate }) => {
return(
<TouchableOpacity onPress={() => navigate('Home')}>
<AppText style={styles.logo}>drip.</AppText>
</TouchableOpacity>
)
}
Logo.propTypes = {
navigate: PropTypes.func.isRequired
}
const styles = StyleSheet.create({
logo: {
color: Colors.tourquiseDark,
fontFamily: Fonts.bold,
fontSize: Sizes.title
}
})
const mapDispatchToProps = (dispatch) => {
return({
navigate: (page) => dispatch(navigate(page)),
})
}
export default connect(
null,
mapDispatchToProps,
)(Logo)