Browse Source

fix(css) fix various layout issues on small screen sizes (#9464)

j8
Avram Tudor 4 years ago
parent
commit
abc984f83b
No account linked to committer's email address

+ 2
- 0
css/_connection-status.scss View File

11
         line-height: 13px;
11
         line-height: 13px;
12
         margin: 0 auto;
12
         margin: 0 auto;
13
         width: 320px;
13
         width: 320px;
14
+
15
+        @include adjust-for-max-width(320px, 8px);
14
     }
16
     }
15
 
17
 
16
     &-header {
18
     &-header {

+ 10
- 0
css/_mixins.scss View File

206
     bottom: 0;
206
     bottom: 0;
207
     width: 35%;
207
     width: 35%;
208
 }
208
 }
209
+
210
+/**
211
+ * Resizes elements width to fill the whole screen width with some margin
212
+ */
213
+@mixin adjust-for-max-width($width, $margin) {
214
+    @media (max-width: $width) {
215
+        margin: 0 $margin;
216
+        width: $width - 2 * $margin;
217
+    }
218
+}

+ 4
- 0
css/_prejoin.scss View File

113
     &-dropdown-btns {
113
     &-dropdown-btns {
114
         width: 320px;
114
         width: 320px;
115
         padding: 8px 0;
115
         padding: 8px 0;
116
+
117
+        @include adjust-for-max-width(320px, 8px);
116
     }
118
     }
117
 
119
 
118
     &-dropdown-btn {
120
     &-dropdown-btn {
140
     }
142
     }
141
 
143
 
