feat(components/system): implement TitleBar
This commit is contained in:
parent
2771e7b4cc
commit
4b9290636f
40
src/components/system/TitleBar/TitleBar.tsx
Normal file
40
src/components/system/TitleBar/TitleBar.tsx
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
import { Maximize, Minus, X } from 'react-feather'
|
||||||
|
import { appWindow } from '@tauri-apps/api/window'
|
||||||
|
|
||||||
|
import { Image } from '..'
|
||||||
|
|
||||||
|
export const TitleBar: React.FC = () => {
|
||||||
|
return (
|
||||||
|
<nav className='flex w-full h-[40px] !z-50 items-center justify-between bg-[#1f1f1f] text-white'>
|
||||||
|
<div
|
||||||
|
className='w-full select-none'
|
||||||
|
onMouseDown={async () => {
|
||||||
|
return await appWindow.startDragging()
|
||||||
|
}}>
|
||||||
|
<Image src='/Logo.svg' size={60} className='ml-3 p-1' />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<ul className='flex h-full'>
|
||||||
|
<li
|
||||||
|
className='grid h-full w-14 cursor-pointer place-items-center transition-colors duration-[10ms] hover:bg-[#2a2a2a]'
|
||||||
|
onClick={async () => {
|
||||||
|
return await appWindow.minimize()
|
||||||
|
}}>
|
||||||
|
<Minus />
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li className='grid h-full w-14 place-items-center cursor-not-allowed opacity-40'>
|
||||||
|
<Maximize size={20} />
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li
|
||||||
|
className='grid h-full w-14 cursor-pointer place-items-center transition-colors duration-[10ms] hover:bg-red-500'
|
||||||
|
onClick={async () => {
|
||||||
|
return await appWindow.close()
|
||||||
|
}}>
|
||||||
|
<X />
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
)
|
||||||
|
}
|
1
src/components/system/TitleBar/index.ts
Normal file
1
src/components/system/TitleBar/index.ts
Normal file
@ -0,0 +1 @@
|
|||||||
|
export * from './TitleBar'
|
Loading…
Reference in New Issue
Block a user