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.
- Loading branch information
1 parent
f295f60
commit 0a06e25
Showing
10 changed files
with
97 additions
and
51 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
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export * from './helpers'; | ||
export * from './httpUtils'; | ||
export * from './loadScript'; | ||
export * from './openURLInBrowser'; | ||
export * from './uri'; |
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,5 @@ | ||
// @flow | ||
|
||
import { getLogger } from '../logging/functions'; | ||
|
||
export default getLogger('features/base/util'); |
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,17 @@ | ||
// @flow | ||
|
||
import { Linking } from 'react-native'; | ||
|
||
import logger from './logger'; | ||
|
||
/** | ||
* Opens URL in the browser. | ||
* | ||
* @param {string} url - The URL to be opened. | ||
* @returns {void} | ||
*/ | ||
export function openURLInBrowser(url: string) { | ||
Linking.openURL(url).catch(error => { | ||
logger.error(`An error occurred while trying to open ${url}`, error); | ||
}); | ||
} |
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,11 @@ | ||
// @flow | ||
|
||
/** | ||
* Opens URL in the browser. | ||
* | ||
* @param {string} url - The URL to be opened. | ||
* @returns {void} | ||
*/ | ||
export function openURLInBrowser(url: string) { | ||
window.open(url, '', 'noopener'); | ||
} |
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,56 @@ | ||
// @flow | ||
|
||
import { createToolbarEvent, sendAnalytics } from '../../analytics'; | ||
import { translate } from '../../base/i18n'; | ||
import { IconHelp } from '../../base/icons'; | ||
import { connect } from '../../base/redux'; | ||
import { openURLInBrowser } from '../../base/util'; | ||
import { AbstractButton, type AbstractButtonProps } from '../../base/toolbox'; | ||
|
||
|
||
type Props = AbstractButtonProps & { | ||
|
||
/** | ||
* The URL to the user documenation. | ||
*/ | ||
_userDocumentationURL: string | ||
}; | ||
|
||
/** | ||
* Implements an {@link AbstractButton} to open the user documentation in a new window. | ||
*/ | ||
class HelpButton extends AbstractButton<Props, *> { | ||
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')); | ||
openURLInBrowser(this.props._userDocumentationURL); | ||
} | ||
} | ||
|
||
|
||
/** | ||
* Maps part of the redux state to the component's props. | ||
* | ||
* @param {Object} state - The redux store/state. | ||
* @returns {Object} | ||
*/ | ||
function _mapStateToProps(state: Object) { | ||
const { userDocumentationURL } = state['features/base/config']; | ||
const visible = typeof userDocumentationURL === 'string'; | ||
|
||
return { | ||
_userDocumentationURL: userDocumentationURL, | ||
visible | ||
}; | ||
} | ||
|
||
export default translate(connect(_mapStateToProps)(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
This file was deleted.
Oops, something went wrong.
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