Procházet zdrojové kódy

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

j8
Avram Tudor před 4 roky
rodič
revize
abc984f83b
Žádný účet není propojen s e-mailovou adresou tvůrce revize

+ 2
- 0
css/_connection-status.scss Zobrazit soubor

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

+ 10
- 0
css/_mixins.scss Zobrazit soubor

@@ -206,3 +206,13 @@
206 206
     bottom: 0;
207 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 Zobrazit soubor

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

+ 7
- 2
css/_premeeting-screens.scss Zobrazit soubor

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

+ 5
- 0
css/modals/virtual-background/_virtual-background.scss Zobrazit soubor

@@ -87,6 +87,11 @@
87 87
         font-size: 1.5vw;
88 88
     }
89 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 95
         font-size: 1.5vw;
91 96
     }
92 97
 }

+ 5
- 0
react/features/base/responsive-ui/constants.js Zobrazit soubor

@@ -13,3 +13,8 @@ export const ASPECT_RATIO_NARROW = Symbol('ASPECT_RATIO_NARROW');
13 13
  * @type {Symbol}
14 14
  */
15 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 Zobrazit soubor

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

+ 11
- 1
react/features/settings/components/web/video/VideoSettingsPopup.js Zobrazit soubor

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

Načítá se…
Zrušit
Uložit