update src/screens/Blogs/index.js, Hashtags.js, List.js and src/screens/Profile/components/MyCourses/index.js

master
Reza_ashrafi 3 years ago
parent 77bd18c1a2
commit b9d457ae50
  1. 2
      src/screens/Blogs/index.js
  2. 14
      src/screens/Blogs/layouts/Hashtags.js
  3. 64
      src/screens/Profile/components/List.js
  4. 5
      src/screens/Profile/components/MyCourses/index.js

@ -75,7 +75,7 @@ function Blogs({ getList, blogs, hashtag, setHashtag, theme }) {
/> />
<Drawer setBoxPosition={setBoxPosition} position={position} /> <Drawer setBoxPosition={setBoxPosition} position={position} />
<Hashtags /> <Hashtags />
{hashtag !== 'همه' ? ( {hashtag ? (
<FlatList <FlatList
contentContainerStyle={styles.contentContainerStyle} contentContainerStyle={styles.contentContainerStyle}
style={tw("px-4")} style={tw("px-4")}

@ -37,13 +37,13 @@ export const Hashtags = ({ hashtags, theme, setHashtag, hashtag }) => {
horizontal={true} horizontal={true}
inverted={true} inverted={true}
style={[tw("flex flex-row mt-3 pb-3 mr-2")]} style={[tw("flex flex-row mt-3 pb-3 mr-2")]}
data={["همه", ...hashtags]} data={hashtags}
renderItem={({ item }) => ( renderItem={({ item }) => (
<Hashtag <Hashtag
hashtag={item} hashtag={item}
theme={theme} theme={theme}
setHashtag={setHashtag} setHashtag={setHashtag}
activeTag={hashtag || "همه"} activeTag={hashtag}
/> />
)} )}
keyExtractor={(item, index) => { keyExtractor={(item, index) => {
@ -62,14 +62,10 @@ const Hashtag = ({ hashtag, theme, setHashtag, activeTag }) => {
return ( return (
<Pressable <Pressable
onPress={() => { onPress={() => {
if (hashtag === "همه") { if (active) {
return setHashtag("همه"); setHashtag(null);
} else { } else {
if (active) { setHashtag(hashtag);
setHashtag("همه");
} else {
setHashtag(hashtag);
}
} }
}} }}
> >

@ -121,38 +121,38 @@ const List = ({ mobile, theme }) => {
name: "کتابهای من", name: "کتابهای من",
onPress: () => navigation.push("AR"), onPress: () => navigation.push("AR"),
}, },
// { {
// icon: ( icon: (
// <Svg xmlns="http://www.w3.org/2000/svg" width={25.613} height={22.519}> <Svg xmlns="http://www.w3.org/2000/svg" width={25.613} height={22.519}>
// <G data-name="Group 2005"> <G data-name="Group 2005">
// <Path <Path
// d="M18.085 20.769H6.528c-3.467 0-5.778-2-5.778-6.673V7.423C.75 2.75 3.061.75 6.528.75h11.557c3.467 0 5.778 2 5.778 6.673v6.673c0 4.671-2.313 6.673-5.778 6.673Z" d="M18.085 20.769H6.528c-3.467 0-5.778-2-5.778-6.673V7.423C.75 2.75 3.061.75 6.528.75h11.557c3.467 0 5.778 2 5.778 6.673v6.673c0 4.671-2.313 6.673-5.778 6.673Z"
// fill="none" fill="none"
// stroke={ stroke={
// theme === "light" ? Colors.theme1.greenCF : Colors.theme1.white theme === "light" ? Colors.theme1.greenCF : Colors.theme1.white
// } }
// strokeLinecap="round" strokeLinecap="round"
// strokeLinejoin="round" strokeLinejoin="round"
// strokeWidth={1.5} strokeWidth={1.5}
// data-name="vuesax/linear/music-playlist" data-name="vuesax/linear/music-playlist"
// /> />
// <Path <Path
// data-name="Vector" data-name="Vector"
// d="M8.954 10.76V9.296c0-1.878 1.329-2.646 2.951-1.708l1.268.732 1.268.732c1.622.939 1.622 2.476 0 3.415l-1.267.732-1.268.732c-1.623.938-2.952.17-2.952-1.708V10.76Z" d="M8.954 10.76V9.296c0-1.878 1.329-2.646 2.951-1.708l1.268.732 1.268.732c1.622.939 1.622 2.476 0 3.415l-1.267.732-1.268.732c-1.623.938-2.952.17-2.952-1.708V10.76Z"
// fill="none" fill="none"
// stroke={ stroke={
// theme === "light" ? Colors.theme1.greenCF : Colors.theme1.white theme === "light" ? Colors.theme1.greenCF : Colors.theme1.white
// } }
// strokeLinecap="round" strokeLinecap="round"
// strokeLinejoin="round" strokeLinejoin="round"
// strokeWidth={1.5} strokeWidth={1.5}
// /> />
// </G> </G>
// </Svg> </Svg>
// ), ),
// name: "دورههای ویدئویی", name: "دورههای ویدئویی",
// onPress: () => navigation.push("MyCourses"), onPress: () => navigation.push("MyCourses"),
// }, },
{ {
icon: ( icon: (
<Svg xmlns="http://www.w3.org/2000/svg" width={25.5} height={25.5}> <Svg xmlns="http://www.w3.org/2000/svg" width={25.5} height={25.5}>

@ -24,7 +24,7 @@ import fontSize from "../../../../constants/fontSize";
const { height, width } = Dimensions.get("window"); const { height, width } = Dimensions.get("window");
const ios = Platform.OS === "ios"; const ios = Platform.OS === "ios";
const ProfileBookmark = ({ myCourses = [], mobile, theme }) => { const ProfileBookmark = ({ userProducts, mobile, theme }) => {
const navigation = useNavigation(); const navigation = useNavigation();
return ( return (
@ -46,7 +46,7 @@ const ProfileBookmark = ({ myCourses = [], mobile, theme }) => {
back: true, back: true,
}} }}
/> />
{myCourses?.length ? ( {userProducts?.filter((product) => product?.condition >= 2 && product?.productType === 4)?.length ? (
<ScrollView <ScrollView
contentContainerStyle={styles.contentContainerStyle} contentContainerStyle={styles.contentContainerStyle}
style={styles.container} style={styles.container}
@ -73,6 +73,7 @@ const ProfileBookmark = ({ myCourses = [], mobile, theme }) => {
const mapStateToProps = (state) => ({ const mapStateToProps = (state) => ({
mobile: state.publicApi.mobile, mobile: state.publicApi.mobile,
theme: state.publicApi.theme, theme: state.publicApi.theme,
userProducts: state.userProduct.list
}); });
export default connect(mapStateToProps)(ProfileBookmark); export default connect(mapStateToProps)(ProfileBookmark);

Loading…
Cancel
Save