⚰️(frontend) remove dead code
With chat refactoring, few lines of code was dead. Fix it!
This commit is contained in:
committed by
aleb_the_flash
parent
d2f239e6a2
commit
290ba4274a
@@ -3,13 +3,9 @@ import * as React from 'react'
|
|||||||
|
|
||||||
import { supportsScreenSharing } from '@livekit/components-core'
|
import { supportsScreenSharing } from '@livekit/components-core'
|
||||||
|
|
||||||
import {
|
import { usePersistentUserChoices } from '@livekit/components-react'
|
||||||
useMaybeLayoutContext,
|
|
||||||
usePersistentUserChoices,
|
|
||||||
} from '@livekit/components-react'
|
|
||||||
|
|
||||||
import { StartMediaButton } from '../components/controls/StartMediaButton'
|
import { StartMediaButton } from '../components/controls/StartMediaButton'
|
||||||
import { useMediaQuery } from '../hooks/useMediaQuery'
|
|
||||||
import { OptionsButton } from '../components/controls/Options/OptionsButton'
|
import { OptionsButton } from '../components/controls/Options/OptionsButton'
|
||||||
import { ParticipantsToggle } from '../components/controls/Participants/ParticipantsToggle'
|
import { ParticipantsToggle } from '../components/controls/Participants/ParticipantsToggle'
|
||||||
import { ChatToggle } from '../components/controls/ChatToggle'
|
import { ChatToggle } from '../components/controls/ChatToggle'
|
||||||
@@ -60,25 +56,9 @@ export interface ControlBarProps extends React.HTMLAttributes<HTMLDivElement> {
|
|||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
export function ControlBar({
|
export function ControlBar({
|
||||||
variation,
|
|
||||||
saveUserChoices = true,
|
saveUserChoices = true,
|
||||||
onDeviceError,
|
onDeviceError,
|
||||||
}: ControlBarProps) {
|
}: ControlBarProps) {
|
||||||
const [isChatOpen, setIsChatOpen] = React.useState(false)
|
|
||||||
const layoutContext = useMaybeLayoutContext()
|
|
||||||
React.useEffect(() => {
|
|
||||||
if (layoutContext?.widget.state?.showChat !== undefined) {
|
|
||||||
setIsChatOpen(layoutContext?.widget.state?.showChat)
|
|
||||||
}
|
|
||||||
}, [layoutContext?.widget.state?.showChat])
|
|
||||||
|
|
||||||
const isTooLittleSpace = useMediaQuery(
|
|
||||||
`(max-width: ${isChatOpen ? 1000 : 760}px)`
|
|
||||||
)
|
|
||||||
|
|
||||||
const defaultVariation = isTooLittleSpace ? 'minimal' : 'verbose'
|
|
||||||
variation ??= defaultVariation
|
|
||||||
|
|
||||||
const browserSupportsScreenSharing = supportsScreenSharing()
|
const browserSupportsScreenSharing = supportsScreenSharing()
|
||||||
|
|
||||||
const {
|
const {
|
||||||
|
|||||||
Reference in New Issue
Block a user