درست کردن قسمت بلاگ و اینکه مقاله تکراری نداشته باشیم وقتی وارد یک مقالیه میشیم و اینکه چند تا دیگه از صفحاتی که وقتی میزدیم روی لینکشون و از وسط صفحه نمایش میدادیم درست شد |120

temp
mahdi 2 years ago
parent 477282518b
commit 76c719796c
  1. 2
      src/components/Comments/index.js
  2. 23
      src/views/Blog/index.js
  3. 2
      src/views/Blogs/index.js
  4. 41
      src/views/Video/index.js
  5. 2
      src/views/Videos/index.js

@ -79,7 +79,7 @@ export const Comments = ({ comments, indent }) => {
{comment?.status === true && (
<>
<img src={positiveIcon} alt="" className="w-6 ml-2" />
<span className="text-sm text-black">
<span className="text-sm">
{window.t("برای خرید توصیه میکنم")}
</span>
</>

@ -9,6 +9,7 @@ import Header from "../Blogs/layouts/Header";
import Suggest from "../Blogs/layouts/Suggest";
import New from "../Blogs/layouts/New";
import Avatar from "../../components/Avatar";
import { useParams } from "react-router-dom";
//assets
import arrow from "../../assets/icons/dropdown-blue.svg";
@ -23,19 +24,28 @@ export const Blog = ({
blogs,
activeBlog,
}) => {
let { id } = useParams();
console.log(id);
// let id = location.getId();
useEffect(() => {
setHeaderOptions(headerOptions);
getInfo({ id: location.getId() });
if (blogs.length === 0) {
getList();
}
}, []);
}, [id]);
useEffect(() => {
getInfo({ id: location.getId() });
}, [activeBlog]);
useEffect(() => {
window.scrollTo(0, 0);
}, []);
return (
<div className="flex flex-col lg:w-11/12 mx-auto lg:py-24 lg:px-0 px-4 lg:pb-0 pb-24 ">
<div className="flex flex-col lg:w-11/12 mx-auto lg:py-24 lg:px-0 px-4 lg:pb-0 pb-24">
<Hashtags />
{isMobile && (
<div
@ -120,6 +130,7 @@ export const Blog = ({
dangerouslySetInnerHTML={{ __html: blog?.text }}
/>
<Header title={window.t("پیشنهادی")} />
{isMobile ? (
<div className="w-full flex overflow-x-scroll no-scrollbar gap-4">
{blogs.map((blog, index) => (
@ -152,9 +163,11 @@ export const Blog = ({
/>
}
>
{blogs.map((blog, index) => (
<Suggest blog={blog} key={index} />
))}
{blogs
.filter((e) => e.id != blog.id)
.map((blog, index) => (
<Suggest blog={blog} key={index} />
))}
</Carousel>
)}
</div>

@ -33,7 +33,7 @@ export const Blogs = ({ isMobile, getList, blogs, setHeaderOptions }) => {
}, []);
return (
<div className="flex w-full px-4 lg:px-0 flex-col lg:w-11/12 mx-auto lg:py-24 pb-24 lg:pb-0 ">
<div className="flex w-full px-4 lg:px-0 flex-col lg:w-11/12 mx-auto lg:py-24 pb-24 lg:pb-0">
<Hashtags />
<Single />
<Header title={window.t(" تازهترینها از وبلاگ")} />

@ -40,10 +40,15 @@ function Video({
getBook({ bookId: location.getId() }, { id: location.getId(), vod: true });
setHeaderOptions(headerOptions);
}, []);
useEffect(() => {
window.scrollTo(0, 0);
}, []);
const { bookmark } = headerOptions;
return isMobile ? (
<div className="w-full flex flex-col px-4 pb-24">
<div className="w-full flex flex-col px-4 pb-24 ">
{!book && (
<div className="w-full h-screen flex justify-center items-center bg-white bg-opacity-20 backdrop-filter backdrop-blur-xl fixed left-0 top-0 z-50">
<Loading size={4} color="bg-green-400" />
@ -105,7 +110,7 @@ function Video({
</div>
</div>
) : (
<div className="flex flex-col w-11/12 min-h-screen mx-auto pb-20 pt-24">
<div className="flex flex-col w-11/12 min-h-screen mx-auto pb-20 pt-24 ">
<header className="w-full flex flex-row gap-12">
<div className="w-9/12">
<Videos videos={book?.fileIds} />
@ -184,25 +189,19 @@ function Video({
<img src={tickIcon} alt="" className="w-9" />
<p className="text-blue52 text-sm font-light">{`توصیه خرید توسط ${book?.product[2]?.suggestedCounter} نفر`}</p>
</div>
{bookmark && (
<div className="flex flex-row items-center py-3">
<img
src={
isDark
? bookmarkDeactiveDarkIcon
: bookmarkDeactiveLightIcon
}
alt="bookmark"
className="w-7"
onClick={() =>
addToFavorite({ [bookmark]: location.getId() })
}
/>
<span className="mr-3 text-sm">
اضافه کردن به لیست علاقه مندی ها
</span>
</div>
)}
<div className="flex flex-row items-center py-3">
<img
src={
isDark ? bookmarkDeactiveDarkIcon : bookmarkDeactiveLightIcon
}
alt="bookmark"
className="w-7"
onClick={() => addToFavorite({ [bookmark]: location.getId() })}
/>
<span className="mr-3 text-sm">
اضافه کردن به لیست علاقه مندی ها
</span>
</div>
<div className="flex flex-col w-full py-4 px-4">
<div className="flex flex-row items-center justify-center gap-2">
<strong className="text-blueC0 text-5xl">

@ -31,7 +31,7 @@ function Videos({ headerOptions, setHeaderOptions, getList, videos, grades }) {
<div className="pr-4">
<MostViewedVideo videos={videos} grades={grades} />
</div>
<div className="px-4 flex flex-col">
<div className="px-4 flex flex-col ">
<Divider type={"vertical"} />
<NewestVideo videos={videos} grades={grades} />
</div>

Loading…
Cancel
Save