142
     &-dropdown-container {
144
     &-dropdown-container {
145
+        margin-top: 16px;
146
+
143
         & > div:nth-child(2) {
147
         & > div:nth-child(2) {
144
             background: #fff;
148
             background: #fff;
145
             padding: 0;
149
             padding: 0;

+ 7
- 2
css/_premeeting-screens.scss View File

30
 
30
 
31
     .action-btn {
31
     .action-btn {
32
         border-radius: 3px;
32
         border-radius: 3px;
33
+        box-sizing: border-box;
33
         color: #fff;
34
         color: #fff;
34
         cursor: pointer;
35
         cursor: pointer;
35
         display: inline-block;
36
         display: inline-block;
36
         font-size: 15px;
37
         font-size: 15px;
37
         line-height: 24px;
38
         line-height: 24px;
38
-        margin-top: 16px;
39
         padding: 7px 16px;
39
         padding: 7px 16px;
40
         position: relative;
40
         position: relative;
41
         text-align: center;
41
         text-align: center;
42
-        width: 286px;
42
+        width: 320px;
43
+
44
+        @include adjust-for-max-width(320px, 8px);
43
 
45
 
44
         &.primary {
46
         &.primary {
45
             background: #0376DA;
47
             background: #0376DA;
175
             text-align: center;
177
             text-align: center;
176
             width: 320px;
178
             width: 320px;
177
 
179
 
180
+            @include adjust-for-max-width(320px, 8px);
181
+
178
             &.error {
182
             &.error {
179
                 box-shadow: 0px 0px 4px 3px rgba(225, 45, 45, 0.4);
183
                 box-shadow: 0px 0px 4px 3px rgba(225, 45, 45, 0.4);
180
             }
184
             }
246
     transition: background 0.16s ease-out;
250
     transition: background 0.16s ease-out;
247
     width: 320px;
251
     width: 320px;
248
 
252
 
253
+    @include adjust-for-max-width(320px, 8px);
249
     @include flex-centered();
254
     @include flex-centered();
250
 
255
 
251
     svg {
256
     svg {

+ 5
- 0
css/modals/virtual-background/_virtual-background.scss View File

87
         font-size: 1.5vw;
87
         font-size: 1.5vw;
88
     }
88
     }
89
     @media (max-width: 432px){
89
     @media (max-width: 432px){
90
+        grid-template-columns: auto auto auto;
91
+        font-size: 1.5vw;
92
+    }
93
+    @media (max-width: 320px){
94
+        grid-template-columns: auto auto auto;
90
         font-size: 1.5vw;
95
         font-size: 1.5vw;
91
     }
96
     }
92
 }
97
 }

+ 5
- 0
react/features/base/responsive-ui/constants.js View File

13
  * @type {Symbol}
13
  * @type {Symbol}
14
  */
14
  */
15
 export const ASPECT_RATIO_WIDE = Symbol('ASPECT_RATIO_WIDE');
15
 export const ASPECT_RATIO_WIDE = Symbol('ASPECT_RATIO_WIDE');
16
+
17
+/**
18
+ * Smallest supported mobile width.
19
+ */
20
+export const SMALL_MOBILE_WIDTH = '320';

+ 12
- 2
react/features/settings/components/web/audio/AudioSettingsPopup.js View File

10
     setAudioOutputDevice as setAudioOutputDeviceAction
10
     setAudioOutputDevice as setAudioOutputDeviceAction
11
 } from '../../../../base/devices';
11
 } from '../../../../base/devices';
12
 import { connect } from '../../../../base/redux';
12
 import { connect } from '../../../../base/redux';
13
+import { SMALL_MOBILE_WIDTH } from '../../../../base/responsive-ui/constants';
13
 import {
14
 import {
14
     getCurrentMicDeviceId,
15
     getCurrentMicDeviceId,
15
     getCurrentOutputDeviceId
16
     getCurrentOutputDeviceId
36
     * Callback executed when the popup closes.
37
     * Callback executed when the popup closes.
37
     */
38
     */
38
     onClose: Function,
39
     onClose: Function,
40
+
41
+    /**
42
+     * The popup placement enum value.
43
+     */
44
+    popupPlacement: string
39
 }
45
 }
40
 
46
 
41
 /**
47
 /**
52
     setAudioInputDevice,
58
     setAudioInputDevice,
53
     setAudioOutputDevice,
59
     setAudioOutputDevice,
54
     onClose,
60
     onClose,
55
-    outputDevices
61
+    outputDevices,
62
+    popupPlacement
56
 }: Props) {
63
 }: Props) {
57
     return (
64
     return (
58
         <div className = 'audio-preview'>
65
         <div className = 'audio-preview'>
66
                     setAudioOutputDevice = { setAudioOutputDevice } /> }
73
                     setAudioOutputDevice = { setAudioOutputDevice } /> }
67
                 isOpen = { isOpen }
74
                 isOpen = { isOpen }
68
                 onClose = { onClose }
75
                 onClose = { onClose }
69
-                placement = 'top-start'>
76
+                placement = { popupPlacement }>
70
                 {children}
77
                 {children}
71
             </InlineDialog>
78
             </InlineDialog>
72
         </div>
79
         </div>
80
  * @returns {Object}
87
  * @returns {Object}
81
  */
88
  */
82
 function mapStateToProps(state) {
89
 function mapStateToProps(state) {
90
+    const { clientWidth } = state['features/base/responsive-ui'];
91
+
83
     return {
92
     return {
93
+        popupPlacement: clientWidth <= SMALL_MOBILE_WIDTH ? 'auto' : 'top-start',
84
         currentMicDeviceId: getCurrentMicDeviceId(state),
94
         currentMicDeviceId: getCurrentMicDeviceId(state),
85
         currentOutputDeviceId: getCurrentOutputDeviceId(state),
95
         currentOutputDeviceId: getCurrentOutputDeviceId(state),
86
         isOpen: getAudioSettingsVisibility(state),
96
         isOpen: getAudioSettingsVisibility(state),

+ 11
- 1
react/features/settings/components/web/video/VideoSettingsPopup.js View File

8
     setVideoInputDeviceAndUpdateSettings
8
     setVideoInputDeviceAndUpdateSettings
9
 } from '../../../../base/devices';
9
 } from '../../../../base/devices';
10
 import { connect } from '../../../../base/redux';
10
 import { connect } from '../../../../base/redux';
11
+import { SMALL_MOBILE_WIDTH } from '../../../../base/responsive-ui/constants';
11
 import { getCurrentCameraDeviceId } from '../../../../base/settings';
12
 import { getCurrentCameraDeviceId } from '../../../../base/settings';
12
 import { toggleVideoSettings } from '../../../actions';
13
 import { toggleVideoSettings } from '../../../actions';
13
 import { getVideoSettingsVisibility } from '../../../functions';
14
 import { getVideoSettingsVisibility } from '../../../functions';
31
     * Callback executed when the popup closes.
32
     * Callback executed when the popup closes.
32
     */
33
     */
33
     onClose: Function,
34
     onClose: Function,
35
+
36
+    /**
37
+     * The popup placement enum value.
38
+     */
39
+     popupPlacement: string
34
 }
40
 }
35
 
41
 
36
 /**
42
 /**
43
     children,
49
     children,
44
     isOpen,
50
     isOpen,
45
     onClose,
51
     onClose,
52
+    popupPlacement,
46
     setVideoInputDevice,
53
     setVideoInputDevice,
47
     videoDeviceIds
54
     videoDeviceIds
48
 }: Props) {
55
 }: Props) {
56
                     videoDeviceIds = { videoDeviceIds } /> }
63
                     videoDeviceIds = { videoDeviceIds } /> }
57
                 isOpen = { isOpen }
64
                 isOpen = { isOpen }
58
                 onClose = { onClose }
65
                 onClose = { onClose }
59
-                placement = 'top-start'>
66
+                placement = { popupPlacement }>
60
                 { children }
67
                 { children }
61
             </InlineDialog>
68
             </InlineDialog>
62
         </div>
69
         </div>
71
  * @returns {Object}
78
  * @returns {Object}
72
  */
79
  */
73
 function mapStateToProps(state) {
80
 function mapStateToProps(state) {
81
+    const { clientWidth } = state['features/base/responsive-ui'];
82
+
74
     return {
83
     return {
75
         currentCameraDeviceId: getCurrentCameraDeviceId(state),
84
         currentCameraDeviceId: getCurrentCameraDeviceId(state),
76
         isOpen: getVideoSettingsVisibility(state),
85
         isOpen: getVideoSettingsVisibility(state),
86
+        popupPlacement: clientWidth <= SMALL_MOBILE_WIDTH ? 'auto' : 'top-start',
77
         videoDeviceIds: getVideoDeviceIds(state)
87
         videoDeviceIds: getVideoDeviceIds(state)
78
     };
88
     };
79
 }
89
 }

Loading…
Cancel
Save