2022-05-29 17:53:27 +08:00
|
|
|
import Main from '@/web/components/New/Main'
|
|
|
|
import Player from '@/web/components/New/Player'
|
2022-06-08 00:07:04 +08:00
|
|
|
import MenuBar from '@/web/components/New/MenuBar'
|
2022-06-08 11:48:22 +08:00
|
|
|
import Topbar from '@/web/components/New/Topbar/TopbarDesktop'
|
2022-05-29 17:53:27 +08:00
|
|
|
import { css, cx } from '@emotion/css'
|
|
|
|
import { player } from '@/web/store'
|
|
|
|
import { useSnapshot } from 'valtio'
|
|
|
|
|
|
|
|
const Layout = () => {
|
|
|
|
const playerSnapshot = useSnapshot(player)
|
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-06-06 01:00:25 +08:00
|
|
|
'relative grid h-screen select-none overflow-hidden bg-white dark:bg-black',
|
2022-06-08 00:07:04 +08:00
|
|
|
window.env?.isElectron && 'rounded-24',
|
2022-05-29 17:53:27 +08:00
|
|
|
css`
|
|
|
|
grid-template-columns: 6.5rem auto 358px;
|
|
|
|
grid-template-rows: 132px auto;
|
|
|
|
`,
|
2022-06-06 01:00:25 +08:00
|
|
|
showPlayer
|
2022-05-29 17:53:27 +08:00
|
|
|
? css`
|
|
|
|
grid-template-areas:
|
2022-06-08 00:07:04 +08:00
|
|
|
'menubar main -'
|
|
|
|
'menubar main player';
|
2022-05-29 17:53:27 +08:00
|
|
|
`
|
|
|
|
: css`
|
|
|
|
grid-template-areas:
|
2022-06-08 00:07:04 +08:00
|
|
|
'menubar main main'
|
|
|
|
'menubar main main';
|
2022-05-29 17:53:27 +08:00
|
|
|
`
|
|
|
|
)}
|
|
|
|
>
|
2022-06-08 00:07:04 +08:00
|
|
|
<MenuBar />
|
2022-05-29 17:53:27 +08:00
|
|
|
<Topbar />
|
|
|
|
<Main />
|
2022-06-06 01:00:25 +08:00
|
|
|
{showPlayer && <Player />}
|
2022-05-29 17:53:27 +08:00
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default Layout
|