2022-10-28 20:29:04 +08:00
|
|
|
import Main from '@/web/components/Main'
|
|
|
|
import Player from '@/web/components/Player'
|
|
|
|
import MenuBar from '@/web/components/MenuBar'
|
|
|
|
import Topbar from '@/web/components/Topbar/TopbarDesktop'
|
2023-01-07 14:39:03 +08:00
|
|
|
import { cx } from '@emotion/css'
|
2022-07-11 11:06:41 +08:00
|
|
|
import player from '@/web/states/player'
|
2022-05-29 17:53:27 +08:00
|
|
|
import { useSnapshot } from 'valtio'
|
2022-06-14 23:23:34 +08:00
|
|
|
import Login from './Login'
|
2022-07-11 11:06:41 +08:00
|
|
|
import TrafficLight from './TrafficLight'
|
2022-08-03 23:48:39 +08:00
|
|
|
import BlurBackground from './BlurBackground'
|
|
|
|
import TitleBar from './TitleBar'
|
|
|
|
import uiStates from '@/web/states/uiStates'
|
2022-08-22 16:51:23 +08:00
|
|
|
import ContextMenus from './ContextMenus/ContextMenus'
|
2022-05-29 17:53:27 +08:00
|
|
|
|
|
|
|
const Layout = () => {
|
|
|
|
const playerSnapshot = useSnapshot(player)
|
2022-08-03 23:48:39 +08:00
|
|
|
const { fullscreen } = useSnapshot(uiStates)
|
2022-06-11 00:19:07 +08:00
|
|
|
const showPlayer = !!playerSnapshot.track
|
2022-05-29 17:53:27 +08:00
|
|
|
|
|
|
|
return (
|
|
|
|
<div
|
|
|
|
id='layout'
|
|
|
|
className={cx(
|
2022-10-28 20:29:04 +08:00
|
|
|
'relative grid h-screen select-none overflow-hidden bg-white dark:bg-black',
|
|
|
|
window.env?.isElectron && !fullscreen && 'rounded-24'
|
2022-05-29 17:53:27 +08:00
|
|
|
)}
|
|
|
|
>
|
2022-08-03 23:48:39 +08:00
|
|
|
<BlurBackground />
|
2022-06-08 00:07:04 +08:00
|
|
|
<MenuBar />
|
2022-05-29 17:53:27 +08:00
|
|
|
<Topbar />
|
|
|
|
<Main />
|
2022-06-14 23:23:34 +08:00
|
|
|
<Login />
|
2022-06-06 01:00:25 +08:00
|
|
|
{showPlayer && <Player />}
|
2022-07-11 11:06:41 +08:00
|
|
|
|
|
|
|
{window.env?.isMac && (
|
|
|
|
<div className='fixed top-6 left-6 z-30 translate-y-0.5'>
|
|
|
|
<TrafficLight />
|
|
|
|
</div>
|
|
|
|
)}
|
2022-08-03 23:48:39 +08:00
|
|
|
|
2023-01-07 14:39:03 +08:00
|
|
|
{(window.env?.isWindows ||
|
|
|
|
window.env?.isLinux ||
|
|
|
|
window.localStorage.getItem('showWindowsTitleBar') === 'true') && (
|
|
|
|
<TitleBar />
|
|
|
|
)}
|
2022-08-22 16:51:23 +08:00
|
|
|
|
|
|
|
<ContextMenus />
|
2022-08-03 23:48:39 +08:00
|
|
|
|
|
|
|
{/* {window.env?.isElectron && <Airplay />} */}
|
2022-05-29 17:53:27 +08:00
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default Layout
|