style: designed user activity. (#666)

This commit is contained in:
Saheb Giri 2023-03-31 23:00:28 +05:30 committed by GitHub
parent 9f34f41982
commit c0bf7783b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 282 additions and 17 deletions

View file

@ -11,8 +11,7 @@ import AppLayout from "layouts/app-layout";
// ui
import { Loader } from "components/ui";
import { BreadcrumbItem, Breadcrumbs } from "components/breadcrumbs";
// helpers
import { timeAgo } from "helpers/date-time.helper";
import { Feeds } from "components/core";
// fetch-keys
import { USER_ACTIVITY } from "constants/fetch-keys";
@ -33,21 +32,9 @@ const ProfileActivity = () => {
profilePage
>
{userActivity ? (
<div className="divide-y rounded-[10px] border border-gray-200 bg-white px-6 -mt-4">
{userActivity.results.length > 0
? userActivity.results.map((activity) => (
<div
key={activity.id}
className="flex items-center gap-2 justify-between py-4 text-sm text-gray-500"
>
<h4>
<span className="font-medium text-black">{activity.comment}</span>
</h4>
<div className="text-xs">{timeAgo(activity.created_at)}</div>
</div>
))
: null}
</div>
userActivity.results.length > 0 ? (
<Feeds activities={userActivity.results} />
) : null
) : (
<Loader className="space-y-5">
<Loader.Item height="40px" />