mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-17 21:58:03 +00:00
feat: 增加设置页面和支持自定义强调色
This commit is contained in:
parent
7e892997bd
commit
bc696ca59f
14 changed files with 499 additions and 41 deletions
|
|
@ -1,7 +1,6 @@
|
|||
import SvgIcon from '@/renderer/components/SvgIcon'
|
||||
import useScroll from '@/renderer/hooks/useScroll'
|
||||
import useUser from '@/renderer/hooks/useUser'
|
||||
import { resizeImage } from '@/renderer/utils/common'
|
||||
import Avatar from './Avatar'
|
||||
|
||||
const NavigationButtons = () => {
|
||||
const navigate = useNavigate()
|
||||
|
|
@ -67,9 +66,10 @@ const SearchBox = () => {
|
|||
}
|
||||
|
||||
const Settings = () => {
|
||||
const navigate = useNavigate()
|
||||
return (
|
||||
<div
|
||||
onClick={() => toast('施工中...')}
|
||||
onClick={() => navigate('/settings')}
|
||||
className='app-region-no-drag btn-hover-animation rounded-lg p-2.5 text-gray-500 transition duration-300 after:rounded-full after:bg-black/[.06] hover:text-gray-900 dark:text-gray-300 dark:after:bg-white/10 dark:hover:text-gray-200'
|
||||
>
|
||||
<SvgIcon className='h-[1.125rem] w-[1.125rem]' name='settings' />
|
||||
|
|
@ -77,34 +77,6 @@ const Settings = () => {
|
|||
)
|
||||
}
|
||||
|
||||
const Avatar = () => {
|
||||
const navigate = useNavigate()
|
||||
const { data: user } = useUser()
|
||||
|
||||
const avatarUrl = user?.profile?.avatarUrl
|
||||
? resizeImage(user?.profile?.avatarUrl ?? '', 'sm')
|
||||
: ''
|
||||
|
||||
return (
|
||||
<>
|
||||
{avatarUrl ? (
|
||||
<img
|
||||
src={avatarUrl}
|
||||
onClick={() => navigate('/login')}
|
||||
className='app-region-no-drag h-9 w-9 rounded-full bg-gray-100 dark:bg-gray-700'
|
||||
/>
|
||||
) : (
|
||||
<div onClick={() => navigate('/login')}>
|
||||
<SvgIcon
|
||||
name='user'
|
||||
className='h-9 w-9 rounded-full bg-black/[.06] p-1 text-gray-500'
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
const Topbar = () => {
|
||||
/**
|
||||
* Show topbar background when scroll down
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue