forked from jitsi/jitsi-meet-electron
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Showing
16 changed files
with
237 additions
and
50 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
78 changes: 78 additions & 0 deletions
78
app/features/onboarding/components/AlwaysOnTopWindowSpotlight.js
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,78 @@ | ||
// @flow | ||
|
||
import { Spotlight } from '@atlaskit/onboarding'; | ||
|
||
import React, { Component } from 'react'; | ||
import { connect } from 'react-redux'; | ||
import type { Dispatch } from 'redux'; | ||
|
||
import { closeDrawer } from '../../navbar'; | ||
|
||
import { continueOnboarding } from '../actions'; | ||
|
||
type Props = { | ||
|
||
/** | ||
* Redux dispatch. | ||
*/ | ||
dispatch: Dispatch<*>; | ||
}; | ||
|
||
/** | ||
* Always on Top Windows Spotlight Component. | ||
*/ | ||
class AlwaysOnTopWindowSpotlight extends Component<Props, *> { | ||
/** | ||
* Initializes a new {@code StartMutedTogglesSpotlight} instance. | ||
* | ||
* @inheritdoc | ||
*/ | ||
constructor(props: Props) { | ||
super(props); | ||
|
||
this._next = this._next.bind(this); | ||
} | ||
|
||
/** | ||
* Render function of component. | ||
* | ||
* @returns {ReactElement} | ||
*/ | ||
render() { | ||
return ( | ||
<Spotlight | ||
actions = { [ | ||
{ | ||
onClick: this._next, | ||
text: 'Next' | ||
} | ||
] } | ||
dialogPlacement = 'left top' | ||
target = { 'always-on-top-window' } > | ||
You can toggle whether you want to enable the "always-on-top" window, | ||
which is displayed when the main window loses focus. | ||
This will be applied to all conferences. | ||
</Spotlight> | ||
); | ||
} | ||
|
||
_next: (*) => void; | ||
|
||
/** | ||
* Close the spotlight component. | ||
* | ||
* @returns {void} | ||
*/ | ||
_next() { | ||
const { dispatch } = this.props; | ||
|
||
dispatch(continueOnboarding()); | ||
|
||
// FIXME: find a better way to do this. | ||
setTimeout(() => { | ||
dispatch(closeDrawer()); | ||
}, 300); | ||
} | ||
} | ||
|
||
export default connect()(AlwaysOnTopWindowSpotlight); |
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
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
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,20 @@ | ||
// @flow | ||
|
||
/** | ||
* Get's the value for the given setting, providing a default value. | ||
* | ||
* @param {Object} state - The redux state. | ||
* @param {string} setting - The name for the desired setting. | ||
* @param {*} defaultValue - The default value, in case the setting is | ||
* undefined. | ||
* @returns {*} The setting value. | ||
*/ | ||
export function getSetting(state: Object, setting: string, defaultValue: any) { | ||
const value = state.settings[setting]; | ||
|
||
if (typeof value === 'undefined') { | ||
return defaultValue; | ||
} | ||
|
||
return value; | ||
} |
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
Oops, something went wrong.