Procházet zdrojové kódy

fix(overflow-menu) Pin reactions on menu bottom on mobile web (#10599)

Move some styles from SCSS to JSS
master
Robert Pintilii před 3 roky
rodič
revize
a6a24fa973
Žádný účet není propojen s e-mailovou adresou tvůrce revize

+ 1
- 2
css/_drawer.scss Zobrazit soubor

@@ -24,10 +24,9 @@
24 24
 }
25 25
 
26 26
 .drawer-menu {
27
-    max-height: calc(80vh - 64px);
28 27
     background: #242528;
29 28
     border-radius: 16px 16px 0 0;
30
-    overflow-y: scroll;
29
+    overflow-y: auto;
31 30
     margin-bottom: env(safe-area-inset-bottom, 0);
32 31
     width: 100%;
33 32
 

+ 0
- 6
css/_reactions-menu.scss Zobrazit soubor

@@ -8,12 +8,6 @@
8 8
 	padding: 16px;
9 9
 
10 10
 	&.overflow {
11
-		width: auto;
12
-		padding-bottom: max(env(safe-area-inset-bottom, 0), 16px);
13
-		background-color: #141414;
14
-		box-shadow: none;
15
-		border-radius: 0;
16
-		position: relative;
17 11
 
18 12
 		.toolbox-icon {
19 13
 			width: 48px;

+ 25
- 4
react/features/reactions/components/web/ReactionsMenu.js Zobrazit soubor

@@ -2,6 +2,7 @@
2 2
 
3 3
 /* eslint-disable react/jsx-no-bind */
4 4
 
5
+import { withStyles } from '@material-ui/styles';
5 6
 import React, { Component } from 'react';
6 7
 import { bindActionCreators } from 'redux';
7 8
 
@@ -17,7 +18,7 @@ import { connect } from '../../../base/redux';
17 18
 import { dockToolbox } from '../../../toolbox/actions.web';
18 19
 import { addReactionToBuffer } from '../../actions.any';
19 20
 import { toggleReactionsMenuVisibility } from '../../actions.web';
20
-import { REACTIONS } from '../../constants';
21
+import { REACTIONS, REACTIONS_MENU_HEIGHT } from '../../constants';
21 22
 
22 23
 import ReactionButton from './ReactionButton';
23 24
 
@@ -43,6 +44,11 @@ type Props = {
43 44
      */
44 45
     _raisedHand: boolean,
45 46
 
47
+    /**
48
+     * An object containing the CSS classes.
49
+     */
50
+    classes: Object,
51
+
46 52
     /**
47 53
      * The Redux Dispatch function.
48 54
      */
@@ -61,6 +67,21 @@ type Props = {
61 67
 
62 68
 declare var APP: Object;
63 69
 
70
+const styles = theme => {
71
+    return {
72
+        overflow: {
73
+            width: 'auto',
74
+            paddingBottom: 'max(env(safe-area-inset-bottom, 0), 16px)',
75
+            backgroundColor: theme.palette.ui01,
76
+            boxShadow: 'none',
77
+            borderRadius: 0,
78
+            position: 'relative',
79
+            boxSizing: 'border-box',
80
+            height: `${REACTIONS_MENU_HEIGHT}px`
81
+        }
82
+    };
83
+};
84
+
64 85
 /**
65 86
  * Implements the reactions menu.
66 87
  *
@@ -172,10 +193,10 @@ class ReactionsMenu extends Component<Props> {
172 193
      * @inheritdoc
173 194
      */
174 195
     render() {
175
-        const { _raisedHand, t, overflowMenu, _isMobile } = this.props;
196
+        const { _raisedHand, t, overflowMenu, _isMobile, classes } = this.props;
176 197
 
177 198
         return (
178
-            <div className = { `reactions-menu ${overflowMenu ? 'overflow' : ''}` }>
199
+            <div className = { `reactions-menu ${overflowMenu ? `overflow ${classes.overflow}` : ''}` }>
179 200
                 <div className = 'reactions-row'>
180 201
                     { this._getReactionButtons() }
181 202
                 </div>
@@ -233,4 +254,4 @@ function mapDispatchToProps(dispatch) {
233 254
 export default translate(connect(
234 255
     mapStateToProps,
235 256
     mapDispatchToProps
236
-)(ReactionsMenu));
257
+)(withStyles(styles)(ReactionsMenu)));

+ 5
- 0
react/features/reactions/constants.js Zobrazit soubor

@@ -9,6 +9,11 @@ import {
9 9
     SILENCE_SOUND_FILES
10 10
 } from './sounds';
11 11
 
12
+/**
13
+ * Reactions menu height on mobile web (px).
14
+ */
15
+export const REACTIONS_MENU_HEIGHT = 144;
16
+
12 17
 /**
13 18
  * The payload name for the datachannel/endpoint reaction event.
14 19
  */

+ 4
- 1
react/features/toolbox/components/web/Drawer.js Zobrazit soubor

@@ -3,6 +3,8 @@
3 3
 import { makeStyles } from '@material-ui/core';
4 4
 import React, { useCallback } from 'react';
5 5
 
6
+import { DRAWER_MAX_HEIGHT } from '../../constants';
7
+
6 8
 
7 9
 type Props = {
8 10
 
@@ -25,7 +27,8 @@ type Props = {
25 27
 const useStyles = makeStyles(theme => {
26 28
     return {
27 29
         drawer: {
28
-            backgroundColor: theme.palette.ui02
30
+            backgroundColor: theme.palette.ui02,
31
+            maxHeight: `calc(${DRAWER_MAX_HEIGHT})`
29 32
         }
30 33
     };
31 34
 });

+ 5
- 3
react/features/toolbox/components/web/Toolbox.js Zobrazit soubor

@@ -42,7 +42,7 @@ import { ParticipantsPaneButton } from '../../../participants-pane/components/we
42 42
 import { getParticipantsPaneOpen } from '../../../participants-pane/functions';
43 43
 import { addReactionToBuffer } from '../../../reactions/actions.any';
44 44
 import { ReactionsMenuButton } from '../../../reactions/components';
45
-import { REACTIONS } from '../../../reactions/constants';
45
+import { REACTIONS, REACTIONS_MENU_HEIGHT } from '../../../reactions/constants';
46 46
 import { isReactionsEnabled } from '../../../reactions/functions.any';
47 47
 import {
48 48
     LiveStreamButton,
@@ -75,7 +75,7 @@ import {
75 75
     setToolbarHovered,
76 76
     showToolbox
77 77
 } from '../../actions';
78
-import { THRESHOLDS, NOT_APPLICABLE } from '../../constants';
78
+import { THRESHOLDS, NOT_APPLICABLE, DRAWER_MAX_HEIGHT } from '../../constants';
79 79
 import { isToolboxVisible } from '../../functions';
80 80
 import DownloadButton from '../DownloadButton';
81 81
 import HangupButton from '../HangupButton';
@@ -264,7 +264,9 @@ const styles = theme => {
264 264
             fontSize: 14,
265 265
             listStyleType: 'none',
266 266
             padding: '8px 0',
267
-            backgroundColor: theme.palette.ui03
267
+            backgroundColor: theme.palette.ui03,
268
+            overflowY: 'auto',
269
+            height: `calc(${DRAWER_MAX_HEIGHT} - ${REACTIONS_MENU_HEIGHT}px - 16px)`
268 270
         }
269 271
     };
270 272
 };

+ 2
- 0
react/features/toolbox/constants.js Zobrazit soubor

@@ -31,3 +31,5 @@ export const THRESHOLDS = [
31 31
 export const NOT_APPLICABLE = 'N/A';
32 32
 
33 33
 export const TOOLBAR_TIMEOUT = 4000;
34
+
35
+export const DRAWER_MAX_HEIGHT = '80vh - 64px';

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