Browse Source

feat(dark-theme): Applies dark theme on inline-dialogs, tooltips, flags and more

master
yanas 7 years ago
parent
commit
e09949be9f

+ 0
- 3
css/_connection-info.scss View File

@@ -1,7 +1,6 @@
1 1
 %connection-info {
2 2
     font-size: 12px;
3 3
     font-weight: 400;
4
-    color: $modalTextColor;
5 4
 
6 5
     td {
7 6
         padding: 2px 0;
@@ -34,7 +33,6 @@
34 33
     &__download
35 34
     {
36 35
         @extend .connection-info__icon;
37
-        color: $downloadConnectionIconColor;
38 36
     }
39 37
 
40 38
     &__status
@@ -45,7 +43,6 @@
45 43
     &__upload
46 44
     {
47 45
         @extend .connection-info__icon;
48
-        color: $uploadConnectionIconColor;
49 46
     }
50 47
 
51 48
     .showmore {

+ 0
- 10
css/_filmstrip.scss View File

@@ -86,26 +86,16 @@
86 86
                 width: 100%;
87 87
 
88 88
                 & button {
89
-                    background: $toolbarBackground;
90 89
                     flex-grow: 1;
91 90
                     flex-shrink: 1;
92 91
                     overflow: hidden;
93 92
                 }
94 93
 
95 94
                 & > * {
96
-                    color: $toolbarButtonColor;
97 95
                     flex-grow: 0;
98 96
                     flex-shrink: 0;
99 97
                     margin-left: 2px;
100 98
                 }
101
-
102
-                /**
103
-                 * Making sure any svg-s in an invite button group will be
104
-                 * colored the way we want.
105
-                 */
106
-                & path {
107
-                    fill: $toolbarButtonColor;
108
-                }
109 99
             }
110 100
         }
111 101
 

+ 0
- 2
css/_popup_menu.scss View File

@@ -19,7 +19,6 @@
19 19
     // Link Appearance
20 20
     &__link,
21 21
     &__contents {
22
-        color: $modalTextColor;
23 22
         display: block;
24 23
         box-sizing: border-box;
25 24
         text-decoration: none;
@@ -30,7 +29,6 @@
30 29
         padding: 0 5px;
31 30
 
32 31
         &.disabled {
33
-            color: gray !important;
34 32
             pointer-events: none;
35 33
         }
36 34
     }

+ 6
- 6
css/_toolbars.scss View File

@@ -36,7 +36,6 @@
36 36
  * Common toolbar styles.
37 37
  */
38 38
 .toolbar {
39
-    color: $modalTextColor;
40 39
     height: 100%;
41 40
     pointer-events: auto;
42 41
     position: relative;
@@ -82,20 +81,21 @@
82 81
         vertical-align: middle;
83 82
         width: $defaultToolbarSize;
84 83
 
85
-        &_hangup {
86
-            color: $hangupColor;
87
-            font-size: $hangupFontSize;
88
-        }
89
-
90 84
         &[disabled] {
91 85
             opacity: 0.5;
92 86
         }
93 87
 
94 88
         &:hover, &:active {
89
+            color: $toolbarButtonColor;
95 90
             cursor: pointer;
96 91
             text-decoration: none;
97 92
         }
98 93
 
94
+        &_hangup, &_hangup:hover {
95
+            color: $hangupColor;
96
+            font-size: $hangupFontSize;
97
+        }
98
+
99 99
         &:not(.toggled) {
100 100
             &:hover, &:active {
101 101
                 // sum opacity with background layer should give us 0.8

+ 1
- 0
css/_variables.scss View File

@@ -64,6 +64,7 @@ $connectionIndicatorBg: #165ecc;
64 64
 $audioLevelShadow: rgba(9, 36, 77, 0.9);
65 65
 $videoStateIndicatorColor: $defaultColor;
66 66
 $videoStateIndicatorBackground: $toolbarBackground;
67
+$videoStateIndicatorSize: 40px;
67 68
 
68 69
 /**
69 70
  * Feedback Modal

+ 9
- 0
css/_videolayout_default.scss View File

@@ -65,6 +65,15 @@
65 65
             float: left;
66 66
             pointer-events: all;
67 67
         }
68
+
69
+        /**
70
+         * Need to overwrite the background for the top toolbar dark theme div
71
+         * wrapper needed before we're able to move all top toolbar indicators
72
+         * creation to react.
73
+         */
74
+        .ckAJgx {
75
+            background: none;
76
+        }
68 77
     }
69 78
 
70 79
     &__toolbar {

+ 4
- 11
css/modals/invite/_invite.scss View File

@@ -26,17 +26,6 @@
26 26
             user-select: text;
27 27
         }
28 28
 
29
-        .dial-in-numbers-trigger {
30
-            position: relative;
31
-            width: 100%;
32
-
33
-            .dial-in-numbers-trigger-icon {
34
-                position: absolute;
35
-                right: 10px;
36
-                top: 4px;
37
-            }
38
-        }
39
-
40 29
         .is-disabled,
41 30
         .is-loading {
42 31
             .dial-in-numbers-trigger-icon {
@@ -62,6 +51,10 @@
62 51
         &__input-container {
63 52
             flex: 1;
64 53
             margin-right: 10px;
54
+
55
+            .dropdown-button-trigger {
56
+                text-align: left;
57
+            }
65 58
         }
66 59
     }
67 60
 

+ 8
- 11
css/modals/video-quality/_video-quality.scss View File

@@ -1,5 +1,4 @@
1 1
 .video-quality-dialog {
2
-    color: $modalTextColor;
3 2
 
4 3
     .hide-warning {
5 4
         height: 0;
@@ -12,7 +11,6 @@
12 11
 
13 12
     .video-quality-dialog-contents {
14 13
         align-items: center;
15
-        color: $modalTextColor;
16 14
         display: flex;
17 15
         flex-direction: column;
18 16
         padding: 10px;
@@ -29,7 +27,7 @@
29 27
             @mixin sliderTrackStyles() {
30 28
                 height: 15px;
31 29
                 border-radius: 10px;
32
-                background: black;
30
+                background: #0E1624;
33 31
             }
34 32
 
35 33
             &::-ms-track {
@@ -79,7 +77,6 @@
79 77
             transform: translate(-50%, 0%);
80 78
 
81 79
             &::before {
82
-                background: rgb(140, 156, 189);
83 80
                 content: '';
84 81
                 border-radius: 50%;
85 82
                 left: 0;
@@ -94,10 +91,10 @@
94 91
         }
95 92
 
96 93
         .video-quality-dialog-label-container.active {
97
-            color: $toolbarToggleBackground;
94
+            color: $videoQualityActive;
98 95
 
99 96
             &::before {
100
-                background: $toolbarToggleBackground;
97
+                background: $videoQualityActive;
101 98
                 height: 12px;
102 99
                 top: -19px;
103 100
                 width: 12px;
@@ -117,26 +114,26 @@
117 114
 
118 115
 .video-state-indicator {
119 116
     background: $videoStateIndicatorBackground;
120
-    color: $videoStateIndicatorColor;
121 117
     cursor: default;
122 118
     font-size: 13px;
123
-    height: 40px;
119
+    height: $videoStateIndicatorSize;
124 120
     line-height: 20px;
125 121
     text-align: left;
126
-    min-width: 40px;
122
+    min-width: $videoStateIndicatorSize;
127 123
     border-radius: 50%;
128 124
     position: absolute;
129 125
     box-sizing: border-box;
130 126
 
131 127
     i {
132
-        cursor: pointer;
128
+        line-height: $videoStateIndicatorSize;
133 129
     }
134 130
 
135 131
     /**
136 132
      * Give the label padding so it has more volume and can be easily clicked.
137 133
      */
138 134
     .video-quality-label-status {
139
-        padding: 10px 5px;
135
+        line-height: $videoStateIndicatorSize;
136
+        min-width: $videoStateIndicatorSize;
140 137
         text-align: center;
141 138
     }
142 139
 }

+ 5
- 6
css/themes/_light.scss View File

@@ -44,12 +44,6 @@ $defaultBackground: #474747;
44 44
 $filmstripOnlyOverlayBg: #000;
45 45
 $reloadProgressBarBg: #0074E0;
46 46
 
47
-/**
48
-* Connection indicator
49
-**/
50
-$downloadConnectionIconColor: #4abd04;
51
-$uploadConnectionIconColor: #ffa800;
52
-
53 47
 /**
54 48
  * Dialog colors
55 49
  **/
@@ -111,3 +105,8 @@ $selectFontColor: $controlColor;
111 105
 $selectBg: $controlBackground;
112 106
 $selectActiveBg: darken($controlBackground, 5%);
113 107
 $selectActiveItemBg: darken($controlBackground, 20%);
108
+
109
+/**
110
+ * TODO: Replace by themed component.
111
+ */
112
+$videoQualityActive: #4C9AFF;

+ 13
- 9
modules/UI/videolayout/RemoteVideo.js View File

@@ -5,6 +5,7 @@ import React from 'react';
5 5
 import ReactDOM from 'react-dom';
6 6
 import { Provider } from 'react-redux';
7 7
 import { I18nextProvider } from 'react-i18next';
8
+import { AtlasKitThemeProvider } from '@atlaskit/theme';
8 9
 
9 10
 import { i18next } from '../../../react/features/base/i18n';
10 11
 import {
@@ -167,15 +168,18 @@ RemoteVideo.prototype._generatePopupContent = function() {
167 168
     ReactDOM.render(
168 169
         <Provider store = { APP.store }>
169 170
             <I18nextProvider i18n = { i18next }>
170
-                <RemoteVideoMenuTriggerButton
171
-                    initialVolumeValue = { initialVolumeValue }
172
-                    isAudioMuted = { this.isAudioMuted }
173
-                    isModerator = { isModerator }
174
-                    onMenuDisplay = {this._onRemoteVideoMenuDisplay.bind(this)}
175
-                    onRemoteControlToggle = { onRemoteControlToggle }
176
-                    onVolumeChange = { onVolumeChange }
177
-                    participantID = { participantID }
178
-                    remoteControlState = { remoteControlState } />
171
+                <AtlasKitThemeProvider mode = 'dark'>
172
+                    <RemoteVideoMenuTriggerButton
173
+                        initialVolumeValue = { initialVolumeValue }
174
+                        isAudioMuted = { this.isAudioMuted }
175
+                        isModerator = { isModerator }
176
+                        onMenuDisplay
177
+                            = {this._onRemoteVideoMenuDisplay.bind(this)}
178
+                        onRemoteControlToggle = { onRemoteControlToggle }
179
+                        onVolumeChange = { onVolumeChange }
180
+                        participantID = { participantID }
181
+                        remoteControlState = { remoteControlState } />
182
+                </AtlasKitThemeProvider>
179 183
             </I18nextProvider>
180 184
         </Provider>,
181 185
         remoteVideoMenuContainer);

+ 29
- 24
modules/UI/videolayout/SmallVideo.js View File

@@ -4,6 +4,7 @@
4 4
 import React from 'react';
5 5
 import ReactDOM from 'react-dom';
6 6
 import { I18nextProvider } from 'react-i18next';
7
+import { AtlasKitThemeProvider } from '@atlaskit/theme';
7 8
 import { Provider } from 'react-redux';
8 9
 
9 10
 import { i18next } from '../../../react/features/base/i18n';
@@ -780,30 +781,34 @@ SmallVideo.prototype.updateIndicators = function() {
780 781
     const tooltipPosition = interfaceConfig.VERTICAL_FILMSTRIP ? 'left' : 'top';
781 782
 
782 783
     ReactDOM.render(
783
-        <I18nextProvider i18n = { i18next }>
784
-            <div>
785
-                { this._showConnectionIndicator
786
-                    ? <ConnectionIndicator
787
-                        alwaysVisible = { showConnectionIndicator }
788
-                        connectionStatus = { this._connectionStatus }
789
-                        iconSize = { iconSize }
790
-                        isLocalVideo = { this.isLocal }
791
-                        enableStatsDisplay = { !interfaceConfig.filmStripOnly }
792
-                        statsPopoverPosition = { this.statsPopoverLocation }
793
-                        userID = { this.id } />
794
-                    : null }
795
-                { this._showRaisedHand
796
-                    ? <RaisedHandIndicator
797
-                        iconSize = { iconSize }
798
-                        tooltipPosition = { tooltipPosition } />
799
-                    : null }
800
-                { this._showDominantSpeaker
801
-                    ? <DominantSpeakerIndicator
802
-                        iconSize = { iconSize }
803
-                        tooltipPosition = { tooltipPosition } />
804
-                    : null }
805
-            </div>
806
-        </I18nextProvider>,
784
+            <I18nextProvider i18n = { i18next }>
785
+                <div>
786
+                    <AtlasKitThemeProvider mode = 'dark'>
787
+                        { this._showConnectionIndicator
788
+                            ? <ConnectionIndicator
789
+                                alwaysVisible = { showConnectionIndicator }
790
+                                connectionStatus = { this._connectionStatus }
791
+                                iconSize = { iconSize }
792
+                                isLocalVideo = { this.isLocal }
793
+                                enableStatsDisplay
794
+                                    = { !interfaceConfig.filmStripOnly }
795
+                                statsPopoverPosition
796
+                                    = { this.statsPopoverLocation }
797
+                                userID = { this.id } />
798
+                            : null }
799
+                        { this._showRaisedHand
800
+                            ? <RaisedHandIndicator
801
+                                iconSize = { iconSize }
802
+                                tooltipPosition = { tooltipPosition } />
803
+                            : null }
804
+                        { this._showDominantSpeaker
805
+                            ? <DominantSpeakerIndicator
806
+                                iconSize = { iconSize }
807
+                                tooltipPosition = { tooltipPosition } />
808
+                            : null }
809
+                    </AtlasKitThemeProvider>
810
+                </div>
811
+            </I18nextProvider>,
807 812
         indicatorToolbar
808 813
     );
809 814
 };

+ 17
- 14
package.json View File

@@ -15,20 +15,23 @@
15 15
   "author": "",
16 16
   "readmeFilename": "README.md",
17 17
   "dependencies": {
18
-    "@atlaskit/avatar": "4.0.5",
19
-    "@atlaskit/button": "3.0.0",
20
-    "@atlaskit/button-group": "1.1.3",
21
-    "@atlaskit/dropdown-menu": "1.4.0",
22
-    "@atlaskit/field-text": "2.7.0",
23
-    "@atlaskit/flag": "3.0.0",
24
-    "@atlaskit/icon": "7.0.0",
25
-    "@atlaskit/inline-dialog": "3.2.0",
26
-    "@atlaskit/inline-message": "2.1.1",
27
-    "@atlaskit/modal-dialog": "2.1.2",
28
-    "@atlaskit/multi-select": "6.2.0",
29
-    "@atlaskit/spinner": "2.2.3",
30
-    "@atlaskit/tabs": "2.0.0",
31
-    "@atlaskit/toggle": "2.0.4",
18
+    "@atlaskit/avatar": "8.0.5",
19
+    "@atlaskit/button": "5.4.2",
20
+    "@atlaskit/button-group": "1.5.3",
21
+    "@atlaskit/dropdown-menu": "3.10.2",
22
+    "@atlaskit/droplist": "4.11.1",
23
+    "@atlaskit/field-text": "4.0.1",
24
+    "@atlaskit/flag": "6.1.0",
25
+    "@atlaskit/icon": "10.0.0",
26
+    "@atlaskit/inline-dialog": "5.0.2",
27
+    "@atlaskit/inline-message": "3.0.1",
28
+    "@atlaskit/modal-dialog": "2.6.0",
29
+    "@atlaskit/multi-select": "7.1.3",
30
+    "@atlaskit/spinner": "4.0.0",
31
+    "@atlaskit/tabs": "4.0.1",
32
+    "@atlaskit/theme": "2.2.0",
33
+    "@atlaskit/toggle": "2.6.1",
34
+    "@atlaskit/tooltip": "6.0.0",
32 35
     "@atlassian/aui": "6.0.6",
33 36
     "autosize": "1.18.13",
34 37
     "es6-iterator": "2.0.1",

+ 6
- 3
react/features/app/components/AbstractApp.js View File

@@ -4,6 +4,7 @@ import { I18nextProvider } from 'react-i18next';
4 4
 import { Provider } from 'react-redux';
5 5
 import { compose, createStore } from 'redux';
6 6
 import Thunk from 'redux-thunk';
7
+import { AtlasKitThemeProvider } from '@atlaskit/theme';
7 8
 
8 9
 import { i18next } from '../../base/i18n';
9 10
 import {
@@ -201,9 +202,11 @@ export class AbstractApp extends Component {
201 202
             return (
202 203
                 <I18nextProvider i18n = { i18next }>
203 204
                     <Provider store = { this._getStore() }>
204
-                        {
205
-                            this._createElement(component)
206
-                        }
205
+                        <AtlasKitThemeProvider mode = 'dark'>
206
+                            {
207
+                                this._createElement(component)
208
+                            }
209
+                        </AtlasKitThemeProvider>
207 210
                     </Provider>
208 211
                 </I18nextProvider>
209 212
             );

+ 27
- 19
react/features/base/dialog/components/StatelessDialog.web.js View File

@@ -1,6 +1,7 @@
1 1
 import AKButton from '@atlaskit/button';
2 2
 import AKButtonGroup from '@atlaskit/button-group';
3 3
 import ModalDialog from '@atlaskit/modal-dialog';
4
+import { AtlasKitThemeProvider } from '@atlaskit/theme';
4 5
 import PropTypes from 'prop-types';
5 6
 import React, { Component } from 'react';
6 7
 
@@ -114,25 +115,32 @@ class StatelessDialog extends Component {
114 115
      */
115 116
     render() {
116 117
         return (
117
-            <div
118
-                onKeyDown = { this._onKeyDown }
119
-                ref = { this._setDialogElement }>
120
-                <ModalDialog
121
-                    footer = { this._renderFooter() }
122
-                    header = { this._renderHeader() }
123
-                    isOpen = { true }
124
-                    onDialogDismissed = { this._onDialogDismissed }
125
-                    width = { this.props.width || 'medium' }>
126
-                    <div>
127
-                        <form
128
-                            className = 'modal-dialog-form'
129
-                            id = 'modal-dialog-form'
130
-                            onSubmit = { this._onSubmit }>
131
-                            { this.props.children }
132
-                        </form>
133
-                    </div>
134
-                </ModalDialog>
135
-            </div>
118
+
119
+            /**
120
+             * Enabled light theme for dialogs until all in-dialog components
121
+             * support dark theme.
122
+             */
123
+            <AtlasKitThemeProvider mode = 'light'>
124
+                <div
125
+                    onKeyDown = { this._onKeyDown }
126
+                    ref = { this._setDialogElement }>
127
+                    <ModalDialog
128
+                        footer = { this._renderFooter() }
129
+                        header = { this._renderHeader() }
130
+                        isOpen = { true }
131
+                        onDialogDismissed = { this._onDialogDismissed }
132
+                        width = { this.props.width || 'medium' }>
133
+                        <div>
134
+                            <form
135
+                                className = 'modal-dialog-form'
136
+                                id = 'modal-dialog-form'
137
+                                onSubmit = { this._onSubmit }>
138
+                                { this.props.children }
139
+                            </form>
140
+                        </div>
141
+                    </ModalDialog>
142
+                </div>
143
+            </AtlasKitThemeProvider>
136 144
         );
137 145
     }
138 146
 

+ 2
- 2
react/features/device-selection/components/DeviceSelector.web.js View File

@@ -1,5 +1,5 @@
1 1
 import AKDropdownMenu from '@atlaskit/dropdown-menu';
2
-import ExpandIcon from '@atlaskit/icon/glyph/expand';
2
+import ChevronDownIcon from '@atlaskit/icon/glyph/chevron-down';
3 3
 import PropTypes from 'prop-types';
4 4
 import React, { Component } from 'react';
5 5
 
@@ -116,7 +116,7 @@ class DeviceSelector extends Component {
116 116
                 <span className = 'device-selector-trigger-text'>
117 117
                     { triggerText }
118 118
                 </span>
119
-                <ExpandIcon
119
+                <ChevronDownIcon
120 120
                     label = 'expand'
121 121
                     size = 'large' />
122 122
             </div>

+ 14
- 14
react/features/dial-out/components/DialOutNumbersForm.web.js View File

@@ -1,6 +1,6 @@
1
-import { StatelessDropdownMenu } from '@atlaskit/dropdown-menu';
2
-import AKFieldText, { FieldText } from '@atlaskit/field-text';
3
-import ExpandIcon from '@atlaskit/icon/glyph/expand';
1
+import { DropdownMenuStateless as DropdownMenu } from '@atlaskit/dropdown-menu';
2
+import { FieldTextStateless as TextField } from '@atlaskit/field-text';
3
+import ChevronDownIcon from '@atlaskit/icon/glyph/chevron-down';
4 4
 import PropTypes from 'prop-types';
5 5
 import React, { Component } from 'react';
6 6
 import { connect } from 'react-redux';
@@ -149,7 +149,7 @@ class DialOutNumbersForm extends Component {
149 149
                 { _dialOutCodes ? this._createDropdownMenu(
150 150
                         this._formatCountryCodes(_dialOutCodes)) : null }
151 151
                 <div className = 'dial-out-input'>
152
-                    <AKFieldText
152
+                    <TextField
153 153
                         autoFocus = { true }
154 154
                         isLabelHidden = { true }
155 155
                         label = { 'dial-out-input-field' }
@@ -164,7 +164,7 @@ class DialOutNumbersForm extends Component {
164 164
     }
165 165
 
166 166
     /**
167
-     * Creates a {@code StatelessDropdownMenu} instance.
167
+     * Creates a {@code DropdownMenu} instance.
168 168
      *
169 169
      * @param {Array} items - The content to display within the dropdown.
170 170
      * @returns {ReactElement}
@@ -174,14 +174,14 @@ class DialOutNumbersForm extends Component {
174 174
 
175 175
         return (
176 176
             <div className = 'dropdown-container'>
177
-                <StatelessDropdownMenu
177
+                <DropdownMenu
178 178
                     isOpen = { this.state.isDropdownOpen }
179 179
                     items = { [ { items } ] }
180 180
                     onItemActivated = { this._onSelect }
181 181
                     onOpenChange = { this._onOpenChange }
182 182
                     shouldFitContainer = { false }>
183 183
                     { this._createDropdownTrigger(dialCode, code) }
184
-                </StatelessDropdownMenu>
184
+                </DropdownMenu>
185 185
             </div>
186 186
         );
187 187
     }
@@ -203,10 +203,10 @@ class DialOutNumbersForm extends Component {
203 203
                     className = 'dial-out-flag-icon'
204 204
                     countryCode = { `${countryCode}` } />
205 205
                 { /**
206
-                   * FIXME Replace FieldText with AtlasKit Button when an issue
206
+                   * FIXME Replace TextField with AtlasKit Button when an issue
207 207
                    * with icons shrinking due to button text is fixed.
208 208
                    */ }
209
-                <FieldText
209
+                <TextField
210 210
                     className = 'input-control dial-out-code'
211 211
                     isLabelHidden = { true }
212 212
                     isReadOnly = { true }
@@ -215,9 +215,9 @@ class DialOutNumbersForm extends Component {
215 215
                     type = 'text'
216 216
                     value = { dialCode || '' } />
217 217
                 <span className = 'dropdown-trigger-icon'>
218
-                    <ExpandIcon
218
+                    <ChevronDownIcon
219 219
                         label = 'expand'
220
-                        size = 'medium' />
220
+                        size = 'small' />
221 221
                 </span>
222 222
             </div>
223 223
         );
@@ -225,7 +225,7 @@ class DialOutNumbersForm extends Component {
225 225
 
226 226
     /**
227 227
      * Transforms the passed in numbers object into an array of objects that can
228
-     * be parsed by {@code StatelessDropdownMenu}.
228
+     * be parsed by {@code DropdownMenu}.
229 229
      *
230 230
      * @param {Object} countryCodes - The list of country codes.
231 231
      * @private
@@ -259,8 +259,8 @@ class DialOutNumbersForm extends Component {
259 259
     }
260 260
 
261 261
     /**
262
-     * This is a no-op function used to stub out FieldText's onChange in order
263
-     * to prevent FieldText from printing prop type validation errors. FieldText
262
+     * This is a no-op function used to stub out TextField's onChange in order
263
+     * to prevent TextField from printing prop type validation errors. TextField
264 264
      * is used as a trigger for the dropdown in {@code DialOutNumbersForm} to
265 265
      * get the desired AtlasKit input look for the UI.
266 266
      *

+ 2
- 2
react/features/display-name/components/DisplayNamePrompt.web.js View File

@@ -1,7 +1,7 @@
1
-import AKFieldText from '@atlaskit/field-text';
2 1
 import PropTypes from 'prop-types';
3 2
 import React, { Component } from 'react';
4 3
 import { connect } from 'react-redux';
4
+import { FieldTextStateless as TextField } from '@atlaskit/field-text';
5 5
 
6 6
 import { Dialog } from '../../base/dialog';
7 7
 import { translate } from '../../base/i18n';
@@ -76,7 +76,7 @@ class DisplayNamePrompt extends Component {
76 76
                 onSubmit = { this._onSubmit }
77 77
                 titleKey = 'dialog.displayNameRequired'
78 78
                 width = 'small'>
79
-                <AKFieldText
79
+                <TextField
80 80
                     autoFocus = { true }
81 81
                     compact = { true }
82 82
                     label = { this.props.t('dialog.enterDisplayName') }

+ 2
- 3
react/features/invite/components/AddPasswordForm.js View File

@@ -1,5 +1,5 @@
1 1
 import Button from '@atlaskit/button';
2
-import { FieldText } from '@atlaskit/field-text';
2
+import { FieldTextStateless as TextField } from '@atlaskit/field-text';
3 3
 import PropTypes from 'prop-types';
4 4
 import React, { Component } from 'react';
5 5
 import { connect } from 'react-redux';
@@ -106,7 +106,7 @@ class AddPasswordForm extends Component {
106 106
                 onSubmit = { this._onSubmit } >
107 107
                 <div className = 'form-control__container'>
108 108
                     <div className = 'form-control__input-container'>
109
-                        <FieldText
109
+                        <TextField
110 110
                             autoFocus = { true }
111 111
                             compact = { true }
112 112
                             id = 'newPasswordInput'
@@ -123,7 +123,6 @@ class AddPasswordForm extends Component {
123 123
                         id = 'addPasswordBtn'
124 124
                         isDisabled = { !this.state.password }
125 125
                         onClick = { this._onSubmit }
126
-                        shouldFitContainer = { true }
127 126
                         type = 'button'>
128 127
                         { t('dialog.add') }
129 128
                     </Button>

+ 97
- 126
react/features/invite/components/DialInNumbersForm.js View File

@@ -1,7 +1,6 @@
1 1
 import Button from '@atlaskit/button';
2
-import { StatelessDropdownMenu } from '@atlaskit/dropdown-menu';
3
-import { FieldText } from '@atlaskit/field-text';
4
-import ExpandIcon from '@atlaskit/icon/glyph/expand';
2
+import DropdownMenu, {
3
+    DropdownItem, DropdownItemGroup } from '@atlaskit/dropdown-menu';
5 4
 import PropTypes from 'prop-types';
6 5
 import React, { Component } from 'react';
7 6
 import { connect } from 'react-redux';
@@ -95,8 +94,6 @@ class DialInNumbersForm extends Component {
95 94
 
96 95
         // Bind event handlers so they are only bound once for every instance.
97 96
         this._onCopyClick = this._onCopyClick.bind(this);
98
-        this._onDropdownTriggerInputChange
99
-            = this._onDropdownTriggerInputChange.bind(this);
100 97
         this._onOpenChange = this._onOpenChange.bind(this);
101 98
         this._onSelect = this._onSelect.bind(this);
102 99
         this._setCopyElement = this._setCopyElement.bind(this);
@@ -147,7 +144,7 @@ class DialInNumbersForm extends Component {
147 144
             return null;
148 145
         }
149 146
 
150
-        const items = this._formatNumbers(numbers);
147
+        const items = this._renderDropdownItems(numbers);
151 148
 
152 149
         return (
153 150
             <div className = 'form-control dial-in-numbers'>
@@ -158,11 +155,12 @@ class DialInNumbersForm extends Component {
158 155
                     </span>
159 156
                 </label>
160 157
                 <div className = 'form-control__container'>
161
-                    { this._createDropdownMenu(items, selectedNumber.content) }
158
+                    <div className = 'form-control__input-container'>
159
+                        { this._createDropdownMenu(items, selectedNumber) }
160
+                    </div>
162 161
                     <Button
163 162
                         appearance = 'default'
164 163
                         onClick = { this._onCopyClick }
165
-                        shouldFitContainer = { true }
166 164
                         type = 'button'>
167 165
                         { t('dialog.copy') }
168 166
                     </Button>
@@ -178,7 +176,7 @@ class DialInNumbersForm extends Component {
178 176
     }
179 177
 
180 178
     /**
181
-     * Creates a {@code StatelessDropdownMenu} instance.
179
+     * Creates a {@code DropdownMenu} instance.
182 180
      *
183 181
      * @param {Array} items - The content to display within the dropdown.
184 182
      * @param {string} triggerText - The text to display within the
@@ -187,116 +185,32 @@ class DialInNumbersForm extends Component {
187 185
      */
188 186
     _createDropdownMenu(items, triggerText) {
189 187
         return (
190
-            <StatelessDropdownMenu
188
+            <DropdownMenu
191 189
                 isOpen = { this.state.isDropdownOpen }
192
-                items = { [ { items } ] }
193
-                onItemActivated = { this._onSelect }
194 190
                 onOpenChange = { this._onOpenChange }
195
-                shouldFitContainer = { true }>
196
-                { this._createDropdownTrigger(triggerText) }
197
-            </StatelessDropdownMenu>
191
+                shouldFitContainer = { true }
192
+                trigger = { triggerText || '' }
193
+                triggerButtonProps = {{
194
+                    className: 'dropdown-button-trigger',
195
+                    shouldFitContainer: true }}
196
+                triggerType = 'button'>
197
+                <DropdownItemGroup>
198
+                    { items }
199
+                </DropdownItemGroup>
200
+            </DropdownMenu>
198 201
         );
199 202
     }
200 203
 
201 204
     /**
202
-     * Creates a React {@code Component} with a readonly HTMLInputElement as a
203
-     * trigger for displaying the dropdown menu. The {@code Component} will also
204
-     * display the currently selected number.
205
+     * Formats the region and number string.
205 206
      *
206
-     * @param {string} triggerText - Text to display in the HTMLInputElement.
207
+     * @param {string} region - The region string.
208
+     * @param {string} number - The number string.
209
+     * @returns {string} - The new formatted string.
207 210
      * @private
208
-     * @returns {ReactElement}
209
-     */
210
-    _createDropdownTrigger(triggerText) {
211
-        return (
212
-            <div className = 'dial-in-numbers-trigger'>
213
-                <div className = 'form-control__input-container'>
214
-                    <FieldText
215
-                        compact = { true }
216
-                        isLabelHidden = { true }
217
-                        isReadOnly = { true }
218
-                        label = 'Select Dial-In Number'
219
-                        onChange = { this._onDropdownTriggerInputChange }
220
-                        ref = { this._setInput }
221
-                        shouldFitContainer = { true }
222
-                        type = 'text'
223
-                        value = { triggerText || '' } />
224
-                </div>
225
-                <span className = 'dial-in-numbers-trigger-icon'>
226
-                    <ExpandIcon
227
-                        label = 'expand'
228
-                        size = 'medium' />
229
-                </span>
230
-            </div>
231
-        );
232
-    }
233
-
234
-    /**
235
-     * Detects whether the response from dialInNumbersUrl returned an array or
236
-     * an object with dial-in numbers and calls the appropriate method to
237
-     * transform the numbers into the format expected by
238
-     * {@code StatelessDropdownMenu}.
239
-     *
240
-     * @param {Array<string>|Object} dialInNumbers - The numbers returned from
241
-     * requesting dialInNumbersUrl.
242
-     * @private
243
-     * @returns {Array<Object>}
244
-     */
245
-    _formatNumbers(dialInNumbers) {
246
-        if (Array.isArray(dialInNumbers)) {
247
-            return this._formatNumbersArray(dialInNumbers);
248
-        }
249
-
250
-        return this._formatNumbersObject(dialInNumbers);
251
-    }
252
-
253
-    /**
254
-     * Transforms the passed in numbers array into an array of objects that can
255
-     * be parsed by {@code StatelessDropdownMenu}.
256
-     *
257
-     * @param {Array<string>} dialInNumbers - An array with dial-in numbers to
258
-     * display and copy.
259
-     * @private
260
-     * @returns {Array<Object>}
261 211
      */
262
-    _formatNumbersArray(dialInNumbers) {
263
-        return dialInNumbers.map(number => {
264
-            return {
265
-                content: number,
266
-                number
267
-            };
268
-        });
269
-    }
270
-
271
-    /**
272
-     * Transforms the passed in numbers object into an array of objects that can
273
-     * be parsed by {@code StatelessDropdownMenu}.
274
-     *
275
-     * @param {Object} dialInNumbers - The numbers object to parse. The
276
-     * expected format is an object with keys being the name of the country
277
-     * and the values being an array of numbers as strings.
278
-     * @private
279
-     * @returns {Array<Object>}
280
-     */
281
-    _formatNumbersObject(dialInNumbers) {
282
-        const phoneRegions = Object.keys(dialInNumbers);
283
-
284
-        if (!phoneRegions.length) {
285
-            return [];
286
-        }
287
-
288
-        const formattedNumbers = phoneRegions.map(region => {
289
-            const numbers = dialInNumbers[region];
290
-
291
-            return numbers.map(number => {
292
-                return {
293
-                    content: `${region}: ${number}`,
294
-                    number
295
-                };
296
-            });
297
-        });
298
-
299
-        return Array.prototype.concat(...formattedNumbers);
212
+    _formatRegionNumber(region, number) {
213
+        return `${region}: ${number}`;
300 214
     }
301 215
 
302 216
     /**
@@ -313,7 +227,7 @@ class DialInNumbersForm extends Component {
313 227
         });
314 228
 
315 229
         const callNumber = t('invite.callNumber', {
316
-            number: this.state.selectedNumber.number
230
+            number: this.state.selectedNumber
317 231
         });
318 232
         const stepOne = `1) ${callNumber}`;
319 233
 
@@ -343,18 +257,6 @@ class DialInNumbersForm extends Component {
343 257
         }
344 258
     }
345 259
 
346
-    /**
347
-     * This is a no-op function used to stub out FieldText's onChange in order
348
-     * to prevent FieldText from printing prop type validation errors. FieldText
349
-     * is used as a trigger for the dropdown in {@code DialInNumbersForm} to
350
-     * get the desired AtlasKit input look for the UI.
351
-     *
352
-     * @returns {void}
353
-     */
354
-    _onDropdownTriggerInputChange() {
355
-        // Intentionally left empty.
356
-    }
357
-
358 260
     /**
359 261
      * Sets the internal state to either open or close the dropdown. If the
360 262
      * dropdown is disabled, the state will always be set to false.
@@ -380,10 +282,71 @@ class DialInNumbersForm extends Component {
380 282
     _onSelect(selection) {
381 283
         this.setState({
382 284
             isDropdownOpen: false,
383
-            selectedNumber: selection.item
285
+            selectedNumber: selection
384 286
         });
385 287
     }
386 288
 
289
+    /**
290
+     * Renders a DropDownItem for the given id and text.
291
+     *
292
+     * @param {string} id - The key identifier of the DropdownItem.
293
+     * @param {string} text - The text to display in the dropdown item.
294
+     * @returns {React.Component}
295
+     * @private
296
+     */
297
+    _renderDropDownItem(id, text) {
298
+        return (
299
+
300
+            /**
301
+             * Arrow functions are not allowed in props, but I leave this until
302
+             * I figure a better way to implement the same thing.
303
+             */
304
+            /* eslint-disable react/jsx-no-bind */
305
+            <DropdownItem
306
+                key = { id }
307
+                onClick = { () => this._onSelect(text || id) }>
308
+                { text }
309
+            </DropdownItem>
310
+            /* eslint-disable react/jsx-no-bind */
311
+        );
312
+    }
313
+
314
+    /**
315
+     * Detects whether the response from dialInNumbersUrl returned an array or
316
+     * an object with dial-in numbers and calls the appropriate method to
317
+     * transform the numbers into the format expected by
318
+     * {@code DropdownMenu}.
319
+     *
320
+     * @param {Array<string>|Object} dialInNumbers - The numbers returned from
321
+     * requesting dialInNumbersUrl.
322
+     * @private
323
+     * @returns {Array<Object>}
324
+     */
325
+    _renderDropdownItems(dialInNumbers) {
326
+        if (Array.isArray(dialInNumbers)) {
327
+            return dialInNumbers.map(number =>
328
+                this._renderDropDownItem(number)
329
+            );
330
+        }
331
+
332
+        const phoneRegions = Object.keys(dialInNumbers);
333
+
334
+        if (!phoneRegions.length) {
335
+            return [];
336
+        }
337
+
338
+        const dropdownItems = phoneRegions.map(region => {
339
+            const numbers = dialInNumbers[region];
340
+
341
+            return numbers.map(number =>
342
+                this._renderDropDownItem(number,
343
+                    this._formatRegionNumber(region, number))
344
+            );
345
+        });
346
+
347
+        return Array.prototype.concat(...dropdownItems);
348
+    }
349
+
387 350
     /**
388 351
      * Sets the internal reference to the DOM/HTML element backing the React
389 352
      * {@code Component} text area.
@@ -406,10 +369,18 @@ class DialInNumbersForm extends Component {
406 369
      * @returns {void}
407 370
      */
408 371
     _setDefaultNumber(dialInNumbers) {
409
-        const numbers = this._formatNumbers(dialInNumbers);
372
+        let number = '';
373
+
374
+        if (Array.isArray(dialInNumbers)) {
375
+            number = dialInNumbers[0];
376
+        } else if (Object.keys(dialInNumbers).length > 0) {
377
+            const region = Object.keys(dialInNumbers)[0];
378
+
379
+            number = this._formatRegionNumber(region, dialInNumbers[region]);
380
+        }
410 381
 
411 382
         this.setState({
412
-            selectedNumber: numbers[0]
383
+            selectedNumber: number
413 384
         });
414 385
     }
415 386
 }

+ 4
- 6
react/features/invite/components/ShareLinkForm.js View File

@@ -1,5 +1,5 @@
1 1
 import Button from '@atlaskit/button';
2
-import { FieldText } from '@atlaskit/field-text';
2
+import { FieldTextStateless as TextField } from '@atlaskit/field-text';
3 3
 import PropTypes from 'prop-types';
4 4
 import React, { Component } from 'react';
5 5
 
@@ -71,8 +71,7 @@ class ShareLinkForm extends Component {
71 71
                 </label>
72 72
                 <div className = 'form-control__container'>
73 73
                     <div className = 'form-control__input-container'>
74
-                        <FieldText
75
-                            compact = { true }
74
+                        <TextField
76 75
                             id = 'inviteLinkRef'
77 76
                             isLabelHidden = { true }
78 77
                             isReadOnly = { true }
@@ -86,7 +85,6 @@ class ShareLinkForm extends Component {
86 85
                     <Button
87 86
                         appearance = 'default'
88 87
                         onClick = { this._onClick }
89
-                        shouldFitContainer = { true }
90 88
                         type = 'button'>
91 89
                         { t('dialog.copy') }
92 90
                     </Button>
@@ -114,8 +112,8 @@ class ShareLinkForm extends Component {
114 112
     }
115 113
 
116 114
     /**
117
-     * This is a no-op function used to stub out FieldText's onChange in order
118
-     * to prevent FieldText from printing prop type validation errors. FieldText
115
+     * This is a no-op function used to stub out TextField's onChange in order
116
+     * to prevent TextField from printing prop type validation errors. TextField
119 117
      * is used as a trigger for the dropdown in {@code ShareLinkForm} to get the
120 118
      * desired AtlasKit input look for the UI.
121 119
      *

+ 2
- 3
react/features/room-lock/components/PasswordRequiredPrompt.web.js View File

@@ -1,9 +1,8 @@
1 1
 // @flow
2
-
3
-import AKFieldText from '@atlaskit/field-text';
4 2
 import PropTypes from 'prop-types';
5 3
 import React, { Component } from 'react';
6 4
 import { connect } from 'react-redux';
5
+import { FieldTextStateless as TextField } from '@atlaskit/field-text';
7 6
 
8 7
 import { setPassword } from '../../base/conference';
9 8
 import { Dialog } from '../../base/dialog';
@@ -75,7 +74,7 @@ class PasswordRequiredPrompt extends Component {
75 74
     _renderBody() {
76 75
         return (
77 76
             <div>
78
-                <AKFieldText
77
+                <TextField
79 78
                     autoFocus = { true }
80 79
                     compact = { true }
81 80
                     label = { this.props.t('dialog.passwordLabel') }

+ 5
- 55
react/features/toolbox/components/ToolbarButton.web.js View File

@@ -1,14 +1,13 @@
1 1
 /* @flow */
2 2
 
3
-import AKInlineDialog from '@atlaskit/inline-dialog';
4
-import { Tooltip } from '@atlaskit/tooltip';
3
+import InlineDialog from '@atlaskit/inline-dialog';
4
+import Tooltip from '@atlaskit/tooltip';
5 5
 import PropTypes from 'prop-types';
6 6
 import React, { Component } from 'react';
7 7
 
8 8
 import { translate } from '../../base/i18n';
9 9
 
10 10
 import { TOOLTIP_TO_POPUP_POSITION } from '../constants';
11
-import { isButtonEnabled } from '../functions';
12 11
 import StatelessToolbarButton from './StatelessToolbarButton';
13 12
 
14 13
 declare var APP: Object;
@@ -24,20 +23,6 @@ class ToolbarButton extends Component {
24 23
 
25 24
     _onClick: Function;
26 25
 
27
-    _onMouseOut: Function;
28
-
29
-    _onMouseOver: Function;
30
-
31
-    state: {
32
-
33
-        /**
34
-         * Whether or not the tooltip for the button should be displayed.
35
-         *
36
-         * @type {boolean}
37
-         */
38
-        showTooltip: boolean
39
-    }
40
-
41 26
     /**
42 27
      * Toolbar button component's property types.
43 28
      *
@@ -81,14 +66,8 @@ class ToolbarButton extends Component {
81 66
     constructor(props: Object) {
82 67
         super(props);
83 68
 
84
-        this.state = {
85
-            showTooltip: false
86
-        };
87
-
88 69
         // Bind methods to save the context
89 70
         this._onClick = this._onClick.bind(this);
90
-        this._onMouseOut = this._onMouseOut.bind(this);
91
-        this._onMouseOver = this._onMouseOver.bind(this);
92 71
     }
93 72
 
94 73
     /**
@@ -134,10 +113,7 @@ class ToolbarButton extends Component {
134 113
         const buttonComponent = ( // eslint-disable-line no-extra-parens
135 114
             <Tooltip
136 115
                 description = { button.tooltipText || t(button.tooltipKey) }
137
-                onMouseOut = { this._onMouseOut }
138
-                onMouseOver = { this._onMouseOver }
139
-                position = { tooltipPosition }
140
-                visible = { this.state.showTooltip }>
116
+                position = { tooltipPosition }>
141 117
                 <StatelessToolbarButton { ...props }>
142 118
                     { this.props.children }
143 119
                 </StatelessToolbarButton>
@@ -151,12 +127,12 @@ class ToolbarButton extends Component {
151 127
             const { dataAttr, dataInterpolate, position } = popupConfig;
152 128
 
153 129
             children = ( // eslint-disable-line no-extra-parens
154
-                <AKInlineDialog
130
+                <InlineDialog
155 131
                     content = { t(dataAttr, dataInterpolate) }
156 132
                     isOpen = { Boolean(popupConfig) }
157 133
                     position = { position }>
158 134
                     { buttonComponent }
159
-                </AKInlineDialog>
135
+                </InlineDialog>
160 136
             );
161 137
         }
162 138
 
@@ -176,7 +152,6 @@ class ToolbarButton extends Component {
176 152
      */
177 153
     _onClick(event) {
178 154
         this.props.onClick(event);
179
-        this.setState({ showTooltip: false });
180 155
     }
181 156
 
182 157
     /**
@@ -205,31 +180,6 @@ class ToolbarButton extends Component {
205 180
             });
206 181
     }
207 182
 
208
-    /**
209
-     * Hides any displayed tooltip.
210
-     *
211
-     * @private
212
-     * @returns {void}
213
-     */
214
-    _onMouseOut(): void {
215
-        this.setState({ showTooltip: false });
216
-    }
217
-
218
-    /**
219
-     * Hides any displayed tooltip.
220
-     *
221
-     * @private
222
-     * @returns {void}
223
-     */
224
-    _onMouseOver(): void {
225
-        const { button } = this.props;
226
-
227
-        this.setState({
228
-            showTooltip: isButtonEnabled(button.buttonName)
229
-                && !button.unclickable
230
-        });
231
-    }
232
-
233 183
     /**
234 184
      * Sets shortcut and tooltip for current toolbar button.
235 185
      *

Loading…
Cancel
Save