Skip to content

Commit

Permalink
Visual sort in details
Browse files Browse the repository at this point in the history
  • Loading branch information
DustinBrett committed Sep 30, 2024
1 parent f5d42f8 commit 76ab3b4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
9 changes: 9 additions & 0 deletions components/system/Files/FileManager/Columns/StyledColumns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ const StyledColumns = styled.span`
position: relative;
top: -1px;
> svg {
fill: rgb(222, 222, 222);
left: 50%;
position: absolute;
top: 1px;
transition: none !important;
width: 8px;
}
div {
overflow: hidden;
text-overflow: ellipsis;
Expand Down
5 changes: 3 additions & 2 deletions components/system/Files/FileManager/Columns/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
} from "components/system/Files/FileManager/Columns/constants";
import { useSession } from "contexts/session";
import { type Files } from "components/system/Files/FileManager/useFolder";
import { Down } from "components/apps/FileExplorer/NavigationIcons";

type ColumnsProps = {
columns: ColumnsObject;
Expand All @@ -29,8 +30,7 @@ const Columns: FC<ColumnsProps> = ({
const draggingRef = useRef("");
const lastClientX = useRef(0);
const { setSortOrder, sortOrders } = useSession();
// eslint-disable-next-line unicorn/no-unreadable-array-destructuring
const [, , ascending] = sortOrders[directory] ?? [];
const [, sortedBy = "name", ascending] = sortOrders[directory] ?? [];

return (
<StyledColumns>
Expand Down Expand Up @@ -94,6 +94,7 @@ const Columns: FC<ColumnsProps> = ({
}}
style={{ width: `${columns[name].width}px` }}
>
{sortedBy === name && <Down flip={ascending} />}
<div>{columns[name].name}</div>
</li>
))}
Expand Down

0 comments on commit 76ab3b4

Please sign in to comment.