mirror of
https://github.com/vector-im/element-call.git
synced 2024-11-21 00:28:08 +08:00
Hide the 'profile' menu option in widget mode
The profile settings tab is non-functional in widget mode so we need to hide its other points of entry.
This commit is contained in:
parent
e06aaf6fd4
commit
d2aa6d561f
@ -260,10 +260,17 @@ export const InCallView: FC<InCallViewProps> = ({
|
|||||||
[setSettingsModalOpen],
|
[setSettingsModalOpen],
|
||||||
);
|
);
|
||||||
|
|
||||||
const openProfile = useCallback(() => {
|
const openProfile = useMemo(
|
||||||
|
() =>
|
||||||
|
// Profile settings are unavailable in widget mode
|
||||||
|
widget === null
|
||||||
|
? (): void => {
|
||||||
setSettingsTab("profile");
|
setSettingsTab("profile");
|
||||||
setSettingsModalOpen(true);
|
setSettingsModalOpen(true);
|
||||||
}, [setSettingsTab, setSettingsModalOpen]);
|
}
|
||||||
|
: null,
|
||||||
|
[setSettingsTab, setSettingsModalOpen],
|
||||||
|
);
|
||||||
|
|
||||||
const [headerRef, headerBounds] = useMeasure();
|
const [headerRef, headerBounds] = useMeasure();
|
||||||
const [footerRef, footerBounds] = useMeasure();
|
const [footerRef, footerBounds] = useMeasure();
|
||||||
|
@ -160,7 +160,7 @@ UserMediaTile.displayName = "UserMediaTile";
|
|||||||
|
|
||||||
interface LocalUserMediaTileProps extends TileProps {
|
interface LocalUserMediaTileProps extends TileProps {
|
||||||
vm: LocalUserMediaViewModel;
|
vm: LocalUserMediaViewModel;
|
||||||
onOpenProfile: () => void;
|
onOpenProfile: (() => void) | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const LocalUserMediaTile = forwardRef<HTMLDivElement, LocalUserMediaTileProps>(
|
const LocalUserMediaTile = forwardRef<HTMLDivElement, LocalUserMediaTileProps>(
|
||||||
@ -191,11 +191,13 @@ const LocalUserMediaTile = forwardRef<HTMLDivElement, LocalUserMediaTileProps>(
|
|||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
menuEnd={
|
menuEnd={
|
||||||
|
onOpenProfile && (
|
||||||
<MenuItem
|
<MenuItem
|
||||||
Icon={UserProfileIcon}
|
Icon={UserProfileIcon}
|
||||||
label={t("common.profile")}
|
label={t("common.profile")}
|
||||||
onSelect={onOpenProfile}
|
onSelect={onOpenProfile}
|
||||||
/>
|
/>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
{...props}
|
{...props}
|
||||||
/>
|
/>
|
||||||
@ -268,7 +270,7 @@ RemoteUserMediaTile.displayName = "RemoteUserMediaTile";
|
|||||||
|
|
||||||
interface GridTileProps {
|
interface GridTileProps {
|
||||||
vm: UserMediaViewModel;
|
vm: UserMediaViewModel;
|
||||||
onOpenProfile: () => void;
|
onOpenProfile: (() => void) | null;
|
||||||
targetWidth: number;
|
targetWidth: number;
|
||||||
targetHeight: number;
|
targetHeight: number;
|
||||||
className?: string;
|
className?: string;
|
||||||
|
Loading…
Reference in New Issue
Block a user