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.
 
 
 
 
 

68 lines
1.7 KiB

import React from "react";
import {
View,
Text,
Dimensions,
Pressable,
Image,
Appearance,
Platform,
} from "react-native";
import { useNavigation } from "@react-navigation/native";
//style
import tw from "tailwind-rn";
import fontSize from "../../../constants/fontSize";
import Colors from "../../../constants/Colors";
const { width } = Dimensions.get("window");
const ios = Platform.OS === "ios";
export const New = ({ blog }) => {
const navigation = useNavigation();
const colorScheme = Appearance.getColorScheme();
return (
<Pressable
style={[
tw(`flex ml-4 ${ios ? "items-end" : ""}`),
{
width: width / 2,
},
]}
onPress={() => navigation.push("Blog", { id: blog.id })}
>
<Image
source={{ uri: `https://dnvn.ir/api/v1/file/${blog?.fileIds}` }}
resizeMode="contain"
style={[
tw("rounded-sm"),
{ width: "100%", height: ((width / 2) * 3) / 4.2 },
]}
/>
<Text
style={{
fontSize: fontSize.tiny,
fontFamily: "bold",
color: Colors.theme1[colorScheme].gray20,
marginTop: 5,
textAlign: ios ? "right" : "auto",
}}
>
{blog?.title}
</Text>
<Text
style={{
fontSize: fontSize.xs,
fontFamily: "regular",
color: Colors.theme1[colorScheme].gray2077,
textAlign: ios ? "right" : "auto",
marginTop: 5,
}}
>
هر نفسی که فرو می بریم، مرگی را که مدام به ما دست اندازی میکند پس
</Text>
</Pressable>
);
};
export default New;