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