update blog

master
mahdi 2 years ago
parent 3d311fab77
commit f251c59005
  1. 15
      src/views/Blog/index.js
  2. 22
      src/views/Blogs/layouts/New.js
  3. 38
      src/views/Blogs/layouts/Single.js
  4. 44
      src/views/Blogs/layouts/Target.js

@ -48,14 +48,15 @@ export const Blog = ({
/> />
<div className="flex flex-col justify-end bg-gradient-to-t from-black absolute top-0 left-0 z-10 w-full h-full pb-2 px-2"> <div className="flex flex-col justify-end bg-gradient-to-t from-black absolute top-0 left-0 z-10 w-full h-full pb-2 px-2">
<div className="w-full flex justify-between"> <div className="w-full flex justify-between">
<div className="flex"> <div className="flex items-center">
<Avatar <Avatar
rounded={"rounded-full"}
source={ source={
blog?.author?.picFileId blog?.author?.picFileId
? `https://dnvn.ir/api/v1/file/${blog?.author?.picFileId}` ? `https://dnvn.ir/api/v1/file/${blog?.author?.picFileId}`
: null : null
} }
size={40} size={60}
/> />
<div className="flex flex-col py-2 mr-2 justify-center"> <div className="flex flex-col py-2 mr-2 justify-center">
@ -95,13 +96,13 @@ export const Blog = ({
}} }}
></div> ></div>
<div className="flex lg:my-5 gap-5"> <div className="flex lg:my-5 gap-5 mt-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>
{/* desktop */} {/* desktop */}
<div className="hidden lg:flex flex-col"> <div className="hidden lg:flex flex-col">
<div className="flex items-start"> <div className="flex items-center">
<Avatar <Avatar
rounded={"rounded-full"} rounded={"rounded-full"}
source={ source={
@ -109,13 +110,13 @@ export const Blog = ({
? `https://dnvn.ir/api/v1/file/${blog?.author?.picFileId}` ? `https://dnvn.ir/api/v1/file/${blog?.author?.picFileId}`
: null : null
} }
size={40} size={60}
/>{" "} />
<div className="flex flex-col py-2 mr-2 justify-center"> <div className="flex flex-col py-2 mr-2 justify-center">
<strong className="lg:text-base lg:font-black text-gray1"> <strong className="lg:text-base lg:font-black text-gray1">
{window.t("نوشته از:") + " " + blog?.author?.name} {window.t("نوشته از:") + " " + blog?.author?.name}
</strong> </strong>
<p className="lg:text-sm lg:font-semibold text-gray70 mt-2"> <p className="lg:text-sm lg:font-semibold text-gray70 mt-4">
{blog?.author.role} {blog?.author.role}
</p> </p>
</div> </div>

@ -24,24 +24,24 @@ export const New = ({ blog, isMobile, setActive }) => {
minWidth: isMobile ? "calc(100vh / 5 * 4.5 / 3)" : "", 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"> <strong className="text-base lg:text-lg lg:my-4 my-2 leading-6 lg:leading-7 dark:text-gray-200 p-2">
{blog?.title} {blog?.title}
</strong> </strong>
<div <div
className="text-tiny leading-5 lg:leading-7 mb-3 dark:text-gray-200 p-2 line-clamp-3" className="text-tiny leading-5 lg:leading-7 mb-3 dark:text-gray-200 p-2 line-clamp-3"
dangerouslySetInnerHTML={{ __html: blog?.text }} dangerouslySetInnerHTML={{ __html: blog?.text }}
/> />
<div className="w-full hidden lg;flex justify-between"> <div className="w-full hidden lg;flex justify-between">
<div className="flex"> <div className="flex items-center">
{!blog?.author.picFileId && <Avatar size={60} />} <Avatar
{blog?.author.picFileId && ( rounded={"rounded-full"}
<img source={
src={`https://dnvn.ir/api/v1/file${blog?.author.picFileId}`} blog?.author?.picFileId
alt="author" ? `https://dnvn.ir/api/v1/file/${blog?.author?.picFileId}`
className="w-20 rounded" : null
/> }
)} size={60}
/>
<div className="flex flex-col py-2 mr-2 justify-center"> <div className="flex flex-col py-2 mr-2 justify-center">
<strong className="lg:text-tiny lg:font-black text-gray1"> <strong className="lg:text-tiny lg:font-black text-gray1">
{`{window.t("نوشته از:")}` + " " + `${blog?.author.name}`} {`{window.t("نوشته از:")}` + " " + `${blog?.author.name}`}

@ -24,15 +24,16 @@ export const Single = ({ blog, isMobile }) => {
/> />
<div className="flex flex-col justify-end bg-gradient-to-t from-black lg:hidden absolute top-0 left-0 z-10 w-full h-full pb-2 px-2"> <div className="flex flex-col justify-end bg-gradient-to-t from-black lg:hidden absolute top-0 left-0 z-10 w-full h-full pb-2 px-2">
<div className="w-full flex justify-between"> <div className="w-full flex justify-between">
<div className="flex"> <div className="flex items-center">
{!blog?.author.picFileId && <Avatar size={40} />} <Avatar
{blog?.author.picFileId && ( rounded={"rounded-full"}
<img source={
alt="author" blog?.author?.picFileId
className="w-20 rounded" ? `https://dnvn.ir/api/v1/file/${blog?.author?.picFileId}`
src={`https://dnvn.ir/api/v1/file/${blog?.author.picFileId}`} : null
/> }
)} size={60}
/>
<div className="flex flex-col py-2 mr-2 justify-center"> <div className="flex flex-col py-2 mr-2 justify-center">
<strong className="text-gray-300 text-tiny font-bold"> <strong className="text-gray-300 text-tiny font-bold">
{window.t("نوشته از:")} {window.t("نوشته از:")}
@ -67,15 +68,16 @@ export const Single = ({ blog, isMobile }) => {
</div> </div>
{!isMobile && ( {!isMobile && (
<div className="w-full flex justify-between"> <div className="w-full flex justify-between">
<div className="flex"> <div className="flex items-center">
{!blog?.author.picFileId && <Avatar size={40} />} <Avatar
{blog?.author.picFileId && ( rounded={"rounded-full"}
<img source={
src={`https://dnvn.ir/api/v1/file/${blog?.author.picFileId}`} blog?.author?.picFileId
alt="author" ? `https://dnvn.ir/api/v1/file/${blog?.author?.picFileId}`
className="w-20 rounded" : null
/> }
)} size={60}
/>
<div className="flex flex-col py-2 mr-2 justify-center"> <div className="flex flex-col py-2 mr-2 justify-center">
<strong className="lg:text-xl lg:font-black text-gray1"> <strong className="lg:text-xl lg:font-black text-gray1">
{window.t("نوشته از:")} {window.t("نوشته از:")}

@ -23,15 +23,16 @@ export const Target = ({ blogs, isMobile }) => {
{blog?.title} {blog?.title}
</strong> </strong>
<div className="w-full flex justify-between"> <div className="w-full flex justify-between">
<div className="flex"> <div className="flex items-center">
{!blog?.author.picFileId && <Avatar size={60} />} <Avatar
{blog?.author.picFileId && ( rounded={"rounded-full"}
<img source={
src={`https://dnvn.ir/api/v1/file/${blog?.author.picFileId}`} blog?.author?.picFileId
alt="author" ? `https://dnvn.ir/api/v1/file/${blog?.author?.picFileId}`
className="w-20 rounded" : null
/> }
)} size={60}
/>
<div className="flex flex-col py-1 mr-1 justify-center"> <div className="flex flex-col py-1 mr-1 justify-center">
<strong className="text-opacity-75 text-tiny text-black dark:text-gray-200"> <strong className="text-opacity-75 text-tiny text-black dark:text-gray-200">
{window.t("نوشته از:" + " " + `${blog?.author.name}`)} {window.t("نوشته از:" + " " + `${blog?.author.name}`)}
@ -41,15 +42,15 @@ export const Target = ({ blogs, isMobile }) => {
</p> </p>
</div> </div>
</div> </div>
<div className="flex flex-col i justify-center items-end"> <div className="flex flex-col gap-y-3 justify-center items-end">
<span className="lg:text-tiny text-gray1 lg:font-black"> <span className="text-tiny text-black">
{window.t("زمان مطالعه:") + {window.t("زمان مطالعه:") +
" " + " " +
`${blog?.duration}` + `${blog?.duration}` +
" " + " " +
window.t("دقیقه")} window.t("دقیقه")}
</span> </span>
<span className="mt-3 lg:text-tiny text-gray1 lg:font-black"> <span className="text-tiny text-black">
{moment(blog?.updatedAt).locale("fa").format("YYYY/MM/DD")} {moment(blog?.updatedAt).locale("fa").format("YYYY/MM/DD")}
</span> </span>
</div> </div>
@ -71,15 +72,16 @@ export const Target = ({ blogs, isMobile }) => {
{blog?.title} {blog?.title}
</strong> </strong>
<div className="w-full flex justify-between"> <div className="w-full flex justify-between">
<div className="flex"> <div className="flex items-center">
{!blog?.author.picFileId && <Avatar size={60} />} <Avatar
{blog?.author.picFileId && ( rounded={"rounded-full"}
<img source={
src={`https://dnvn.ir/api/v1/file/${blog?.author.picFileId}`} blog?.author?.picFileId
alt="author" ? `https://dnvn.ir/api/v1/file/${blog?.author?.picFileId}`
className="w-20 rounded" : null
/> }
)} size={60}
/>
<div className="flex flex-col py-2 mr-2 justify-center"> <div className="flex flex-col py-2 mr-2 justify-center">
<strong className="lg:text-tiny lg:font-black text-opacity-75 text-white"> <strong className="lg:text-tiny lg:font-black text-opacity-75 text-white">
{window.t("نوشته از:" + " " + `${blog?.author.name}`)} {window.t("نوشته از:" + " " + `${blog?.author.name}`)}

Loading…
Cancel
Save