Change sort icon and remove padding

This commit is contained in:
Arnaud 2024-10-31 17:52:57 +01:00
parent eb34bac149
commit 30fa9c07db
No known key found for this signature in database
GPG Key ID: 69D6CE281FCAE663
3 changed files with 20 additions and 7 deletions

View File

@ -0,0 +1,16 @@
export function SortIcon() {
return (
<svg
width="9"
height="14"
viewBox="0 0 9 14"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M8.34261 4.91667L4.17594 0.75L0.00927734 4.91667H8.34261ZM8.34261 9.08333L4.17594 13.25L0.00927734 9.08333H8.34261Z"
fill="#969696"
/>
</svg>
);
}

View File

@ -3,6 +3,7 @@ import { ArrowDownUp, Search } from "lucide-react";
import { Fragment, ReactElement, ReactNode, useEffect, useState } from "react"; import { Fragment, ReactElement, ReactNode, useEffect, useState } from "react";
import { classnames } from "../utils/classnames"; import { classnames } from "../utils/classnames";
import { attributes } from "../utils/attributes"; import { attributes } from "../utils/attributes";
import { SortIcon } from "./SortIcon";
export type TabSortState = "asc" | "desc" | null; export type TabSortState = "asc" | "desc" | null;
@ -95,7 +96,7 @@ export function Table({
> >
<div> <div>
<span>{name}</span> <span>{name}</span>
{sort && <ArrowDownUp size={"1rem"}></ArrowDownUp>} {sort && <SortIcon />}
</div> </div>
</th> </th>
); );

View File

@ -1,5 +1,4 @@
.table { .table {
padding: 2rem;
border-radius: var(--codex-border-radius); border-radius: var(--codex-border-radius);
overflow-x: auto; overflow-x: auto;
overflow-y: hidden; overflow-y: hidden;
@ -36,7 +35,6 @@
svg { svg {
position: relative; position: relative;
top: -2px;
cursor: pointer; cursor: pointer;
} }
@ -45,13 +43,11 @@
transition: opacity 0.35s; transition: opacity 0.35s;
} }
th[aria-sort="descending"] path:nth-child(1), th[aria-sort="descending"] path {
th[aria-sort="descending"] path:nth-child(2) {
opacity: 1; opacity: 1;
} }
th[aria-sort="ascending"] path:nth-child(3), th[aria-sort="ascending"] path {
th[aria-sort="ascending"] path:nth-child(4) {
opacity: 1; opacity: 1;
} }