feat(toolbar-button-clicked) Enhance toolbar buttons with notify click

- add possibility to allow execution of the button's routine besides triggering
`toolbarButtonClicked` API event
- keep backwards compatibility
- get rid of `ToolbarButton`
This commit is contained in:
Horatiu Muresan
2022-01-04 13:21:00 +02:00
committed by GitHub
parent 847dc2a7bb
commit 197dbfbbcb
48 changed files with 459 additions and 524 deletions

View File

@@ -13,6 +13,11 @@ import PasswordSection from './PasswordSection';
type Props = {
/**
* Toolbar buttons which have their click exposed through the API.
*/
_buttonsWithNotifyClick: Array<string | Object>,
/**
* Whether or not the current user can modify the current password.
*/
@@ -57,6 +62,7 @@ type Props = {
* @returns {React$Element<any>}
*/
function SecurityDialog({
_buttonsWithNotifyClick,
_canEditPassword,
_conference,
_locked,
@@ -82,6 +88,7 @@ function SecurityDialog({
<div className = 'security-dialog'>
<LobbySection />
<PasswordSection
buttonsWithNotifyClick = { _buttonsWithNotifyClick }
canEditPassword = { _canEditPassword }
conference = { _conference }
locked = { _locked }
@@ -117,11 +124,12 @@ function mapStateToProps(state) {
locked,
password
} = state['features/base/conference'];
const { roomPasswordNumberOfDigits } = state['features/base/config'];
const { roomPasswordNumberOfDigits, buttonsWithNotifyClick } = state['features/base/config'];
const showE2ee = Boolean(e2eeSupported) && isLocalParticipantModerator(state);
return {
_buttonsWithNotifyClick: buttonsWithNotifyClick,
_canEditPassword: isLocalParticipantModerator(state),
_conference: conference,
_dialIn: state['features/invite'],