Compare commits

...

2 Commits

Author SHA1 Message Date
Anmol Singh Bhatia
e749c88e0a style: sidebar quick action icon 2023-08-14 16:09:53 +05:30
Anmol Singh Bhatia
6f22dffc6e style: profile activity loader 2023-08-14 16:09:38 +05:30
2 changed files with 165 additions and 167 deletions

View File

@ -15,7 +15,7 @@ export const WorkspaceSidebarQuickAction = () => {
}`} }`}
> >
<button <button
className={`flex items-center gap-2 flex-grow rounded flex-shrink-0 py-2 ${ className={`flex items-center gap-2 flex-grow rounded flex-shrink-0 py-1.5 ${
store?.theme?.sidebarCollapsed store?.theme?.sidebarCollapsed
? "px-2 hover:bg-custom-sidebar-background-80" ? "px-2 hover:bg-custom-sidebar-background-80"
: "px-3 shadow border-[0.5px] border-custom-border-300" : "px-3 shadow border-[0.5px] border-custom-border-300"
@ -25,7 +25,7 @@ export const WorkspaceSidebarQuickAction = () => {
document.dispatchEvent(e); document.dispatchEvent(e);
}} }}
> >
<Icon iconName="edit_square" className="!text-xl !leading-5 text-custom-sidebar-text-300" /> <Icon iconName="edit_square" className="!text-lg !leading-4 text-custom-sidebar-text-300" />
{!store?.theme?.sidebarCollapsed && <span className="text-sm font-medium">New Issue</span>} {!store?.theme?.sidebarCollapsed && <span className="text-sm font-medium">New Issue</span>}
</button> </button>
@ -40,7 +40,7 @@ export const WorkspaceSidebarQuickAction = () => {
document.dispatchEvent(e); document.dispatchEvent(e);
}} }}
> >
<Icon iconName="search" className="!text-xl !leading-5 text-custom-sidebar-text-300" /> <Icon iconName="search" className="!text-lg !leading-4 text-custom-sidebar-text-300" />
</button> </button>
</div> </div>
); );

View File

