apply loading backdrop when loading livestreams
This commit is contained in:
@@ -1,10 +1,10 @@
|
|||||||
import { Backdrop, CircularProgress } from '@mui/material'
|
import { Backdrop, CircularProgress } from '@mui/material'
|
||||||
import { useRecoilValue } from 'recoil'
|
|
||||||
import { loadingAtom } from '../atoms/ui'
|
|
||||||
|
|
||||||
const LoadingBackdrop: React.FC = () => {
|
type Props = {
|
||||||
const isLoading = useRecoilValue(loadingAtom)
|
isLoading: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
const LoadingBackdrop: React.FC<Props> = ({ isLoading }) => {
|
||||||
return (
|
return (
|
||||||
<Backdrop
|
<Backdrop
|
||||||
sx={{ color: '#fff', zIndex: (theme) => theme.zIndex.drawer + 1 }}
|
sx={{ color: '#fff', zIndex: (theme) => theme.zIndex.drawer + 1 }}
|
||||||
|
|||||||
@@ -1,15 +1,19 @@
|
|||||||
import {
|
import {
|
||||||
Container
|
Container
|
||||||
} from '@mui/material'
|
} from '@mui/material'
|
||||||
|
import { useRecoilValue } from 'recoil'
|
||||||
|
import { loadingAtom } from '../atoms/ui'
|
||||||
import Downloads from '../components/Downloads'
|
import Downloads from '../components/Downloads'
|
||||||
import HomeActions from '../components/HomeActions'
|
import HomeActions from '../components/HomeActions'
|
||||||
import LoadingBackdrop from '../components/LoadingBackdrop'
|
import LoadingBackdrop from '../components/LoadingBackdrop'
|
||||||
import Splash from '../components/Splash'
|
import Splash from '../components/Splash'
|
||||||
|
|
||||||
export default function Home() {
|
export default function Home() {
|
||||||
|
const isLoading = useRecoilValue(loadingAtom)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Container maxWidth="xl" sx={{ mt: 2, mb: 8 }}>
|
<Container maxWidth="xl" sx={{ mt: 2, mb: 8 }}>
|
||||||
<LoadingBackdrop />
|
<LoadingBackdrop isLoading={isLoading} />
|
||||||
<Splash />
|
<Splash />
|
||||||
<Downloads />
|
<Downloads />
|
||||||
<HomeActions />
|
<HomeActions />
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import { interval } from 'rxjs'
|
|||||||
import LivestreamDialog from '../components/livestream/LivestreamDialog'
|
import LivestreamDialog from '../components/livestream/LivestreamDialog'
|
||||||
import LivestreamSpeedDial from '../components/livestream/LivestreamSpeedDial'
|
import LivestreamSpeedDial from '../components/livestream/LivestreamSpeedDial'
|
||||||
import NoLivestreams from '../components/livestream/NoLivestreams'
|
import NoLivestreams from '../components/livestream/NoLivestreams'
|
||||||
|
import LoadingBackdrop from '../components/LoadingBackdrop'
|
||||||
import { useSubscription } from '../hooks/observable'
|
import { useSubscription } from '../hooks/observable'
|
||||||
import { useRPC } from '../hooks/useRPC'
|
import { useRPC } from '../hooks/useRPC'
|
||||||
import { LiveStreamProgress, LiveStreamStatus } from '../types'
|
import { LiveStreamProgress, LiveStreamStatus } from '../types'
|
||||||
@@ -65,6 +66,8 @@ const LiveStreamMonitorView: React.FC = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
<LoadingBackdrop isLoading={!progress} />
|
||||||
|
|
||||||
<LivestreamSpeedDial onOpen={() => setOpenDialog(s => !s)} onStopAll={stopAll} />
|
<LivestreamSpeedDial onOpen={() => setOpenDialog(s => !s)} onStopAll={stopAll} />
|
||||||
<LivestreamDialog open={openDialog} onClose={() => setOpenDialog(s => !s)} />
|
<LivestreamDialog open={openDialog} onClose={() => setOpenDialog(s => !s)} />
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user