(fix): wrong portal for sidebarBox
(qol): update todo
This commit is contained in:
parent
8954e4193e
commit
f624dc7375
3 changed files with 14 additions and 4 deletions
|
|
@ -18,10 +18,12 @@ export default function ScreenshareButton({
|
||||||
className,
|
className,
|
||||||
iconSize,
|
iconSize,
|
||||||
tooltip,
|
tooltip,
|
||||||
|
defaultPortal,
|
||||||
}: {
|
}: {
|
||||||
className?: string;
|
className?: string;
|
||||||
iconSize?: number;
|
iconSize?: number;
|
||||||
tooltip?: string;
|
tooltip?: string;
|
||||||
|
defaultPortal?: boolean;
|
||||||
}) {
|
}) {
|
||||||
const isScreensharing = useCall((state) => state.screenShareEnabled);
|
const isScreensharing = useCall((state) => state.screenShareEnabled);
|
||||||
const screenRef = useCall((state) => state.screenRef);
|
const screenRef = useCall((state) => state.screenRef);
|
||||||
|
|
@ -30,8 +32,9 @@ export default function ScreenshareButton({
|
||||||
const [menuOpen, setMenuOpen] = useState(false);
|
const [menuOpen, setMenuOpen] = useState(false);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
if (defaultPortal) return;
|
||||||
setPortalContainer(screenRef?.current ?? undefined);
|
setPortalContainer(screenRef?.current ?? undefined);
|
||||||
}, [screenRef]);
|
}, [screenRef, defaultPortal]);
|
||||||
|
|
||||||
async function startWebShare() {
|
async function startWebShare() {
|
||||||
try {
|
try {
|
||||||
|
|
@ -110,7 +113,9 @@ export default function ScreenshareButton({
|
||||||
/>
|
/>
|
||||||
<PopoverContent
|
<PopoverContent
|
||||||
className="flex w-40 flex-col gap-2"
|
className="flex w-40 flex-col gap-2"
|
||||||
portalProps={{ container: portalContainer }}
|
portalProps={{
|
||||||
|
container: defaultPortal ? undefined : portalContainer,
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<Button
|
<Button
|
||||||
disabled={isScreensharing}
|
disabled={isScreensharing}
|
||||||
|
|
@ -141,7 +146,11 @@ export default function ScreenshareButton({
|
||||||
</PopoverContent>
|
</PopoverContent>
|
||||||
</Popover>
|
</Popover>
|
||||||
{tooltip && (
|
{tooltip && (
|
||||||
<TooltipContent portalProps={{ container: portalContainer }}>
|
<TooltipContent
|
||||||
|
portalProps={{
|
||||||
|
container: defaultPortal ? undefined : portalContainer,
|
||||||
|
}}
|
||||||
|
>
|
||||||
{tooltip}
|
{tooltip}
|
||||||
</TooltipContent>
|
</TooltipContent>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ export default function SidebarBox() {
|
||||||
<div className="flex justify-start gap-1">
|
<div className="flex justify-start gap-1">
|
||||||
<MuteButton className="w-9 h-9" />
|
<MuteButton className="w-9 h-9" />
|
||||||
<DeafButton className="w-9 h-9" />
|
<DeafButton className="w-9 h-9" />
|
||||||
<ScreenshareButton className="w-9 h-9" />
|
<ScreenshareButton className="w-9 h-9" defaultPortal />
|
||||||
<LeaveButton className="w-9 h-9" />
|
<LeaveButton className="w-9 h-9" />
|
||||||
</div>
|
</div>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
|
|
|
||||||
|
|
@ -11,3 +11,4 @@
|
||||||
- Disconnect
|
- Disconnect
|
||||||
- Desktop-App screenshares
|
- Desktop-App screenshares
|
||||||
- Context menus
|
- Context menus
|
||||||
|
- Popout Window
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue