mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 11:27:32 +00:00
chore: use toggle order
This commit is contained in:
@@ -33,6 +33,10 @@ export const usePagination = <T extends string>(
|
|||||||
search,
|
search,
|
||||||
setSearch,
|
setSearch,
|
||||||
orderBy,
|
orderBy,
|
||||||
setOrderBy
|
setOrderBy,
|
||||||
|
toggleOrderDirection: () =>
|
||||||
|
setOrderDirection((prev) =>
|
||||||
|
prev === OrderByDirection.DESC ? OrderByDirection.ASC : OrderByDirection.DESC
|
||||||
|
)
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -514,8 +514,16 @@ const OrganizationPage = () => {
|
|||||||
|
|
||||||
const isWorkspaceEmpty = !isProjectViewLoading && orgWorkspaces?.length === 0;
|
const isWorkspaceEmpty = !isProjectViewLoading && orgWorkspaces?.length === 0;
|
||||||
|
|
||||||
const { setPage, perPage, setPerPage, page, offset, limit, setOrderDirection, orderDirection } =
|
const {
|
||||||
usePagination(ProjectOrderBy.Name, { initPerPage: 24 });
|
setPage,
|
||||||
|
perPage,
|
||||||
|
setPerPage,
|
||||||
|
page,
|
||||||
|
offset,
|
||||||
|
limit,
|
||||||
|
toggleOrderDirection,
|
||||||
|
orderDirection
|
||||||
|
} = usePagination(ProjectOrderBy.Name, { initPerPage: 24 });
|
||||||
|
|
||||||
const filteredWorkspaces = useMemo(
|
const filteredWorkspaces = useMemo(
|
||||||
() =>
|
() =>
|
||||||
@@ -805,11 +813,7 @@ const OrganizationPage = () => {
|
|||||||
variant="plain"
|
variant="plain"
|
||||||
size="xs"
|
size="xs"
|
||||||
colorSchema="secondary"
|
colorSchema="secondary"
|
||||||
onClick={() =>
|
onClick={toggleOrderDirection}
|
||||||
setOrderDirection((prev) =>
|
|
||||||
prev === OrderByDirection.ASC ? OrderByDirection.DESC : OrderByDirection.ASC
|
|
||||||
)
|
|
||||||
}
|
|
||||||
>
|
>
|
||||||
<FontAwesomeIcon
|
<FontAwesomeIcon
|
||||||
icon={orderDirection === OrderByDirection.ASC ? faArrowDownAZ : faArrowUpZA}
|
icon={orderDirection === OrderByDirection.ASC ? faArrowDownAZ : faArrowUpZA}
|
||||||
|
|||||||
Reference in New Issue
Block a user