|
|
|
@ -33,12 +33,12 @@ const { width } = Dimensions.get("window"); |
|
|
|
|
|
|
|
|
|
//func
|
|
|
|
|
const renderNode = (node, index, siblings, parent, defaultRenderer) => { |
|
|
|
|
if (node.name == "img") { |
|
|
|
|
const a = node.attribs; |
|
|
|
|
if (node?.name == "img") { |
|
|
|
|
const a = node?.attribs; |
|
|
|
|
return ( |
|
|
|
|
<Image |
|
|
|
|
style={{ width: 300, height: 300 }} |
|
|
|
|
source={{ uri: node.attribs.src }} |
|
|
|
|
source={{ uri: node?.attribs?.src }} |
|
|
|
|
/> |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
@ -46,8 +46,8 @@ const renderNode = (node, index, siblings, parent, defaultRenderer) => { |
|
|
|
|
|
|
|
|
|
export const Blog = ({ getInfo, blog, getList, blogs, route, theme }) => { |
|
|
|
|
useEffect(() => { |
|
|
|
|
getInfo({ id: route.params.id }); |
|
|
|
|
if (blogs.length === 0) { |
|
|
|
|
getInfo({ id: route?.params?.id }); |
|
|
|
|
if (blogs?.length === 0) { |
|
|
|
|
getList(); |
|
|
|
|
} |
|
|
|
|
}, []); |
|
|
|
@ -114,7 +114,7 @@ export const Blog = ({ getInfo, blog, getList, blogs, route, theme }) => { |
|
|
|
|
> |
|
|
|
|
<View style={tw("flex")}> |
|
|
|
|
<View style={tw("flex py-2 justify-center")}> |
|
|
|
|
<Text |
|
|
|
|
{/* <Text |
|
|
|
|
style={{ |
|
|
|
|
fontFamily: "regular", |
|
|
|
|
color: Colors.theme1.white, |
|
|
|
@ -122,8 +122,8 @@ export const Blog = ({ getInfo, blog, getList, blogs, route, theme }) => { |
|
|
|
|
textAlign: ios ? "right" : "auto", |
|
|
|
|
}} |
|
|
|
|
> |
|
|
|
|
{/* {"نوشته از:" + " " + "کامران ایزدی"} */} |
|
|
|
|
</Text> |
|
|
|
|
{"نوشته از:" + " " + "کامران ایزدی"} |
|
|
|
|
</Text> */} |
|
|
|
|
<Text |
|
|
|
|
style={{ |
|
|
|
|
fontFamily: "regular", |
|
|
|
@ -269,16 +269,16 @@ export const Blog = ({ getInfo, blog, getList, blogs, route, theme }) => { |
|
|
|
|
</View> |
|
|
|
|
</View> |
|
|
|
|
<Header title={"پیشنهادی "} /> |
|
|
|
|
{blogs.length ? ( |
|
|
|
|
{blogs?.length ? ( |
|
|
|
|
<FlatList |
|
|
|
|
showsHorizontalScrollIndicator={false} |
|
|
|
|
horizontal={true} |
|
|
|
|
inverted={true} |
|
|
|
|
style={[tw("flex flex-row mt-3 pb-3")]} |
|
|
|
|
data={blogs.filter((blog) => blog.id !== route.params.id)} |
|
|
|
|
data={blogs?.filter((blog) => blog?.id !== route?.params?.id)} |
|
|
|
|
renderItem={({ item }) => <New blog={item} />} |
|
|
|
|
keyExtractor={(item, index) => { |
|
|
|
|
return item.id; |
|
|
|
|
return item?.id; |
|
|
|
|
}} |
|
|
|
|
/> |
|
|
|
|
) : null} |
|
|
|
@ -300,10 +300,6 @@ const mapDispatchToProps = { |
|
|
|
|
setHeaderOptions: publicApi.setHeaderOptions, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const Tag = ({ tag }) => { |
|
|
|
|
return; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(Blog); |
|
|
|
|
|
|
|
|
|
const styles = StyleSheet.create({ |
|
|
|
|