Files
jitsi-meet/react/features/toolbox/components/web/CustomOptionButton.tsx
Gabriel Borlea 1a113ba733 feat: add custom buttons for participant menu and toolbar via config (#12832)
* add custom remote menu button

* add config for custom buttons

* whitelist custom buttons flag

* add toolbox custom button

* fix notify toolbox buttons

* whitelist toolbar custom buttons

* rename and fix notify

* rename participant remote menu

* revert some flag wrong changes

* fix some formatings

* add undefined type to custom buttons toolbox

* code review

* code review 2

* fix linting issue
2023-02-09 13:12:00 +02:00

45 lines
887 B
TypeScript

import React from 'react';
// eslint-disable-next-line lines-around-comment
// @ts-ignore
import { AbstractButton, type AbstractButtonProps } from '../../../base/toolbox/components';
type Props = AbstractButtonProps & {
icon: string;
text: string;
};
/**
* Component that renders a custom toolbox button.
*
* @returns {Component}
*/
class CustomOptionButton extends AbstractButton<Props, any, any> {
// @ts-ignore
iconSrc = this.props.icon;
// @ts-ignore
id = this.props.id;
// @ts-ignore
text = this.props.text;
accessibilityLabel = this.text;
/**
* Custom icon component.
*
* @param {any} props - Icon's props.
* @returns {img}
*/
icon = (props: any) => (<img
src = { this.iconSrc }
{ ...props } />);
label = this.text;
tooltip = this.text;
}
export default CustomOptionButton;