mirror of
https://github.com/netzbegruenung/jitsi-meet-electron.git
synced 2024-05-04 17:53:41 +02:00
f1846bd4cb
The term "action" is quite overloaded since we use redux, so let's call it "button" since that's how it behaves.
61 lines
1.1 KiB
JavaScript
61 lines
1.1 KiB
JavaScript
// @flow
|
|
|
|
import SettingsIcon from '@atlaskit/icon/glyph/settings';
|
|
|
|
import React, { Component } from 'react';
|
|
import { connect } from 'react-redux';
|
|
import type { Dispatch } from 'redux';
|
|
|
|
import { openDrawer } from '../../navbar';
|
|
|
|
import SettingsDrawer from './SettingsDrawer';
|
|
|
|
type Props = {
|
|
|
|
/**
|
|
* Redux dispatch.
|
|
*/
|
|
dispatch: Dispatch<*>;
|
|
};
|
|
|
|
/**
|
|
* Setttings button for Navigation Bar.
|
|
*/
|
|
class SettingButton extends Component<Props, *> {
|
|
/**
|
|
* Initializes a new {@code SettingButton} instance.
|
|
*
|
|
* @inheritdoc
|
|
*/
|
|
constructor() {
|
|
super();
|
|
|
|
this._onIconClick = this._onIconClick.bind(this);
|
|
}
|
|
|
|
/**
|
|
* Render function of component.
|
|
*
|
|
* @returns {ReactElement}
|
|
*/
|
|
render() {
|
|
return (
|
|
<SettingsIcon
|
|
onClick = { this._onIconClick } />
|
|
);
|
|
}
|
|
|
|
_onIconClick: (*) => void;
|
|
|
|
/**
|
|
* Open Settings drawer when SettingButton is clicked.
|
|
*
|
|
* @returns {void}
|
|
*/
|
|
_onIconClick() {
|
|
this.props.dispatch(openDrawer(SettingsDrawer));
|
|
}
|
|
}
|
|
|
|
export default connect()(SettingButton);
|