Wire up analytics for Legacy/EC/Jitsi voip options (#28348)

* Wire up analytics for Legacy/EC/Jitsi voip options

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Update @matrix-org/analytics-events

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

---------

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski
2024-11-04 09:49:41 +00:00
committed by GitHub
parent b1ef099cd6
commit 1ccbdb21e9
5 changed files with 49 additions and 31 deletions
+23 -12
View File
@@ -36,30 +36,41 @@ import { useGuestAccessInformation } from "./useGuestAccessInformation";
import SettingsStore from "../../settings/SettingsStore";
import { UIFeature } from "../../settings/UIFeature";
import { BetaPill } from "../../components/views/beta/BetaCard";
import { InteractionName } from "../../PosthogTrackers";
export enum PlatformCallType {
ElementCall,
JitsiCall,
LegacyCall,
}
export const getPlatformCallTypeLabel = (platformCallType: PlatformCallType): string => {
export const getPlatformCallTypeProps = (
platformCallType: PlatformCallType,
): {
label: string;
children?: ReactNode;
analyticsName: InteractionName;
} => {
switch (platformCallType) {
case PlatformCallType.ElementCall:
return _t("voip|element_call");
return {
label: _t("voip|element_call"),
analyticsName: "WebVoipOptionElementCall",
children: <BetaPill />,
};
case PlatformCallType.JitsiCall:
return _t("voip|jitsi_call");
return {
label: _t("voip|jitsi_call"),
analyticsName: "WebVoipOptionJitsi",
};
case PlatformCallType.LegacyCall:
return _t("voip|legacy_call");
}
};
export const getPlatformCallTypeChildren = (platformCallType: PlatformCallType): ReactNode => {
switch (platformCallType) {
case PlatformCallType.ElementCall:
return <BetaPill />;
default:
return null;
return {
label: _t("voip|legacy_call"),
analyticsName: "WebVoipOptionLegacy",
};
}
};
const enum State {
NoCall,
NoOneHere,