ringcentral-widgets
Version:
RingCentral Integration Widget Library
52 lines (46 loc) • 1.14 kB
text/typescript
import { Module } from 'ringcentral-integration/lib/di';
import {
RcUIModuleV2,
UIFunctions,
UIProps,
} from '@ringcentral-integration/core';
import {
CallBadgeContainerProps,
CallBadgePanelProps,
Deps,
} from './CallBadgeUI.interface';
class CallBadgeUI extends RcUIModuleV2<Deps> {
constructor(deps: Deps) {
super({ deps });
}
getUIProps({
hidden,
defaultOffsetX = 0,
defaultOffsetY = 0,
}: CallBadgeContainerProps): UIProps<CallBadgePanelProps> {
const currentSession =
this._deps.webphone.activeSession ||
this._deps.webphone.ringSession ||
{};
return {
hidden,
defaultOffsetX,
defaultOffsetY,
session: currentSession,
currentLocale: this._deps.locale.currentLocale,
};
}
getUIFunctions({
goToCallCtrl,
}: CallBadgeContainerProps): UIFunctions<CallBadgePanelProps> {
return {
goToCallCtrl,
toggleMinimized: (id) => this._deps.webphone.toggleMinimized(id),
};
}
}
export { CallBadgeUI };