(fix): wrong portal for sidebarBox
All checks were successful
/ build-web (push) Successful in 1m10s
/ build-desktop (push) Successful in 11m34s
/ build-mobile (push) Successful in 16m10s
/ release (push) Successful in 22s

(qol): update todo
This commit is contained in:
Alois 2026-05-14 16:05:05 +02:00
commit f624dc7375
3 changed files with 14 additions and 4 deletions

View file

@ -18,10 +18,12 @@ export default function ScreenshareButton({
className,
iconSize,
tooltip,
defaultPortal,
}: {
className?: string;
iconSize?: number;
tooltip?: string;
defaultPortal?: boolean;
}) {
const isScreensharing = useCall((state) => state.screenShareEnabled);
const screenRef = useCall((state) => state.screenRef);
@ -30,8 +32,9 @@ export default function ScreenshareButton({
const [menuOpen, setMenuOpen] = useState(false);
useEffect(() => {
if (defaultPortal) return;
setPortalContainer(screenRef?.current ?? undefined);
}, [screenRef]);
}, [screenRef, defaultPortal]);
async function startWebShare() {
try {
@ -110,7 +113,9 @@ export default function ScreenshareButton({
/>
<PopoverContent
className="flex w-40 flex-col gap-2"
portalProps={{ container: portalContainer }}
portalProps={{
container: defaultPortal ? undefined : portalContainer,
}}
>
<Button
disabled={isScreensharing}
@ -141,7 +146,11 @@ export default function ScreenshareButton({
</PopoverContent>
</Popover>
{tooltip && (
<TooltipContent portalProps={{ container: portalContainer }}>
<TooltipContent
portalProps={{
container: defaultPortal ? undefined : portalContainer,
}}
>
{tooltip}
</TooltipContent>
)}

View file

@ -31,7 +31,7 @@ export default function SidebarBox() {
<div className="flex justify-start gap-1">
<MuteButton 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" />
</div>
</CardContent>

View file

@ -11,3 +11,4 @@
- Disconnect
- Desktop-App screenshares
- Context menus
- Popout Window