update src/views/Blog/index.js

master
Reza_ashrafi 3 years ago
parent 7ddec90ccd
commit f128c15c5e
  1. 28
      src/views/Blog/index.js

@ -15,7 +15,6 @@ import { useParams } from "react-router-dom";
import arrow from "../../assets/icons/dropdown-blue.svg"; import arrow from "../../assets/icons/dropdown-blue.svg";
export const Blog = ({ export const Blog = ({
isMobile,
getInfo, getInfo,
blog, blog,
setHeaderOptions, setHeaderOptions,
@ -80,10 +79,8 @@ export const Blog = ({
return ( 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 <div
className="w-full rounded-md overflow-hidden relative" className="flex lg:hidden w-full rounded-md overflow-hidden relative"
style={{ style={{
minHeight: 200, minHeight: 200,
}} }}
@ -117,8 +114,7 @@ export const Blog = ({
</div> </div>
</div> </div>
</div> </div>
)}
{!isMobile && (
<div <div
className="w-full hidden lg:flex" className="w-full hidden lg:flex"
style={{ style={{
@ -130,13 +126,13 @@ export const Blog = ({
backgroundPosition: "center bottom", backgroundPosition: "center bottom",
}} }}
></div> ></div>
)}
<div className="flex lg:my-5 gap-5"> <div className="flex lg:my-5 gap-5">
<strong className="flex-1 lg:text-5xl lg:font-black dark:text-gray-200"> <strong className="flex-1 lg:text-5xl lg:font-black dark:text-gray-200">
{blog?.title} {blog?.title}
</strong> </strong>
{!isMobile && ( {/* desktop */}
<div className="flex flex-col"> <div className="hidden lg:flex flex-col">
<div className="flex"> <div className="flex">
<Avatar size={60} /> <Avatar size={60} />
<div className="flex flex-col py-2 mr-2 justify-center"> <div className="flex flex-col py-2 mr-2 justify-center">
@ -157,25 +153,25 @@ export const Blog = ({
</span> </span>
</div> </div>
</div> </div>
)} {/* desktop */}
</div> </div>
<div <div
className="leading-8 lg:text-base text-sm dark:text-white" className="leading-8 lg:text-base text-sm dark:text-white"
dangerouslySetInnerHTML={{ __html: blog?.text }} dangerouslySetInnerHTML={{ __html: blog?.text }}
/> />
<Header title={window.t("پیشنهادی")} /> <Header title={window.t("پیشنهادی")} />
{/* mobile */}
{isMobile ? ( <div className="lg:hidden w-full flex overflow-x-scroll no-scrollbar gap-4">
<div className="w-full flex overflow-x-scroll no-scrollbar gap-4">
{blogs.map((blog, index) => ( {blogs.map((blog, index) => (
<New blog={blog} key={index} /> <New blog={blog} key={index} />
))} ))}
</div> </div>
) : ( {/* mobile */}
<div className="w-full relative" style={{ direction: "ltr" }}> {/* desktop */}
<div className="hidden lg:flex w-full relative ltr">
<suggestionSlider /> <suggestionSlider />
</div> </div>
)} {/* desktop */}
</div> </div>
); );
}; };

Loading…
Cancel
Save