forked from jitsi/jitsi-meet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(HelpOverflowButton): Implement.
- Loading branch information
1 parent
4a8f787
commit f295f60
Showing
6 changed files
with
88 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// @flow | ||
|
||
import { createToolbarEvent, sendAnalytics } from '../../../analytics'; | ||
import { translate } from '../../../base/i18n'; | ||
import { IconHelp } from '../../../base/icons'; | ||
import { AbstractButton, type AbstractButtonProps } from '../../../base/toolbox'; | ||
|
||
declare var interfaceConfig: Object; | ||
|
||
/** | ||
* Implements an {@link AbstractButton} to open the user documentation in a new window. | ||
*/ | ||
class HelpButton extends AbstractButton<AbstractButtonProps, *> { | ||
accessibilityLabel = 'toolbar.accessibilityLabel.help'; | ||
icon = IconHelp; | ||
label = 'toolbar.help'; | ||
|
||
/** | ||
* Handles clicking / pressing the button, and opens a new window with the user documentation. | ||
* | ||
* @private | ||
* @returns {void} | ||
*/ | ||
_handleClick() { | ||
sendAnalytics(createToolbarEvent('help.pressed')); | ||
window.open(interfaceConfig.HELP_LINK); | ||
} | ||
|
||
/** | ||
* Implements React's {@link Component#render()}. | ||
* | ||
* @inheritdoc | ||
* @returns {React$Node} | ||
*/ | ||
render(): React$Node { | ||
if (typeof interfaceConfig.HELP_LINK === 'string') { | ||
return super.render(); | ||
} | ||
|
||
return null; | ||
} | ||
} | ||
|
||
export default translate(HelpButton); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters