Browse Source

ref(toolbar): remove Video Quality Button

master
Leonard Kim 7 years ago
parent
commit
7d86e3f8e7

+ 1
- 1
react/features/invite/components/InfoDialogButton.web.js View File

@@ -78,7 +78,7 @@ class InfoDialogButton extends Component {
78 78
     };
79 79
 
80 80
     /**
81
-     * Initializes new {@code ToolbarButtonWithDialog} instance.
81
+     * Initializes new {@code InfoDialogButton} instance.
82 82
      *
83 83
      * @param {Object} props - The read-only properties with which the new
84 84
      * instance is to be initialized.

+ 0
- 0
react/features/toolbox/components/ToolbarButtonWithDialog.native.js View File


+ 0
- 152
react/features/toolbox/components/ToolbarButtonWithDialog.web.js View File

@@ -1,152 +0,0 @@
1
-import InlineDialog from '@atlaskit/inline-dialog';
2
-import PropTypes from 'prop-types';
3
-import React, { Component } from 'react';
4
-import { connect } from 'react-redux';
5
-
6
-import { TOOLTIP_TO_POPUP_POSITION } from '../constants';
7
-import ToolbarButton from './ToolbarButton';
8
-
9
-/**
10
- * React {@code Component} for displaying a button which will open an inline
11
- * dialog.
12
- *
13
- * @extends Component
14
- */
15
-class ToolbarButtonWithDialog extends Component {
16
-    /**
17
-     * {@code ToolbarButtonWithDialog}'s property types.
18
-     *
19
-     * @static
20
-     */
21
-    static propTypes = {
22
-        /**
23
-         * Whether or not the button is visible, based on the visibility of the
24
-         * toolbar. Used to automatically hide {@code InlineDialog} if not
25
-         * visible.
26
-         */
27
-        _visible: PropTypes.bool,
28
-
29
-        /**
30
-         * A configuration object to describe how {@code ToolbarButton} should
31
-         * render.
32
-         *
33
-         */
34
-        button: PropTypes.object,
35
-
36
-        /**
37
-         * The React Component to show within {@code InlineDialog}.
38
-         */
39
-        content: PropTypes.func,
40
-
41
-        /**
42
-         * From which side tooltips should display. Will be re-used for
43
-         * displaying the inline dialog for video quality adjustment.
44
-         */
45
-        tooltipPosition: PropTypes.string
46
-    };
47
-
48
-    /**
49
-     * Initializes new {@code ToolbarButtonWithDialog} instance.
50
-     *
51
-     * @param {Object} props - The read-only properties with which the new
52
-     * instance is to be initialized.
53
-     */
54
-    constructor(props) {
55
-        super(props);
56
-
57
-        this.state = {
58
-            /**
59
-             * Whether or not the inline dialog should be displayed.
60
-             */
61
-            showDialog: false
62
-        };
63
-
64
-        // Bind event handlers so they are only bound once for every instance.
65
-        this._onDialogClose = this._onDialogClose.bind(this);
66
-        this._onDialogToggle = this._onDialogToggle.bind(this);
67
-    }
68
-
69
-    /**
70
-     * Automatically close the inline dialog if the button will not be visible.
71
-     *
72
-     * @inheritdoc
73
-     * @returns {void}
74
-     */
75
-    componentWillReceiveProps(nextProps) {
76
-        if (!nextProps._visible) {
77
-            this._onDialogClose();
78
-        }
79
-    }
80
-
81
-    /**
82
-     * Implements React's {@link Component#render()}.
83
-     *
84
-     * @inheritdoc
85
-     * @returns {ReactElement}
86
-     */
87
-    render() {
88
-        const { _visible, content, tooltipPosition } = this.props;
89
-        const buttonConfiguration = {
90
-            ...this.props.button,
91
-            classNames: [
92
-                ...this.props.button.classNames,
93
-                this.state.showDialog ? 'toggled button-active' : ''
94
-            ]
95
-        };
96
-
97
-        const Content = content;
98
-
99
-        return (
100
-            <InlineDialog
101
-                content = { <Content onClose = { this._onDialogClose } /> }
102
-                isOpen = { _visible && this.state.showDialog }
103
-                onClose = { this._onDialogClose }
104
-                position = { TOOLTIP_TO_POPUP_POSITION[tooltipPosition] }>
105
-                <ToolbarButton
106
-                    button = { buttonConfiguration }
107
-                    onClick = { this._onDialogToggle }
108
-                    tooltipPosition = { tooltipPosition } />
109
-            </InlineDialog>
110
-        );
111
-    }
112
-
113
-    /**
114
-     * Hides the attached inline dialog.
115
-     *
116
-     * @private
117
-     * @returns {void}
118
-     */
119
-    _onDialogClose() {
120
-        this.setState({ showDialog: false });
121
-    }
122
-
123
-    /**
124
-     * Toggles the display of the dialog.
125
-     *
126
-     * @private
127
-     * @returns {void}
128
-     */
129
-    _onDialogToggle() {
130
-        this.setState({
131
-            showDialog: !this.state.showDialog
132
-        });
133
-    }
134
-}
135
-
136
-/**
137
- * Maps (parts of) the Redux state to the associated
138
- * {@code ToolbarButtonWithDialog} component's props.
139
- *
140
- * @param {Object} state - The Redux state.
141
- * @private
142
- * @returns {{
143
- *     _visible: boolean
144
- * }}
145
- */
146
-function _mapStateToProps(state) {
147
-    return {
148
-        _visible: state['features/toolbox'].visible
149
-    };
150
-}
151
-
152
-export default connect(_mapStateToProps)(ToolbarButtonWithDialog);

