mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-06 20:10:12 +02:00
move search button to top right of LibraryHeader
This commit is contained in:
-2
@@ -16,7 +16,6 @@ import { playlistsQueries } from '/@/renderer/features/playlists/api/playlists-a
|
|||||||
import { ListConfigMenu } from '/@/renderer/features/shared/components/list-config-menu';
|
import { ListConfigMenu } from '/@/renderer/features/shared/components/list-config-menu';
|
||||||
import { ListDisplayTypeToggleButton } from '/@/renderer/features/shared/components/list-display-type-toggle-button';
|
import { ListDisplayTypeToggleButton } from '/@/renderer/features/shared/components/list-display-type-toggle-button';
|
||||||
import { ListRefreshButton } from '/@/renderer/features/shared/components/list-refresh-button';
|
import { ListRefreshButton } from '/@/renderer/features/shared/components/list-refresh-button';
|
||||||
import { ListSearchInput } from '/@/renderer/features/shared/components/list-search-input';
|
|
||||||
import { ListSortByDropdown } from '/@/renderer/features/shared/components/list-sort-by-dropdown';
|
import { ListSortByDropdown } from '/@/renderer/features/shared/components/list-sort-by-dropdown';
|
||||||
import { ListSortOrderToggleButton } from '/@/renderer/features/shared/components/list-sort-order-toggle-button';
|
import { ListSortOrderToggleButton } from '/@/renderer/features/shared/components/list-sort-order-toggle-button';
|
||||||
import { MoreButton } from '/@/renderer/features/shared/components/more-button';
|
import { MoreButton } from '/@/renderer/features/shared/components/more-button';
|
||||||
@@ -115,7 +114,6 @@ export const PlaylistDetailSongListHeaderFilters = ({
|
|||||||
disabled={isEditMode}
|
disabled={isEditMode}
|
||||||
listKey={ItemListKey.PLAYLIST_SONG}
|
listKey={ItemListKey.PLAYLIST_SONG}
|
||||||
/>
|
/>
|
||||||
{!collapsed && <ListSearchInput />}
|
|
||||||
<ListRefreshButton disabled={isEditMode} listKey={listKey} />
|
<ListRefreshButton disabled={isEditMode} listKey={listKey} />
|
||||||
<MoreButton onClick={handleMore} />
|
<MoreButton onClick={handleMore} />
|
||||||
</Group>
|
</Group>
|
||||||
|
|||||||
@@ -102,6 +102,7 @@ export const PlaylistDetailSongListHeader = ({
|
|||||||
type: LibraryItem.PLAYLIST,
|
type: LibraryItem.PLAYLIST,
|
||||||
}}
|
}}
|
||||||
title={detailQuery?.data?.name || ''}
|
title={detailQuery?.data?.name || ''}
|
||||||
|
topRight={<ListSearchInput />}
|
||||||
>
|
>
|
||||||
<LibraryHeaderMenu
|
<LibraryHeaderMenu
|
||||||
onPlay={(type) => handlePlay(type)}
|
onPlay={(type) => handlePlay(type)}
|
||||||
|
|||||||
@@ -1,3 +1,10 @@
|
|||||||
|
.top-right {
|
||||||
|
position: absolute;
|
||||||
|
top: var(--theme-spacing-lg);
|
||||||
|
right: var(--theme-spacing-md);
|
||||||
|
z-index: 20;
|
||||||
|
}
|
||||||
|
|
||||||
.library-header {
|
.library-header {
|
||||||
position: relative;
|
position: relative;
|
||||||
display: grid;
|
display: grid;
|
||||||
|
|||||||
@@ -46,11 +46,20 @@ interface LibraryHeaderProps {
|
|||||||
};
|
};
|
||||||
loading?: boolean;
|
loading?: boolean;
|
||||||
title: string;
|
title: string;
|
||||||
|
topRight?: ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const LibraryHeader = forwardRef(
|
export const LibraryHeader = forwardRef(
|
||||||
(
|
(
|
||||||
{ children, compact, containerClassName, imageUrl, item, title }: LibraryHeaderProps,
|
{
|
||||||
|
children,
|
||||||
|
compact,
|
||||||
|
containerClassName,
|
||||||
|
imageUrl,
|
||||||
|
item,
|
||||||
|
title,
|
||||||
|
topRight,
|
||||||
|
}: LibraryHeaderProps,
|
||||||
ref: Ref<HTMLDivElement>,
|
ref: Ref<HTMLDivElement>,
|
||||||
) => {
|
) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@@ -134,6 +143,7 @@ export const LibraryHeader = forwardRef(
|
|||||||
)}
|
)}
|
||||||
ref={ref}
|
ref={ref}
|
||||||
>
|
>
|
||||||
|
{topRight && <div className={styles.topRight}>{topRight}</div>}
|
||||||
<div
|
<div
|
||||||
className={styles.imageSection}
|
className={styles.imageSection}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user