mirror of
https://github.com/jeffvli/feishin.git
synced 2025-02-21 12:49:43 +01:00
Adjust sidebar styles
This commit is contained in:
parent
04275a272b
commit
3c39bdaa29
@ -23,13 +23,12 @@ const ItemStyle = css`
|
|||||||
display: flex;
|
display: flex;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 0.5rem 1rem;
|
padding: 0.5rem 1rem;
|
||||||
color: var(--sidebar-btn-color);
|
color: var(--sidebar-fg);
|
||||||
font-family: var(--content-font-family);
|
|
||||||
border: 1px transparent solid;
|
border: 1px transparent solid;
|
||||||
transition: color 0.2s ease-in-out;
|
transition: color 0.2s ease-in-out;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
color: var(--sidebar-btn-color-hover);
|
color: var(--sidebar-fg-hover);
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
@ -1,24 +1,28 @@
|
|||||||
import { Stack, Group, Grid, Accordion, Center } from '@mantine/core';
|
import { Stack, Grid, Accordion, Center, Group } from '@mantine/core';
|
||||||
import { SpotlightProvider } from '@mantine/spotlight';
|
import { SpotlightProvider } from '@mantine/spotlight';
|
||||||
import { AnimatePresence, motion } from 'framer-motion';
|
import { AnimatePresence, motion } from 'framer-motion';
|
||||||
import { BsCollection } from 'react-icons/bs';
|
import { BsCollection } from 'react-icons/bs';
|
||||||
import { Button, TextInput } from '/@/renderer/components';
|
import { Button, TextInput } from '/@/renderer/components';
|
||||||
import {
|
import {
|
||||||
|
RiAlbumFill,
|
||||||
RiAlbumLine,
|
RiAlbumLine,
|
||||||
RiArrowDownSLine,
|
RiArrowDownSLine,
|
||||||
RiArrowLeftSLine,
|
RiArrowLeftSLine,
|
||||||
RiArrowRightSLine,
|
RiArrowRightSLine,
|
||||||
|
RiDatabaseFill,
|
||||||
RiDatabaseLine,
|
RiDatabaseLine,
|
||||||
RiDiscLine,
|
RiDiscLine,
|
||||||
RiEyeLine,
|
RiFlag2Line,
|
||||||
RiFolder3Line,
|
RiFolder3Line,
|
||||||
|
RiHome5Fill,
|
||||||
RiHome5Line,
|
RiHome5Line,
|
||||||
|
RiMusicFill,
|
||||||
RiMusicLine,
|
RiMusicLine,
|
||||||
RiPlayListLine,
|
RiPlayListLine,
|
||||||
RiSearchLine,
|
RiSearchLine,
|
||||||
RiUserVoiceLine,
|
RiUserVoiceLine,
|
||||||
} from 'react-icons/ri';
|
} from 'react-icons/ri';
|
||||||
import { useNavigate, Link } from 'react-router-dom';
|
import { useNavigate, Link, useLocation } from 'react-router-dom';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import { SidebarItem } from '/@/renderer/features/sidebar/components/sidebar-item';
|
import { SidebarItem } from '/@/renderer/features/sidebar/components/sidebar-item';
|
||||||
import { AppRoute } from '/@/renderer/router/routes';
|
import { AppRoute } from '/@/renderer/router/routes';
|
||||||
@ -60,6 +64,7 @@ const ActionsContainer = styled(Grid)`
|
|||||||
|
|
||||||
export const Sidebar = () => {
|
export const Sidebar = () => {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
const location = useLocation();
|
||||||
const sidebar = useSidebarStore();
|
const sidebar = useSidebarStore();
|
||||||
const { setSidebar } = useAppStoreActions();
|
const { setSidebar } = useAppStoreActions();
|
||||||
const imageUrl = useCurrentSong()?.imageUrl;
|
const imageUrl = useCurrentSong()?.imageUrl;
|
||||||
@ -121,28 +126,26 @@ export const Sidebar = () => {
|
|||||||
>
|
>
|
||||||
<SidebarItem to={AppRoute.HOME}>
|
<SidebarItem to={AppRoute.HOME}>
|
||||||
<Group>
|
<Group>
|
||||||
<RiHome5Line size={15} />
|
{location.pathname === AppRoute.HOME ? (
|
||||||
|
<RiHome5Fill size={15} />
|
||||||
|
) : (
|
||||||
|
<RiHome5Line size={15} />
|
||||||
|
)}
|
||||||
Home
|
Home
|
||||||
</Group>
|
</Group>
|
||||||
</SidebarItem>
|
</SidebarItem>
|
||||||
<SidebarItem>
|
|
||||||
<SidebarItem.Link
|
|
||||||
disabled
|
|
||||||
to={AppRoute.EXPLORE}
|
|
||||||
>
|
|
||||||
<Group>
|
|
||||||
<RiEyeLine />
|
|
||||||
Explore
|
|
||||||
</Group>
|
|
||||||
</SidebarItem.Link>
|
|
||||||
</SidebarItem>
|
|
||||||
<Accordion
|
<Accordion
|
||||||
multiple
|
multiple
|
||||||
styles={{
|
styles={{
|
||||||
item: { borderBottom: 'none' },
|
control: {
|
||||||
|
'&:hover': { background: 'none', color: 'var(--sidebar-fg-hover)' },
|
||||||
|
color: 'var(--sidebar-fg)',
|
||||||
|
transition: 'color 0.2s ease-in-out',
|
||||||
|
},
|
||||||
|
item: { borderBottom: 'none', color: 'var(--sidebar-fg)' },
|
||||||
|
itemTitle: { color: 'var(--sidebar-fg)' },
|
||||||
panel: {
|
panel: {
|
||||||
borderLeft: '1px solid rgba(100,100,100,.5)',
|
marginLeft: '1rem',
|
||||||
marginLeft: '1.5rem',
|
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
value={sidebar.expanded}
|
value={sidebar.expanded}
|
||||||
@ -151,20 +154,32 @@ export const Sidebar = () => {
|
|||||||
<Accordion.Item value="library">
|
<Accordion.Item value="library">
|
||||||
<Accordion.Control p="1rem">
|
<Accordion.Control p="1rem">
|
||||||
<Group>
|
<Group>
|
||||||
<RiDatabaseLine size={15} />
|
{location.pathname.includes('/library/') ? (
|
||||||
|
<RiDatabaseFill size={15} />
|
||||||
|
) : (
|
||||||
|
<RiDatabaseLine size={15} />
|
||||||
|
)}
|
||||||
Library
|
Library
|
||||||
</Group>
|
</Group>
|
||||||
</Accordion.Control>
|
</Accordion.Control>
|
||||||
<Accordion.Panel>
|
<Accordion.Panel>
|
||||||
<SidebarItem to={AppRoute.LIBRARY_ALBUMS}>
|
<SidebarItem to={AppRoute.LIBRARY_ALBUMS}>
|
||||||
<Group>
|
<Group>
|
||||||
<RiAlbumLine />
|
{location.pathname === AppRoute.LIBRARY_ALBUMS ? (
|
||||||
|
<RiAlbumFill />
|
||||||
|
) : (
|
||||||
|
<RiAlbumLine />
|
||||||
|
)}
|
||||||
Albums
|
Albums
|
||||||
</Group>
|
</Group>
|
||||||
</SidebarItem>
|
</SidebarItem>
|
||||||
<SidebarItem to={AppRoute.LIBRARY_SONGS}>
|
<SidebarItem to={AppRoute.LIBRARY_SONGS}>
|
||||||
<Group>
|
<Group>
|
||||||
<RiMusicLine />
|
{location.pathname === AppRoute.LIBRARY_SONGS ? (
|
||||||
|
<RiMusicFill />
|
||||||
|
) : (
|
||||||
|
<RiMusicLine />
|
||||||
|
)}
|
||||||
Tracks
|
Tracks
|
||||||
</Group>
|
</Group>
|
||||||
</SidebarItem>
|
</SidebarItem>
|
||||||
@ -177,6 +192,15 @@ export const Sidebar = () => {
|
|||||||
Artists
|
Artists
|
||||||
</Group>
|
</Group>
|
||||||
</SidebarItem>
|
</SidebarItem>
|
||||||
|
<SidebarItem
|
||||||
|
disabled
|
||||||
|
to={AppRoute.LIBRARY_FOLDERS}
|
||||||
|
>
|
||||||
|
<Group>
|
||||||
|
<RiFlag2Line />
|
||||||
|
Genres
|
||||||
|
</Group>
|
||||||
|
</SidebarItem>
|
||||||
<SidebarItem
|
<SidebarItem
|
||||||
disabled
|
disabled
|
||||||
to={AppRoute.LIBRARY_FOLDERS}
|
to={AppRoute.LIBRARY_FOLDERS}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user