HeaderColor.js 1.55 KB
Newer Older
Giang Tran committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
import React, {useState} from 'react';
import {
  View,
  Text,
  Image,
  StatusBar,
  StyleSheet,
  SafeAreaView,
  ImageBackground,
  TouchableOpacity,
  Platform,
  Button,
  TouchableWithoutFeedback,
} from 'react-native';
import R from '../../assets/R';
import {getFontXD, HEIGHT, WIDTHXD} from '../../Config/Functions';
import LinearGradient from 'react-native-linear-gradient';
import {connect} from 'react-redux';
import {HEIGHTXD} from '../../Config/Functions';
import {useNavigation} from '@react-navigation/native';
const HeaderHome = (props) => {
  const {title} = props;
  const navigate = useNavigation();
  return (
    <View style={styles.headerContainer}>
      <SafeAreaView style={styles.container} />
      <StatusBar backgroundColor="transparent" translucent={true} />
      <TouchableOpacity onPress={() => navigate.goBack()}>
        <Image source={R.images.iconBack} style={styles.imgIcon} />
      </TouchableOpacity>

      <Text style={styles.txtTitle}>{title}</Text>
      <View />
    </View>
  );
};

const mapStateToProps = (state) => {
  return {
    user: state.userReducer,
  };
};

export default connect(mapStateToProps, {})(HeaderHome);

const styles = StyleSheet.create({
  headerContainer: {
Giang Tran committed
48
    paddingTop: 10,
Giang Tran committed
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
    height: 55,
    backgroundColor: '#0047CC',
    width: '100%',
  },
  imgIcon: {
    width: 30,
    height: 30,
  },
  txtTitle: {
    fontSize: getFontXD(52),
    color: R.colors.white,
    fontWeight: 'bold',
  },
  container: {
    backgroundColor: 'white',
    height: '100%',
    width: 300,
    borderRadius: 20,
  },
});