(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, 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>
)} )}

View file

@ -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>

View file

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