+ 0
- 2
react/features/toolbox/components/index.js View File

@@ -1,6 +1,4 @@
1 1
 export { default as ToolbarButton } from './ToolbarButton';
2 2
 export { default as ToolbarButtonV2 } from './ToolbarButtonV2';
3
-export { default as ToolbarButtonWithDialog }
4
-    from './ToolbarButtonWithDialog';
5 3
 export { default as ToolboxFilmstrip } from './ToolboxFilmstrip';
6 4
 export { default as Toolbox } from './Toolbox';

+ 0
- 0
react/features/video-quality/components/VideoQualityButton.native.js View File


+ 0
- 58
react/features/video-quality/components/VideoQualityButton.web.js View File

@@ -1,58 +0,0 @@
1
-import PropTypes from 'prop-types';
2
-import React, { Component } from 'react';
3
-
4
-import { ToolbarButtonWithDialog } from '../../toolbox';
5
-
6
-import VideoQualitySlider from './VideoQualitySlider';
7
-
8
-/**
9
- * A configuration object to describe how {@code ToolbarButton} should render
10
- * the button.
11
- *
12
- * @type {object}
13
- */
14
-const DEFAULT_BUTTON_CONFIGURATION = {
15
-    buttonName: 'videoquality',
16
-    classNames: [ 'button', 'icon-visibility' ],
17
-    enabled: true,
18
-    id: 'toolbar_button_videoquality',
19
-    tooltipKey: 'videoStatus.qualityButtonTip'
20
-};
21
-
22
-/**
23
- * React {@code Component} for displaying a button which will open an inline
24
- * dialog for changing received video quality settings.
25
- *
26
- * @extends Component
27
- */
28
-class VideoQualityButton extends Component {
29
-    /**
30
-     * {@code VideoQualityButton}'s property types.
31
-     *
32
-     * @static
33
-     */
34
-    static propTypes = {
35
-        /**
36
-         * From which side tooltips should display. Will be re-used for
37
-         * displaying the inline dialog for video quality adjustment.
38
-         */
39
-        tooltipPosition: PropTypes.string
40
-    };
41
-
42
-    /**
43
-     * Implements React's {@link Component#render()}.
44
-     *
45
-     * @inheritdoc
46
-     * @returns {ReactElement}
47
-     */
48
-    render() {
49
-        return (
50
-            <ToolbarButtonWithDialog
51
-                button = { DEFAULT_BUTTON_CONFIGURATION }
52
-                content = { VideoQualitySlider }
53
-                tooltipPosition = { this.props.tooltipPosition } />
54
-        );
55
-    }
56
-}
57
-
58
-export default VideoQualityButton;

+ 0
- 1
react/features/video-quality/components/index.js View File

@@ -1,3 +1,2 @@
1
-export { default as VideoQualityButton } from './VideoQualityButton';
2 1
 export { default as VideoQualityDialog } from './VideoQualityDialog';
3 2
 export { default as VideoQualityLabel } from './VideoQualityLabel';

Loading…
Cancel
Save