chore: add profile url to author card

This commit is contained in:
MTG2000
2022-06-04 17:54:55 +03:00
parent 4c10b48869
commit 8a4b39465a

View File

@@ -1,4 +1,5 @@
import dayjs from "dayjs";
import { Link } from "react-router-dom";
import Button from "src/Components/Button/Button";
import { Author } from "src/features/Posts/types";
import Avatar from "src/features/Profiles/Components/Avatar/Avatar";
@@ -16,13 +17,19 @@ export default function AuthorCard({ author }: Props) {
return (
<div className="bg-white p-16 border rounded-8">
<div className='flex gap-8'>
<Avatar width={48} src={author.avatar} />
<Link to={`/profile/${author.id}`}>
<Avatar width={48} src={author.avatar} />
</Link>
<div className="overflow-hidden">
<p className={`'text-body4' text-black font-medium overflow-hidden text-ellipsis whitespace-nowrap`}>{trimText(author.name, 333)}</p>
<p className={`text-body6 text-gray-600`}>Joined on {dayjs(author.join_date).format('MMMM DD, YYYY')}</p>
</div>
</div>
<Button fullWidth color="primary" className="mt-16">
<Button
fullWidth
href={`/profile/${author.id}`}
color="primary"
className="mt-16">
Follow
</Button>
</div>