mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-09 20:29:36 +02:00
adjust sidebar styles
This commit is contained in:
@@ -9,6 +9,10 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.root {
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
|
||||||
.inner {
|
.inner {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ export const SidebarItem = ({ children, className, to, ...props }: SidebarItemPr
|
|||||||
{
|
{
|
||||||
[styles.disabled]: props.disabled,
|
[styles.disabled]: props.disabled,
|
||||||
[styles.link]: true,
|
[styles.link]: true,
|
||||||
|
[styles.root]: true,
|
||||||
},
|
},
|
||||||
className,
|
className,
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -241,25 +241,23 @@ export const SidebarPlaylistList = () => {
|
|||||||
[player, server.id],
|
[player, server.id],
|
||||||
);
|
);
|
||||||
|
|
||||||
const data = playlistsQuery.data;
|
|
||||||
|
|
||||||
const memoizedItemData = useMemo(() => {
|
const memoizedItemData = useMemo(() => {
|
||||||
const base = { handlePlay: handlePlayPlaylist };
|
const base = { handlePlay: handlePlayPlaylist };
|
||||||
|
|
||||||
if (!server?.type || !server?.username || !data?.items) {
|
if (!server?.type || !server?.username || !playlistsQuery.data?.items) {
|
||||||
return { ...base, items: data?.items };
|
return { ...base, items: playlistsQuery.data?.items };
|
||||||
}
|
}
|
||||||
|
|
||||||
const owned: Array<[boolean, () => void] | Playlist> = [];
|
const owned: Array<[boolean, () => void] | Playlist> = [];
|
||||||
|
|
||||||
for (const playlist of data.items) {
|
for (const playlist of playlistsQuery.data?.items ?? []) {
|
||||||
if (!playlist.owner || playlist.owner === server.username) {
|
if (!playlist.owner || playlist.owner === server.username) {
|
||||||
owned.push(playlist);
|
owned.push(playlist);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return { ...base, items: owned };
|
return { ...base, items: owned };
|
||||||
}, [data?.items, handlePlayPlaylist, server?.type, server?.username]);
|
}, [playlistsQuery.data?.items, handlePlayPlaylist, server?.type, server.username]);
|
||||||
|
|
||||||
const handleCreatePlaylistModal = (e: MouseEvent<HTMLButtonElement>) => {
|
const handleCreatePlaylistModal = (e: MouseEvent<HTMLButtonElement>) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
@@ -275,7 +273,7 @@ export const SidebarPlaylistList = () => {
|
|||||||
<Accordion.Item value="playlists">
|
<Accordion.Item value="playlists">
|
||||||
<Accordion.Control component="div" role="button" style={{ userSelect: 'none' }}>
|
<Accordion.Control component="div" role="button" style={{ userSelect: 'none' }}>
|
||||||
<Group justify="space-between" pr="var(--theme-spacing-md)">
|
<Group justify="space-between" pr="var(--theme-spacing-md)">
|
||||||
<Text fw={600}>
|
<Text fw={500}>
|
||||||
{t('page.sidebar.playlists', {
|
{t('page.sidebar.playlists', {
|
||||||
postProcess: 'titleCase',
|
postProcess: 'titleCase',
|
||||||
})}
|
})}
|
||||||
@@ -351,28 +349,26 @@ export const SidebarSharedPlaylistList = () => {
|
|||||||
if (!server?.id) return;
|
if (!server?.id) return;
|
||||||
player.addToQueueByFetch(server.id, [id], LibraryItem.PLAYLIST, playType);
|
player.addToQueueByFetch(server.id, [id], LibraryItem.PLAYLIST, playType);
|
||||||
},
|
},
|
||||||
[player, server?.id],
|
[player, server.id],
|
||||||
);
|
);
|
||||||
|
|
||||||
const data = playlistsQuery.data;
|
|
||||||
|
|
||||||
const memoizedItemData = useMemo(() => {
|
const memoizedItemData = useMemo(() => {
|
||||||
const base = { handlePlay: handlePlayPlaylist };
|
const base = { handlePlay: handlePlayPlaylist };
|
||||||
|
|
||||||
if (!server?.type || !server?.username || !data?.items) {
|
if (!server?.type || !server?.username || !playlistsQuery.data?.items) {
|
||||||
return { ...base, items: data?.items };
|
return { ...base, items: playlistsQuery.data?.items };
|
||||||
}
|
}
|
||||||
|
|
||||||
const shared: Playlist[] = [];
|
const shared: Playlist[] = [];
|
||||||
|
|
||||||
for (const playlist of data.items) {
|
for (const playlist of playlistsQuery.data?.items ?? []) {
|
||||||
if (playlist.owner && playlist.owner !== server.username) {
|
if (playlist.owner && playlist.owner !== server.username) {
|
||||||
shared.push(playlist);
|
shared.push(playlist);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return { ...base, items: shared };
|
return { ...base, items: shared };
|
||||||
}, [data?.items, handlePlayPlaylist, server?.type, server?.username]);
|
}, [handlePlayPlaylist, playlistsQuery.data?.items, server?.type, server.username]);
|
||||||
|
|
||||||
if (memoizedItemData?.items?.length === 0) {
|
if (memoizedItemData?.items?.length === 0) {
|
||||||
return null;
|
return null;
|
||||||
@@ -381,7 +377,7 @@ export const SidebarSharedPlaylistList = () => {
|
|||||||
return (
|
return (
|
||||||
<Accordion.Item value="shared-playlists">
|
<Accordion.Item value="shared-playlists">
|
||||||
<Accordion.Control>
|
<Accordion.Control>
|
||||||
<Text fw={600} variant="secondary">
|
<Text fw={500} variant="secondary">
|
||||||
{t('page.sidebar.shared', {
|
{t('page.sidebar.shared', {
|
||||||
postProcess: 'titleCase',
|
postProcess: 'titleCase',
|
||||||
})}
|
})}
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ export const Sidebar = () => {
|
|||||||
>
|
>
|
||||||
<Accordion.Item value="library">
|
<Accordion.Item value="library">
|
||||||
<Accordion.Control>
|
<Accordion.Control>
|
||||||
<Text fw={700} variant="secondary">
|
<Text fw={500} variant="secondary">
|
||||||
{t('page.sidebar.myLibrary', {
|
{t('page.sidebar.myLibrary', {
|
||||||
postProcess: 'titleCase',
|
postProcess: 'titleCase',
|
||||||
})}
|
})}
|
||||||
|
|||||||
Reference in New Issue
Block a user