浏览代码

fix(Safari): Fix mobile double tapping for toolbar and overflow.

* Create generic tooltip wrapper for mobile usability.
* Change overflow menu icon/font/padding sizes.
* Change overflow drawer expand icon.
j8
Mihai-Andrei Uscat 4 年前
父节点
当前提交
b69e93a900
没有帐户链接到提交者的电子邮件

+ 25
- 15
css/_drawer.scss 查看文件

@@ -7,7 +7,7 @@
7 7
 }
8 8
 
9 9
 .drawer-menu {
10
-    padding: 12px 16px;
10
+    padding: 0 16px;
11 11
     max-height: 50vh;
12 12
     background: #242528;
13 13
     border-radius: 16px 16px 0 0;
@@ -24,12 +24,14 @@
24 24
         height: 44px;
25 25
         cursor: pointer;
26 26
 
27
-        &:hover {
28
-            background-color: $overflowMenuItemHoverBG;
27
+        @media (hover: hover) and (pointer: fine) {
28
+            &:hover {
29
+                background-color: $overflowMenuItemHoverBG;
30
+            }
29 31
         }
30 32
 
31
-        svg, path {
32
-            fill: #b8c7e0;
33
+        svg {
34
+            fill: none;
33 35
         }
34 36
     }
35 37
 
@@ -57,7 +59,7 @@
57 59
             color: $overflowMenuItemColor;
58 60
             cursor: pointer;
59 61
             display: flex;
60
-            font-size: 14px;
62
+            font-size: 16px;
61 63
 
62 64
             div {
63 65
                 display: flex;
@@ -65,16 +67,20 @@
65 67
                 align-items: center;
66 68
             }
67 69
 
68
-            &:hover {
69
-                background-color: $overflowMenuItemHoverBG;
70
-                color: $overflowMenuItemHoverColor;
70
+            @media (hover: hover) and (pointer: fine) {
71
+                &:hover {
72
+                    background-color: $overflowMenuItemHoverBG;
73
+                    color: $overflowMenuItemHoverColor;
74
+                }
71 75
             }
72 76
 
73 77
             &.unclickable {
74 78
                 cursor: default;
75 79
             }
76
-            &.unclickable:hover {
77
-                background: inherit;
80
+            @media (hover: hover) and (pointer: fine) {
81
+                &.unclickable:hover {
82
+                    background: inherit;
83
+                }
78 84
             }
79 85
             &.disabled {
80 86
                 cursor: initial;
@@ -93,15 +99,17 @@
93 99
         }
94 100
 
95 101
         .overflow-menu-item-icon {
96
-            margin-right: 10px;
102
+            margin-right: 16px;
97 103
 
98 104
             i {
99 105
                 display: inline;
100 106
                 font-size: 24px;
101 107
             }
102 108
 
103
-            i:hover {
104
-                background-color: initial;
109
+            @media (hover: hover) and (pointer: fine) {
110
+                i:hover {
111
+                    background-color: initial;
112
+                }
105 113
             }
106 114
 
107 115
             img {
@@ -111,11 +119,13 @@
111 119
 
112 120
             svg {
113 121
                 fill: #B8C7E0 !important;
122
+                height: 20px;
123
+                width: 20px;
114 124
             }
115 125
         }
116 126
 
117 127
         .profile-text {
118
-            max-width: 150px;
128
+            max-width: 100%;
119 129
             text-overflow: ellipsis;
120 130
             overflow: hidden;
121 131
             white-space: nowrap;

+ 38
- 17
css/_toolbars.scss 查看文件

@@ -91,9 +91,11 @@
91 91
                     width: 38px;
92 92
                     height: 38px;
93 93
 
94
-                    &:hover {
95
-                        background-color: #daebfa;
96
-                        border: 1px solid #daebfa;
94
+                    @media (hover: hover) and (pointer: fine) {
95
+                        &:hover {
96
+                            background-color: #daebfa;
97
+                            border: 1px solid #daebfa;
98
+                        }
97 99
                     }
98 100
 
99 101
                     &.toggled {
@@ -104,8 +106,10 @@
104 106
                             fill: #fff;
105 107
                         }
106 108
 
107
-                        &:hover {
108
-                            background-color: #5e6d7a;
109
+                        @media (hover: hover) and (pointer: fine) {
110
+                            &:hover {
111
+                                background-color: #5e6d7a;
112
+                            }
109 113
                         }
110 114
                     }
111 115
 
@@ -127,8 +131,10 @@
127 131
                         width: 40px;
128 132
                         height: 40px;
129 133
 
130
-                        &:hover {
131
-                            background-color: $hangupColor;
134
+                        @media (hover: hover) and (pointer: fine) {
135
+                            &:hover {
136
+                                background-color: $hangupColor;
137
+                            }
132 138
                         }
133 139
 
134 140
                         svg {
@@ -159,8 +165,9 @@
159 165
                 cursor: pointer;
160 166
                 display: flex;
161 167
                 font-size: 14px;
162
-                height: 22px;
168
+                height: 40px;
163 169
                 padding: 5px 12px;
170
+                box-sizing: border-box;
164 171
 
165 172
                 div {
166 173
                     display: flex;
@@ -168,16 +175,20 @@
168 175
                     align-items: center;
169 176
                 }
170 177
 
171
-                &:hover {
172
-                    background-color: $overflowMenuItemHoverBG;
173
-                    color: $overflowMenuItemHoverColor;
178
+                @media (hover: hover) and (pointer: fine) {
179
+                    &:hover {
180
+                        background-color: $overflowMenuItemHoverBG;
181
+                        color: $overflowMenuItemHoverColor;
182
+                    }
174 183
                 }
175 184
 
176 185
                 &.unclickable {
177 186
                     cursor: default;
178 187
                 }
179
-                &.unclickable:hover {
180
-                    background: inherit;
188
+                @media (hover: hover) and (pointer: fine) {
189
+                    &.unclickable:hover {
190
+                        background: inherit;
191
+                    }
181 192
                 }
182 193
                 &.disabled {
183 194
                     cursor: initial;
@@ -196,15 +207,17 @@
196 207
             }
197 208
 
198 209
             .overflow-menu-item-icon {
199
-                margin-right: 10px;
210
+                margin-right: 16px;
200 211
 
201 212
                 i {
202 213
                     display: inline;
203 214
                     font-size: 24px;
204 215
                 }
205 216
 
206
-                i:hover {
207
-                    background-color: initial;
217
+                @media (hover: hover) and (pointer: fine) {
218
+                    i:hover {
219
+                        background-color: initial;
220
+                    }
208 221
                 }
209 222
 
210 223
                 img {
@@ -214,6 +227,8 @@
214 227
 
215 228
                 svg {
216 229
                     fill: #B8C7E0 !important;
230
+                    height: 20px;
231
+                    width: 20px;
217 232
                 }
218 233
             }
219 234
 
@@ -261,7 +276,13 @@
261 276
             justify-content: center;
262 277
             width: $newToolbarSize;
263 278
 
264
-            &:hover, &.toggled {
279
+            @media (hover: hover) and (pointer: fine) {
280
+                &:hover {
281
+                    background: $newToolbarButtonHoverColor;
282
+                }
283
+            }
284
+
285
+            &.toggled {
265 286
                 background: $newToolbarButtonHoverColor;
266 287
             }
267 288
 

+ 4
- 2
css/modals/invite/_invite_more.scss 查看文件

@@ -32,8 +32,10 @@
32 32
         line-height: 24px;
33 33
         cursor: pointer;
34 34
 
35
-        &:hover {
36
-            background: #278ADF;
35
+        @media (hover: hover) and (pointer: fine) {
36
+            &:hover {
37
+                background: #278ADF;
38
+            }
37 39
         }
38 40
 
39 41
         &-text {

+ 3
- 0
react/features/base/icons/svg/icon-arrow-down-wide.svg 查看文件

@@ -0,0 +1,3 @@
1
+<svg width="29" height="12" viewBox="0 0 29 12" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+<path d="M2.5 2L14.2616 10L26.5 2" stroke="#929292" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round"/>
3
+</svg>

+ 3
- 0
react/features/base/icons/svg/icon-arrow-up-wide.svg 查看文件

@@ -0,0 +1,3 @@
1
+<svg width="29" height="12" viewBox="0 0 29 12" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+<path d="M2.5 10L14.2616 2L26.5 10" stroke="#929292" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round"/>
3
+</svg>

+ 2
- 0
react/features/base/icons/svg/index.js 查看文件

@@ -6,8 +6,10 @@ export { default as IconArrowBack } from './arrow_back.svg';
6 6
 export { default as IconArrowDown } from './arrow_down.svg';
7 7
 export { default as IconArrowDownLarge } from './arrow_down_large.svg';
8 8
 export { default as IconArrowDownSmall } from './arrow-down-small.svg';
9
+export { default as IconArrowDownWide } from './icon-arrow-down-wide.svg';
9 10
 export { default as IconArrowUp } from './arrow_up.svg';
10 11
 export { default as IconArrowUpLarge } from './arrow_up_large.svg';
12
+export { default as IconArrowUpWide } from './icon-arrow-up-wide.svg';
11 13
 export { default as IconArrowLeft } from './arrow-left.svg';
12 14
 export { default as IconAudioOnly } from './visibility.svg';
13 15
 export { default as IconAudioOnlyOff } from './visibility-off.svg';

+ 1
- 1
react/features/base/react/components/web/BaseIndicator.js 查看文件

@@ -1,10 +1,10 @@
1 1
 /* @flow */
2 2
 
3
-import Tooltip from '@atlaskit/tooltip';
4 3
 import React, { Component } from 'react';
5 4
 
6 5
 import { translate } from '../../../i18n';
7 6
 import { Icon } from '../../../icons';
7
+import { Tooltip } from '../../../tooltip';
8 8
 
9 9
 /**
10 10
  * The type of the React {@code Component} props of {@link BaseIndicator}.

+ 1
- 1
react/features/base/toolbox/components/OverflowMenuItem.web.js 查看文件

@@ -1,9 +1,9 @@
1 1
 // @flow
2 2
 
3
-import Tooltip from '@atlaskit/tooltip';
4 3
 import React, { Component } from 'react';
5 4
 
6 5
 import { Icon } from '../../icons';
6
+import { Tooltip } from '../../tooltip';
7 7
 
8 8
 /**
9 9
  * The type of the React {@code Component} props of {@link OverflowMenuItem}.

+ 1
- 1
react/features/base/toolbox/components/ToolboxItem.web.js 查看文件

@@ -1,9 +1,9 @@
1 1
 // @flow
2 2
 
3
-import Tooltip from '@atlaskit/tooltip';
4 3
 import React, { Fragment } from 'react';
5 4
 
6 5
 import { Icon } from '../../icons';
6
+import { Tooltip } from '../../tooltip';
7 7
 
8 8
 import AbstractToolboxItem from './AbstractToolboxItem';
9 9
 import type { Props } from './AbstractToolboxItem';

+ 50
- 0
react/features/base/tooltip/components/TooltipWrapper.js 查看文件

@@ -0,0 +1,50 @@
1
+// @flow
2
+
3
+import Tooltip from '@atlaskit/tooltip';
4
+import React from 'react';
5
+
6
+import { isMobileBrowser } from '../../environment/utils';
7
+
8
+type Props = {
9
+
10
+    /**
11
+     * Children of the component.
12
+     */
13
+    children: React$Node,
14
+
15
+    /**
16
+     * The text to be displayed in the tooltip.
17
+     */
18
+    content?: string | null,
19
+
20
+    /**
21
+     * The position of the tooltip relative to the element it contains.
22
+     */
23
+    position?: string
24
+
25
+}
26
+
27
+/**
28
+ * Wrapper of AtlasKit Tooltip that doesn't render the actual tooltip in mobile browsers.
29
+ *
30
+ * @returns {ReactElement}
31
+ */
32
+function TooltipWrapper({
33
+    children,
34
+    content,
35
+    position
36
+}: Props) {
37
+    if (isMobileBrowser()) {
38
+        return children;
39
+    }
40
+
41
+    return (
42
+        <Tooltip
43
+            content = { content }
44
+            position = { position }>
45
+            {children}
46
+        </Tooltip>
47
+    );
48
+}
49
+
50
+export default TooltipWrapper;

+ 3
- 0
react/features/base/tooltip/components/index.js 查看文件

@@ -0,0 +1,3 @@
1
+// @flow
2
+
3
+export { default as Tooltip } from './TooltipWrapper';

+ 3
- 0
react/features/base/tooltip/index.js 查看文件

@@ -0,0 +1,3 @@
1
+// @flow
2
+
3
+export * from './components';

+ 1
- 1
react/features/calendar-sync/components/AddMeetingUrlButton.web.js 查看文件

@@ -1,6 +1,5 @@
1 1
 // @flow
2 2
 
3
-import Tooltip from '@atlaskit/tooltip';
4 3
 import React, { Component } from 'react';
5 4
 import type { Dispatch } from 'redux';
6 5
 
@@ -11,6 +10,7 @@ import {
11 10
 import { translate } from '../../base/i18n';
12 11
 import { Icon, IconAdd } from '../../base/icons';
13 12
 import { connect } from '../../base/redux';
13
+import { Tooltip } from '../../base/tooltip';
14 14
 import { updateCalendarEvent } from '../actions';
15 15
 
16 16
 /**

+ 1
- 1
react/features/calendar-sync/components/JoinButton.web.js 查看文件

@@ -1,10 +1,10 @@
1 1
 // @flow
2 2
 
3
-import Tooltip from '@atlaskit/tooltip';
4 3
 import React, { Component } from 'react';
5 4
 
6 5
 import { translate } from '../../base/i18n';
7 6
 import { Icon, IconAdd } from '../../base/icons';
7
+import { Tooltip } from '../../base/tooltip';
8 8
 
9 9
 /**
10 10
  * The type of the React {@code Component} props of {@link JoinButton}.

+ 1
- 1
react/features/e2ee/components/E2EELabel.js 查看文件

@@ -1,12 +1,12 @@
1 1
 // @flow
2 2
 
3
-import Tooltip from '@atlaskit/tooltip';
4 3
 import React, { Component } from 'react';
5 4
 
6 5
 import { translate } from '../../base/i18n';
7 6
 import { IconE2EE } from '../../base/icons';
8 7
 import { CircularLabel } from '../../base/label';
9 8
 import { connect } from '../../base/redux';
9
+import { Tooltip } from '../../base/tooltip';
10 10
 
11 11
 import { _mapStateToProps, type Props } from './AbstractE2EELabel';
12 12
 

+ 1
- 1
react/features/invite/components/add-people-dialog/web/InviteByEmailSection.js 查看文件

@@ -1,6 +1,5 @@
1 1
 // @flow
2 2
 
3
-import Tooltip from '@atlaskit/tooltip';
4 3
 import React, { useState } from 'react';
5 4
 
6 5
 import { translate } from '../../../../base/i18n';
@@ -13,6 +12,7 @@ import {
13 12
     IconOutlook,
14 13
     IconYahoo
15 14
 } from '../../../../base/icons';
15
+import { Tooltip } from '../../../../base/tooltip';
16 16
 import { copyText, openURLInBrowser } from '../../../../base/util';
17 17
 
18 18
 type Props = {

+ 1
- 1
react/features/local-recording/components/LocalRecordingLabel.web.js 查看文件

@@ -1,11 +1,11 @@
1 1
 // @flow
2 2
 
3
-import Tooltip from '@atlaskit/tooltip';
4 3
 import React, { Component } from 'react';
5 4
 
6 5
 import { translate } from '../../base/i18n/index';
7 6
 import { CircularLabel } from '../../base/label/index';
8 7
 import { connect } from '../../base/redux';
8
+import { Tooltip } from '../../base/tooltip';
9 9
 
10 10
 
11 11
 /**

+ 2
- 2
react/features/toolbox/components/web/Drawer.js 查看文件

@@ -2,7 +2,7 @@
2 2
 
3 3
 import React, { useEffect, useRef, useState } from 'react';
4 4
 
5
-import { Icon, IconArrowUp, IconArrowDown } from '../../../base/icons';
5
+import { Icon, IconArrowUpWide, IconArrowDownWide } from '../../../base/icons';
6 6
 
7 7
 type Props = {
8 8
 
@@ -78,7 +78,7 @@ function Drawer({
78 78
                     <div
79 79
                         className = 'drawer-toggle'
80 80
                         onClick = { toggleExpanded }>
81
-                        <Icon src = { expanded ? IconArrowDown : IconArrowUp } />
81
+                        <Icon src = { expanded ? IconArrowDownWide : IconArrowUpWide } />
82 82
                     </div>
83 83
                 )}
84 84
                 {children}

+ 1
- 1
react/features/toolbox/components/web/OverflowMenuProfileItem.js 查看文件

@@ -83,7 +83,7 @@ class OverflowMenuProfileItem extends Component<Props> {
83 83
                 <span className = 'overflow-menu-item-icon'>
84 84
                     <Avatar
85 85
                         participantId = { _localParticipant.id }
86
-                        size = { 24 } />
86
+                        size = { 20 } />
87 87
                 </span>
88 88
                 <span className = 'profile-text'>
89 89
                     { displayName }

+ 1
- 1
react/features/toolbox/components/web/ToolbarButton.js 查看文件

@@ -1,9 +1,9 @@
1 1
 /* @flow */
2 2
 
3
-import Tooltip from '@atlaskit/tooltip';
4 3
 import React from 'react';
5 4
 
6 5
 import { Icon } from '../../../base/icons';
6
+import { Tooltip } from '../../../base/tooltip';
7 7
 import AbstractToolbarButton from '../AbstractToolbarButton';
8 8
 import type { Props as AbstractToolbarButtonProps }
9 9
     from '../AbstractToolbarButton';

+ 1
- 1
react/features/transcribing/components/TranscribingLabel.web.js 查看文件

@@ -1,11 +1,11 @@
1 1
 // @flow
2 2
 
3
-import Tooltip from '@atlaskit/tooltip';
4 3
 import React, { Component } from 'react';
5 4
 
6 5
 import { translate } from '../../base/i18n';
7 6
 import { CircularLabel } from '../../base/label';
8 7
 import { connect } from '../../base/redux';
8
+import { Tooltip } from '../../base/tooltip';
9 9
 
10 10
 import { _mapStateToProps, type Props } from './AbstractTranscribingLabel';
11 11
 

+ 1
- 1
react/features/video-quality/components/VideoQualityLabel.web.js 查看文件

@@ -1,12 +1,12 @@
1 1
 // @flow
2 2
 
3
-import Tooltip from '@atlaskit/tooltip';
4 3
 import React from 'react';
5 4
 
6 5
 import { translate } from '../../base/i18n';
7 6
 import { CircularLabel } from '../../base/label';
8 7
 import { MEDIA_TYPE } from '../../base/media';
9 8
 import { connect } from '../../base/redux';
9
+import { Tooltip } from '../../base/tooltip';
10 10
 import { getTrackByMediaTypeAndParticipant } from '../../base/tracks';
11 11
 
12 12
 import AbstractVideoQualityLabel, {

正在加载...
取消
保存