feat(components/system): implement TitleBar

This commit is contained in:
Walid 2023-04-23 20:14:05 +01:00
parent 2771e7b4cc
commit 4b9290636f
Signed by: Walidoux
GPG Key ID: CCF21881FE8BEBAF
2 changed files with 41 additions and 0 deletions

View 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>
)
}

View File

@ -0,0 +1 @@
export * from './TitleBar'