You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

77 lines
1.9 KiB

import React from "react";
import { View, Text, Pressable } from "react-native";
import { connect } from "react-redux";
import { useNavigation } from "@react-navigation/native";
//components
import CustomPressable from "../../../components/Pressable";
//style
import tw from "tailwind-rn";
import fontSize from "../../../constants/fontSize";
import Colors from "../../../constants/Colors";
export const Header = ({ title, theme }) => {
const navigation = useNavigation();
return (
<View
style={tw(
"flex flex-row-reverse w-full items-center mt-5 mb-4"
)}
>
<Text
style={[
tw("py-2.5 pr-2.5 pl-5"),
{
fontSize: fontSize.base,
color:
theme === "light" ? Colors.theme1.white : Colors.theme1.black,
backgroundColor:
theme === "light"
? Colors.theme1.black
: Colors.theme1.white + "dd",
fontFamily: "Medium",
alignItems: "center",
},
]}
>
{title}
</Text>
<View
style={{
flex: 1,
backgroundColor:
Colors.theme1.grayE3 + (theme === "light" ? "" : "55"),
height: 2,
}}
></View>
<Pressable
onPress={() => navigation.push("MoreBlog")}
style={[
tw("py-3 px-1.5"),
{
backgroundColor:
Colors.theme1.grayE3 + (theme === "light" ? "" : "55"),
},
]}
>
<Text
style={{
fontSize: fontSize.sm,
color: theme === "light" ? Colors.theme1.green79 : Colors.theme1.grayE3,
}}
>
مشاهده بیشتر
</Text>
</Pressable>
</View>
);
};
const mapStateToProps = (state) => ({
theme: state.publicApi.theme,
});
const mapDispatchToProps = {};
export default connect(mapStateToProps, mapDispatchToProps)(Header);