|
|
import React from "react"; |
|
|
import { connect } from "react-redux"; |
|
|
import { Link } from "react-router-dom"; |
|
|
import Avatar from "../../../components/Avatar"; |
|
|
|
|
|
export const New = ({ blog, isMobile }) => { |
|
|
return ( |
|
|
<Link |
|
|
to={"/blogs/" + blog?.id} |
|
|
className="lg:px-4 flex flex-col" |
|
|
style={{ direction: isMobile ? "" : "rtl" }} |
|
|
> |
|
|
<img |
|
|
src={`https://dnvn.ir/api/v1/file/${blog?.fileIds}`} |
|
|
alt="" |
|
|
className="w-full rounded-md" |
|
|
style={{ |
|
|
height: isMobile |
|
|
? "calc(100vh / 5)" |
|
|
: "calc(100vw / 12 * 11 / 3 / 16 * 9)", |
|
|
minWidth: isMobile ? "calc(100vh / 5 * 4.5 / 3)" : "", |
|
|
}} |
|
|
/> |
|
|
<strong className="text-base lg:text-lg lg:my-4 my-2 leading-6 lg:leading-7 dark:text-gray-200"> |
|
|
{blog?.title} |
|
|
</strong> |
|
|
<p className="text-tiny leading-5 lg:leading-6 mb-3 dark:text-gray-200"> |
|
|
هر نفسی که فرو می بریم، مرگی را که مدام به ما دست اندازی میکند پس |
|
|
میزند در نهایت این مرگ{" "} |
|
|
</p> |
|
|
<div className="w-full hidden lg;flex justify-between"> |
|
|
<div className="flex"> |
|
|
<Avatar size={60} /> |
|
|
<div className="flex flex-col py-2 mr-2 justify-center"> |
|
|
<strong className="lg:text-tiny lg:font-black text-gray1"> |
|
|
{"نوشته از:" + " " + "کامران ایزدی"} |
|
|
</strong> |
|
|
<p className="lg:text-sm lg:font-semibold text-gray70 mt-2"> |
|
|
{"سردبیر بخش وبلاگ دانوین"} |
|
|
</p> |
|
|
</div> |
|
|
</div> |
|
|
<div className="flex flex-col i justify-center items-end"> |
|
|
<span className="lg:text-sm text-gray1 lg:font-black"> |
|
|
{"زمان مطالعه" + " " + "۳۰ دقیقه"} |
|
|
</span> |
|
|
<span className="mt-2 lg:text-sm text-gray1 lg:font-black"> |
|
|
{"1400/11/24"} |
|
|
</span> |
|
|
</div> |
|
|
</div> |
|
|
</Link> |
|
|
); |
|
|
}; |
|
|
|
|
|
const mapStateToProps = (state) => ({ |
|
|
isMobile: state.publicApi.isMobile, |
|
|
}); |
|
|
|
|
|
const mapDispatchToProps = {}; |
|
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(New);
|
|
|
|