mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-09 20:29:36 +02:00
Refactor now playing route with controls
This commit is contained in:
@@ -27,7 +27,10 @@ export const NowPlayingHeader = () => {
|
|||||||
})
|
})
|
||||||
.then((color) => {
|
.then((color) => {
|
||||||
const isDark = color.isDark;
|
const isDark = color.isDark;
|
||||||
setHeaderColor({ isDark, value: getHeaderColor(color.rgb, theme === 'dark' ? 0.3 : 1) });
|
setHeaderColor({
|
||||||
|
isDark,
|
||||||
|
value: getHeaderColor(color.rgb, theme === 'dark' ? 0.3 : 0.8),
|
||||||
|
});
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
|
|||||||
@@ -1,18 +1,34 @@
|
|||||||
import { Box } from '@mantine/core';
|
import { useRef } from 'react';
|
||||||
import styled from 'styled-components';
|
import type { AgGridReact as AgGridReactType } from '@ag-grid-community/react/lib/agGridReact';
|
||||||
|
import { Stack } from '@mantine/core';
|
||||||
|
import { NowPlayingHeader } from '/@/features/now-playing/components/now-playing-header';
|
||||||
import { PlayQueue } from '/@/features/now-playing/components/play-queue';
|
import { PlayQueue } from '/@/features/now-playing/components/play-queue';
|
||||||
|
import { PlayQueueListControls } from '/@/features/now-playing/components/play-queue-list-controls';
|
||||||
const QueueContainer = styled(Box)`
|
import type { Song } from '/@/api/types';
|
||||||
position: relative;
|
import { AnimatedPage } from '/@/features/shared';
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
`;
|
|
||||||
|
|
||||||
const NowPlayingRoute = () => {
|
const NowPlayingRoute = () => {
|
||||||
|
const queueRef = useRef<{ grid: AgGridReactType<Song> } | null>(null);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<QueueContainer>
|
<AnimatedPage>
|
||||||
<PlayQueue type="nowPlaying" />
|
<Stack
|
||||||
</QueueContainer>
|
pb="1rem"
|
||||||
|
spacing={0}
|
||||||
|
sx={{ height: '100%' }}
|
||||||
|
>
|
||||||
|
<NowPlayingHeader />
|
||||||
|
<PlayQueue
|
||||||
|
ref={queueRef}
|
||||||
|
type="nowPlaying"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<PlayQueueListControls
|
||||||
|
tableRef={queueRef}
|
||||||
|
type="nowPlaying"
|
||||||
|
/>
|
||||||
|
</Stack>
|
||||||
|
</AnimatedPage>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user