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
src={source ? source : userImage}
alt="avatar"
style={{ width: size, height: size, objectFit: "contain" }}
style={{ width: size, height: size, objectFit: "cover" }}
/>
{status && (
<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="w-full flex justify-between">
<div className="flex">
{!blog?.author.picFileId && <Avatar size={40} />}
{blog?.author.picFileId && (
<img
src={`https://dnvn.ir/api/v1/file/${blog?.author.picFileId}`}
alt="author"
className="w-20 rounded"
<Avatar
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">
<strong className="text-gray-300 text-tiny font-bold">
{window.t("نوشته از:") + " " + blog?.author?.name}
@ -100,8 +101,16 @@ export const Blog = ({
</strong>
{/* desktop */}
<div className="hidden lg:flex flex-col">
<div className="flex">
<Avatar size={60} />
<div className="flex items-start">
<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">
<strong className="lg:text-base lg:font-black text-gray1">
{window.t("نوشته از:") + " " + blog?.author?.name}

Loading…
Cancel
Save