From 817675ee0eb1f5cf0b267dc2aabeb4e8b4a6a691 Mon Sep 17 00:00:00 2001 From: jeffvli Date: Tue, 18 Jul 2023 09:54:51 -0700 Subject: [PATCH] Update playlist headers --- ...aylist-detail-song-list-header-filters.tsx | 37 ++++--------------- .../playlist-list-header-filters.tsx | 1 - .../components/playlist-list-header.tsx | 16 ++++---- 3 files changed, 17 insertions(+), 37 deletions(-) diff --git a/src/renderer/features/playlists/components/playlist-detail-song-list-header-filters.tsx b/src/renderer/features/playlists/components/playlist-detail-song-list-header-filters.tsx index 301f2c4b..d1f1e364 100644 --- a/src/renderer/features/playlists/components/playlist-detail-song-list-header-filters.tsx +++ b/src/renderer/features/playlists/components/playlist-detail-song-list-header-filters.tsx @@ -1,12 +1,10 @@ import { useCallback, ChangeEvent, MutableRefObject, MouseEvent } from 'react'; import { IDatasource } from '@ag-grid-community/core'; import type { AgGridReact as AgGridReactType } from '@ag-grid-community/react/lib/agGridReact'; -import { Flex, Group, Stack } from '@mantine/core'; +import { Divider, Flex, Group, Stack } from '@mantine/core'; import { closeAllModals, openModal } from '@mantine/modals'; import { useQueryClient } from '@tanstack/react-query'; import { - RiSortAsc, - RiSortDesc, RiMoreFill, RiSettings3Fill, RiPlayFill, @@ -47,6 +45,7 @@ import { SONG_TABLE_COLUMNS } from '/@/renderer/components/virtual-table'; import { openUpdatePlaylistModal } from '/@/renderer/features/playlists/components/update-playlist-form'; import { useDeletePlaylist } from '/@/renderer/features/playlists/mutations/delete-playlist-mutation'; import { AppRoute } from '/@/renderer/router/routes'; +import { OrderToggleButton } from '/@/renderer/features/shared'; const FILTERS = { jellyfin: [ @@ -93,11 +92,6 @@ const FILTERS = { ], }; -const ORDER = [ - { name: 'Ascending', value: SortOrder.ASC }, - { name: 'Descending', value: SortOrder.DESC }, -]; - interface PlaylistDetailSongListHeaderFiltersProps { handleToggleShowQueryBuilder: () => void; tableRef: MutableRefObject; @@ -135,8 +129,6 @@ export const PlaylistDetailSongListHeaderFilters = ({ ?.name) || 'Unknown'; - const sortOrderLabel = ORDER.find((o) => o.value === filters.sortOrder)?.name || 'Unknown'; - const handleItemSize = (e: number) => { setTable({ rowHeight: e }); }; @@ -331,25 +323,12 @@ export const PlaylistDetailSongListHeaderFilters = ({ ))} - + + + -