diff --git a/src/screens/Blogs/index.js b/src/screens/Blogs/index.js index 65ec77f..18186df 100644 --- a/src/screens/Blogs/index.js +++ b/src/screens/Blogs/index.js @@ -75,7 +75,7 @@ function Blogs({ getList, blogs, hashtag, setHashtag, theme }) { /> - {hashtag !== 'همه' ? ( + {hashtag ? ( { horizontal={true} inverted={true} style={[tw("flex flex-row mt-3 pb-3 mr-2")]} - data={["همه", ...hashtags]} + data={hashtags} renderItem={({ item }) => ( )} keyExtractor={(item, index) => { @@ -62,14 +62,10 @@ const Hashtag = ({ hashtag, theme, setHashtag, activeTag }) => { return ( { - if (hashtag === "همه") { - return setHashtag("همه"); + if (active) { + setHashtag(null); } else { - if (active) { - setHashtag("همه"); - } else { - setHashtag(hashtag); - } + setHashtag(hashtag); } }} > diff --git a/src/screens/Profile/components/List.js b/src/screens/Profile/components/List.js index 42afc22..f56848e 100644 --- a/src/screens/Profile/components/List.js +++ b/src/screens/Profile/components/List.js @@ -121,38 +121,38 @@ const List = ({ mobile, theme }) => { name: "کتاب‌های من", onPress: () => navigation.push("AR"), }, - // { - // icon: ( - // - // - // - // - // - // - // ), - // name: "دوره‌های ویدئویی", - // onPress: () => navigation.push("MyCourses"), - // }, + { + icon: ( + + + + + + + ), + name: "دوره‌های ویدئویی", + onPress: () => navigation.push("MyCourses"), + }, { icon: ( diff --git a/src/screens/Profile/components/MyCourses/index.js b/src/screens/Profile/components/MyCourses/index.js index f5364b5..9fe916d 100644 --- a/src/screens/Profile/components/MyCourses/index.js +++ b/src/screens/Profile/components/MyCourses/index.js @@ -24,7 +24,7 @@ import fontSize from "../../../../constants/fontSize"; const { height, width } = Dimensions.get("window"); const ios = Platform.OS === "ios"; -const ProfileBookmark = ({ myCourses = [], mobile, theme }) => { +const ProfileBookmark = ({ userProducts, mobile, theme }) => { const navigation = useNavigation(); return ( @@ -46,7 +46,7 @@ const ProfileBookmark = ({ myCourses = [], mobile, theme }) => { back: true, }} /> - {myCourses?.length ? ( + {userProducts?.filter((product) => product?.condition >= 2 && product?.productType === 4)?.length ? ( { const mapStateToProps = (state) => ({ mobile: state.publicApi.mobile, theme: state.publicApi.theme, + userProducts: state.userProduct.list }); export default connect(mapStateToProps)(ProfileBookmark);