[WEB - 2779] feat: Added sort order for issue activity (#6087)

* added sort order for issue activity

* fixed invalid date generation issue

* fixed lint errors, optimized code
This commit is contained in:
Vamsi Krishna 2024-11-26 18:58:01 +05:30 committed by GitHub
parent 31c761db25
commit f09e37fed8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 42 additions and 2 deletions

View file

@ -0,0 +1,28 @@
"use client";
import { FC, memo } from "react";
import { ArrowUpWideNarrow, ArrowDownWideNarrow } from "lucide-react";
import { getButtonStyling } from "@plane/ui";
// helpers
import { cn } from "@/helpers/common.helper";
export type TActivitySortRoot = {
sortOrder: "asc" | "desc";
toggleSort: () => void;
};
export const ActivitySortRoot: FC<TActivitySortRoot> = memo((props) => (
<div
className={cn(getButtonStyling("neutral-primary", "sm"), "px-2 text-custom-text-300 cursor-pointer")}
onClick={() => {
props.toggleSort();
}}
>
{props.sortOrder === "asc" ? (
<ArrowUpWideNarrow className="size-4 " />
) : (
<ArrowDownWideNarrow className="size-4 " />
)}
</div>
));
ActivitySortRoot.displayName = "ActivitySortRoot";