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} />
<Hashtags />
{hashtag !== 'همه' ? (
{hashtag ? (
<FlatList
contentContainerStyle={styles.contentContainerStyle}
style={tw("px-4")}

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

@ -121,38 +121,38 @@ const List = ({ mobile, theme }) => {
name: "کتابهای من",
onPress: () => navigation.push("AR"),
},
// {
// icon: (
// <Svg xmlns="http://www.w3.org/2000/svg" width={25.613} height={22.519}>
// <G data-name="Group 2005">
// <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"
// fill="none"
// stroke={
// theme === "light" ? Colors.theme1.greenCF : Colors.theme1.white
// }
// strokeLinecap="round"
// strokeLinejoin="round"
// strokeWidth={1.5}
// data-name="vuesax/linear/music-playlist"
// />
// <Path
// 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"
// fill="none"
// stroke={
// theme === "light" ? Colors.theme1.greenCF : Colors.theme1.white
// }
// strokeLinecap="round"
// strokeLinejoin="round"
// strokeWidth={1.5}
// />
// </G>
// </Svg>
// ),
// name: "دورههای ویدئویی",
// onPress: () => navigation.push("MyCourses"),
// },
{
icon: (
<Svg xmlns="http://www.w3.org/2000/svg" width={25.613} height={22.519}>
<G data-name="Group 2005">
<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"
fill="none"
stroke={
theme === "light" ? Colors.theme1.greenCF : Colors.theme1.white
}
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={1.5}
data-name="vuesax/linear/music-playlist"
/>
<Path
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"
fill="none"
stroke={
theme === "light" ? Colors.theme1.greenCF : Colors.theme1.white
}
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={1.5}
/>
</G>
</Svg>
),
name: "دورههای ویدئویی",
onPress: () => navigation.push("MyCourses"),
},
{
icon: (
<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 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 ? (
<ScrollView
contentContainerStyle={styles.contentContainerStyle}
style={styles.container}
@ -73,6 +73,7 @@ const ProfileBookmark = ({ myCourses = [], mobile, theme }) => {
const mapStateToProps = (state) => ({
mobile: state.publicApi.mobile,
theme: state.publicApi.theme,
userProducts: state.userProduct.list
});
export default connect(mapStateToProps)(ProfileBookmark);

Loading…
Cancel
Save