Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function SampleDataChannelPlugin(
pluginApi.setMediaAreaItems([
new MediaAreaOption({
label: 'Click to increment data-channel',
icon: 'user',
icon: { iconName: 'user' },
tooltip: 'this is a button injected by plugin',
dataTest: 'incrementDataChannelButtonPlugin',
allowed: true,
Expand All @@ -56,7 +56,7 @@ function SampleDataChannelPlugin(
},
}), new MediaAreaOption({
label: 'Click wipe data off data-channel',
icon: 'user',
icon: { iconName: 'user' },
tooltip: 'this is a button injected by plugin',
allowed: true,
dataTest: 'wipeDataOffButtonPlugin',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function SampleGenericContentSidekickPlugin(
}),
new MediaAreaOption({
label: 'Click to increment the badge',
icon: 'user',
icon: { iconName: 'user' },
tooltip: 'Use it to enable the badge',
allowed: true,
onClick: () => {
Expand All @@ -80,7 +80,7 @@ function SampleGenericContentSidekickPlugin(
}),
new MediaAreaOption({
label: 'Click to change menu name',
icon: 'user',
icon: { iconName: 'user' },
tooltip: 'Use it to change menu name',
allowed: true,
onClick: () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function SampleMediaAreaPlugin(
}),
new MediaAreaOption({
label: 'Button injected by plugin',
icon: 'copy',
icon: { iconName: 'copy' },
tooltip: 'this is a button injected by plugin',
allowed: true,
dataTest: 'mediaAreaOption',
Expand All @@ -41,7 +41,7 @@ function SampleMediaAreaPlugin(
}),
new MediaAreaOption({
label: 'Smart layout',
icon: 'copy',
icon: { iconName: 'copy' },
tooltip: 'this is a button injected by plugin',
allowed: true,
onClick: () => {
Expand All @@ -52,7 +52,7 @@ function SampleMediaAreaPlugin(
}),
new MediaAreaOption({
label: 'Media Only',
icon: 'copy',
icon: { iconName: 'copy' },
tooltip: 'this is a button injected by plugin',
allowed: true,
onClick: () => {
Expand All @@ -63,7 +63,7 @@ function SampleMediaAreaPlugin(
}),
new MediaAreaOption({
label: 'Participants and chat Only',
icon: 'copy',
icon: { iconName: 'copy' },
tooltip: 'this is a button injected by plugin',
allowed: true,
onClick: () => {
Expand All @@ -74,7 +74,7 @@ function SampleMediaAreaPlugin(
}),
new MediaAreaOption({
label: 'Presentation Only',
icon: 'copy',
icon: { iconName: 'copy' },
tooltip: 'this is a button injected by plugin',
allowed: true,
onClick: () => {
Expand All @@ -85,7 +85,7 @@ function SampleMediaAreaPlugin(
}),
new MediaAreaOption({
label: 'Cameras Only',
icon: 'copy',
icon: { iconName: 'copy' },
tooltip: 'this is a button injected by plugin',
allowed: true,
onClick: () => {
Expand All @@ -96,7 +96,7 @@ function SampleMediaAreaPlugin(
}),
new MediaAreaOption({
label: 'Plugins only',
icon: 'copy',
icon: { iconName: 'copy' },
tooltip: 'this is a button injected by plugin',
allowed: true,
onClick: () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function SampleServerCommandsPluginItem(
}),
new MediaAreaOption({
label: 'Send chat message',
icon: 'chat',
icon: { iconName: 'chat' },
tooltip: 'This is a button to send chat message',
allowed: true,
onClick: () => {
Expand All @@ -45,7 +45,7 @@ function SampleServerCommandsPluginItem(
}),
new MediaAreaOption({
label: 'Send custom chat message',
icon: 'chat',
icon: { iconName: 'chat' },
tooltip: 'This is a button to send chat message',
allowed: true,
onClick: () => {
Expand Down
9 changes: 5 additions & 4 deletions src/extensible-areas/media-area-item/component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { MediaAreaItemType } from './enums';
import {
MediaAreaInterface, MediaAreaOptionProps,
MediaAreaInterface, MediaAreaOptionProps, MediaAreaIconType,
} from './types';

// MediaArea Extensible Area
Expand All @@ -12,7 +12,7 @@ export class MediaAreaOption implements MediaAreaInterface {

label: string;

icon: string;
icon: MediaAreaIconType;

tooltip: string;

Expand All @@ -26,7 +26,8 @@ export class MediaAreaOption implements MediaAreaInterface {
* Returns the option for the media area
*
* @param label - label to be displayed on the option
* @param icon - icon to be displayed on the option
* @param icon - icon to be used in the button for the action bar - it can be the iconName
* from BigbBlueButton or an svg
* @param tooltip - tooltip to be displayed when hovering over option
* @param dataTest - string attribute to be used for testing
* @param allowed - boolean indicating whether the option should be displayed
Expand All @@ -35,7 +36,7 @@ export class MediaAreaOption implements MediaAreaInterface {
* @returns the option to be displayed in the media area
*/
constructor({
id, label = '', icon = '', tooltip = '', dataTest = '', allowed = true, onClick = () => {},
id, label = '', icon, tooltip = '', dataTest = '', allowed = true, onClick = () => {},
}: MediaAreaOptionProps) {
if (id) {
this.id = id;
Expand Down
15 changes: 14 additions & 1 deletion src/extensible-areas/media-area-item/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,23 @@ import { PluginProvidedUiItemDescriptor } from '../base';
export interface MediaAreaInterface extends PluginProvidedUiItemDescriptor{
}

export interface MediaAreaButtonIconSvg {
svgContent: React.SVGProps<SVGSVGElement>;
}

export interface MediaAreaButtonIconName {
/**
* Default icon name defined by BBB (see options there).
*/
iconName: string;
}

export type MediaAreaIconType = MediaAreaButtonIconSvg | MediaAreaButtonIconName

export interface MediaAreaOptionProps {
id?: string;
label: string;
icon: string;
icon: MediaAreaIconType;
tooltip: string;
dataTest?: string;
allowed: boolean;
Expand Down