master
mahdi 2 years ago
parent e7c2290b2a
commit a354b6b757
  1. 2
      src/components/Avatar/index.js
  2. 27
      src/views/Blog/index.js

@ -7,7 +7,7 @@ function Avatar({ source, size, rounded, status }) {
<img <img
src={source ? source : userImage} src={source ? source : userImage}
alt="avatar" alt="avatar"
style={{ width: size, height: size, objectFit: "contain" }} style={{ width: size, height: size, objectFit: "cover" }}
/> />
{status && ( {status && (
<span className="w-1.5 h-1.5 rounded-full bg-green-500"></span> <span className="w-1.5 h-1.5 rounded-full bg-green-500"></span>

@ -49,14 +49,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">
{!blog?.author.picFileId && <Avatar size={40} />} <Avatar
{blog?.author.picFileId && ( source={
<img blog?.author?.picFileId
src={`https://dnvn.ir/api/v1/file/${blog?.author.picFileId}`} ? `https://dnvn.ir/api/v1/file/${blog?.author?.picFileId}`
alt="author" : null
className="w-20 rounded" }
size={40}
/> />
)}
<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("نوشته از:") + " " + blog?.author?.name} {window.t("نوشته از:") + " " + blog?.author?.name}
@ -100,8 +101,16 @@ export const Blog = ({
</strong> </strong>
{/* desktop */} {/* desktop */}
<div className="hidden lg:flex flex-col"> <div className="hidden lg:flex flex-col">
<div className="flex"> <div className="flex items-start">
<Avatar size={60} /> <Avatar
rounded={"rounded-full"}
source={
blog?.author?.picFileId
? `https://dnvn.ir/api/v1/file/${blog?.author?.picFileId}`
: null
}
size={40}
/>{" "}
<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}

Loading…
Cancel
Save