@ -27,17 +27,6 @@ const ProfileActivity = () => {
const { data: userActivity } = useSWR(USER_ACTIVITY, () => userService.getUserActivity()); const { data: userActivity } = useSWR(USER_ACTIVITY, () => userService.getUserActivity());
if (!userActivity) {
return (
<Loader className="space-y-5">
<Loader.Item height="40px" />
<Loader.Item height="40px" />
<Loader.Item height="40px" />
<Loader.Item height="40px" />
</Loader>
);
}
return ( return (
<WorkspaceAuthorizationLayout <WorkspaceAuthorizationLayout
breadcrumbs={ breadcrumbs={
@ -56,174 +45,183 @@ const ProfileActivity = () => {
</div> </div>
<SettingsNavbar profilePage /> <SettingsNavbar profilePage />
</div> </div>
{userActivity && userActivity.results.length > 0 && ( {userActivity ? (
<div> userActivity.results.length > 0 ? (
<ul role="list" className="-mb-4"> <div>
{userActivity.results.map((activityItem: any, activityIdx: number) => { <ul role="list" className="-mb-4">
if (activityItem.field === "comment") { {userActivity.results.map((activityItem: any, activityIdx: number) => {
return ( if (activityItem.field === "comment") {
<div key={activityItem.id} className="mt-2"> return (
<div className="relative flex items-start space-x-3"> <div key={activityItem.id} className="mt-2">
<div className="relative px-1"> <div className="relative flex items-start space-x-3">
{activityItem.field ? ( <div className="relative px-1">
activityItem.new_value === "restore" && ( {activityItem.field ? (
<Icon iconName="history" className="text-sm text-custom-text-200" /> activityItem.new_value === "restore" && (
) <Icon iconName="history" className="text-sm text-custom-text-200" />
) : activityItem.actor_detail.avatar && )
activityItem.actor_detail.avatar !== "" ? ( ) : activityItem.actor_detail.avatar &&
<img activityItem.actor_detail.avatar !== "" ? (
src={activityItem.actor_detail.avatar} <img
alt={activityItem.actor_detail.display_name} src={activityItem.actor_detail.avatar}
height={30} alt={activityItem.actor_detail.display_name}
width={30} height={30}
className="grid h-7 w-7 place-items-center rounded-full border-2 border-white bg-gray-500 text-white" width={30}
/> className="grid h-7 w-7 place-items-center rounded-full border-2 border-white bg-gray-500 text-white"
) : ( />
<div ) : (
className={`grid h-7 w-7 place-items-center rounded-full border-2 border-white bg-gray-500 text-white`} <div
> className={`grid h-7 w-7 place-items-center rounded-full border-2 border-white bg-gray-500 text-white`}
{activityItem.actor_detail.display_name?.charAt(0)} >
</div> {activityItem.actor_detail.display_name?.charAt(0)}
)} </div>
)}
<span className="ring-6 flex h-7 w-7 items-center justify-center rounded-full bg-custom-background-80 text-custom-text-200 ring-white"> <span className="ring-6 flex h-7 w-7 items-center justify-center rounded-full bg-custom-background-80 text-custom-text-200 ring-white">
<ChatBubbleLeftEllipsisIcon <ChatBubbleLeftEllipsisIcon
className="h-3.5 w-3.5 text-custom-text-200" className="h-3.5 w-3.5 text-custom-text-200"
aria-hidden="true" aria-hidden="true"
/> />
</span> </span>
</div>
<div className="min-w-0 flex-1">
<div>
<div className="text-xs">
{activityItem.actor_detail.is_bot
? activityItem.actor_detail.first_name + " Bot"
: activityItem.actor_detail.display_name}
</div>
<p className="mt-0.5 text-xs text-custom-text-200">
Commented {timeAgo(activityItem.created_at)}
</p>
</div> </div>
<div className="issue-comments-section p-0"> <div className="min-w-0 flex-1">
<RemirrorRichTextEditor <div>
value={ <div className="text-xs">
activityItem.new_value && activityItem.new_value !== "" {activityItem.actor_detail.is_bot
? activityItem.new_value ? activityItem.actor_detail.first_name + " Bot"
: activityItem.old_value : activityItem.actor_detail.display_name}
} </div>
editable={false} <p className="mt-0.5 text-xs text-custom-text-200">
noBorder Commented {timeAgo(activityItem.created_at)}
customClassName="text-xs border border-custom-border-200 bg-custom-background-100" </p>
/> </div>
<div className="issue-comments-section p-0">
<RemirrorRichTextEditor
value={
activityItem.new_value && activityItem.new_value !== ""
? activityItem.new_value
: activityItem.old_value
}
editable={false}
noBorder
customClassName="text-xs border border-custom-border-200 bg-custom-background-100"
/>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> );
); }
}
const message = const message =
activityItem.verb === "created" && activityItem.verb === "created" &&
activityItem.field !== "cycles" && activityItem.field !== "cycles" &&
activityItem.field !== "modules" && activityItem.field !== "modules" &&
activityItem.field !== "attachment" && activityItem.field !== "attachment" &&
activityItem.field !== "link" && activityItem.field !== "link" &&
activityItem.field !== "estimate" ? ( activityItem.field !== "estimate" ? (
<span className="text-custom-text-200"> <span className="text-custom-text-200">
created{" "} created{" "}
<Link <Link
href={`/${workspaceSlug}/projects/${activityItem.project}/issues/${activityItem.issue}`} href={`/${workspaceSlug}/projects/${activityItem.project}/issues/${activityItem.issue}`}
> >
<a className="inline-flex items-center hover:underline"> <a className="inline-flex items-center hover:underline">
this issue. <ArrowTopRightOnSquareIcon className="ml-1 h-3.5 w-3.5" /> this issue. <ArrowTopRightOnSquareIcon className="ml-1 h-3.5 w-3.5" />
</a> </a>
</Link> </Link>
</span> </span>
) : activityItem.field ? ( ) : activityItem.field ? (
<ActivityMessage activity={activityItem} showIssue /> <ActivityMessage activity={activityItem} showIssue />
) : ( ) : (
"created the issue." "created the issue."
); );
if ("field" in activityItem && activityItem.field !== "updated_by") { if ("field" in activityItem && activityItem.field !== "updated_by") {
return ( return (
<li key={activityItem.id}> <li key={activityItem.id}>
<div className="relative pb-1"> <div className="relative pb-1">
{userActivity.results.length > 1 && {userActivity.results.length > 1 &&
activityIdx !== userActivity.results.length - 1 ? ( activityIdx !== userActivity.results.length - 1 ? (
<span <span
className="absolute top-5 left-5 -ml-px h-full w-0.5 bg-custom-background-80" className="absolute top-5 left-5 -ml-px h-full w-0.5 bg-custom-background-80"
aria-hidden="true" aria-hidden="true"
/> />
) : null} ) : null}
<div className="relative flex items-start space-x-2"> <div className="relative flex items-start space-x-2">
<> <>
<div> <div>
<div className="relative px-1.5"> <div className="relative px-1.5">
<div className="mt-1.5"> <div className="mt-1.5">
<div className="ring-6 flex h-7 w-7 items-center justify-center rounded-full bg-custom-background-80 text-custom-text-200 ring-white"> <div className="ring-6 flex h-7 w-7 items-center justify-center rounded-full bg-custom-background-80 text-custom-text-200 ring-white">
{activityItem.field ? ( {activityItem.field ? (
activityItem.new_value === "restore" ? ( activityItem.new_value === "restore" ? (
<Icon <Icon
iconName="history" iconName="history"
className="text-sm text-custom-text-200" className="text-sm text-custom-text-200"
/>
) : (
<ActivityIcon activity={activityItem} />
)
) : activityItem.actor_detail.avatar &&
activityItem.actor_detail.avatar !== "" ? (
<img
src={activityItem.actor_detail.avatar}
alt={activityItem.actor_detail.display_name}
height={24}
width={24}
className="rounded-full"
/> />
) : ( ) : (
<ActivityIcon activity={activityItem} /> <div
) className={`grid h-7 w-7 place-items-center rounded-full border-2 border-white bg-gray-700 text-xs text-white`}
) : activityItem.actor_detail.avatar && >
activityItem.actor_detail.avatar !== "" ? ( {activityItem.actor_detail.display_name?.charAt(0)}
<img </div>
src={activityItem.actor_detail.avatar} )}
alt={activityItem.actor_detail.display_name} </div>
height={24}
width={24}
className="rounded-full"
/>
) : (
<div
className={`grid h-7 w-7 place-items-center rounded-full border-2 border-white bg-gray-700 text-xs text-white`}
>
{activityItem.actor_detail.display_name?.charAt(0)}
</div>
)}
</div> </div>
</div> </div>
</div> </div>
</div> <div className="min-w-0 flex-1 py-3">
<div className="min-w-0 flex-1 py-3"> <div className="text-xs text-custom-text-200 break-words">
<div className="text-xs text-custom-text-200 break-words"> {activityItem.field === "archived_at" &&
{activityItem.field === "archived_at" && activityItem.new_value !== "restore" ? (
activityItem.new_value !== "restore" ? ( <span className="text-gray font-medium">Plane</span>
<span className="text-gray font-medium">Plane</span> ) : activityItem.actor_detail.is_bot ? (
) : activityItem.actor_detail.is_bot ? ( <span className="text-gray font-medium">
<span className="text-gray font-medium"> {activityItem.actor_detail.first_name} Bot
{activityItem.actor_detail.first_name} Bot </span>
) : (
<Link
href={`/${workspaceSlug}/profile/${activityItem.actor_detail.id}`}
>
<a className="text-gray font-medium">
{activityItem.actor_detail.display_name}
</a>
</Link>
)}{" "}
{message}{" "}
<span className="whitespace-nowrap">
{timeAgo(activityItem.created_at)}
</span> </span>
) : ( </div>
<Link
href={`/${workspaceSlug}/profile/${activityItem.actor_detail.id}`}
>
<a className="text-gray font-medium">
{activityItem.actor_detail.display_name}
</a>
</Link>
)}{" "}
{message}{" "}
<span className="whitespace-nowrap">
{timeAgo(activityItem.created_at)}
</span>
</div> </div>
</div> </>
</> </div>
</div> </div>
</div> </li>
</li> );
); }
} })}
})} </ul>
</ul> </div>
</div> ) : null
) : (
<Loader className="space-y-5">
<Loader.Item height="40px" />
<Loader.Item height="40px" />
<Loader.Item height="40px" />
<Loader.Item height="40px" />
</Loader>
)} )}
</div> </div>
</WorkspaceAuthorizationLayout> </WorkspaceAuthorizationLayout>