@@ -33,6 +33,7 @@ import AccessibleButton from '../elements/AccessibleButton';
33
33
import { IntegrationManagers } from "../../../integrations/IntegrationManagers" ;
34
34
import SettingsStore from "../../../settings/SettingsStore" ;
35
35
import { useLocalStorageState } from "../../../hooks/useLocalStorageState" ;
36
+ import ResizeNotifier from "../../../utils/ResizeNotifier" ;
36
37
37
38
// The maximum number of widgets that can be added in a room
38
39
const MAX_WIDGETS = 2 ;
@@ -41,6 +42,7 @@ export default class AppsDrawer extends React.Component {
41
42
static propTypes = {
42
43
userId : PropTypes . string . isRequired ,
43
44
room : PropTypes . object . isRequired ,
45
+ resizeNotifier : PropTypes . instanceOf ( ResizeNotifier ) . isRequired ,
44
46
showApps : PropTypes . bool , // Should apps be rendered
45
47
hide : PropTypes . bool , // If rendered, should apps drawer be visible
46
48
} ;
@@ -218,9 +220,10 @@ export default class AppsDrawer extends React.Component {
218
220
< PersistentVResizer
219
221
id = { "apps-drawer_" + this . props . room . roomId }
220
222
minHeight = { 100 }
221
- maxHeight = { this . props . maxHeight - 50 }
223
+ maxHeight = { this . props . maxHeight ? this . props . maxHeight - 50 : undefined }
222
224
handleClass = "mx_AppsContainer_resizerHandle"
223
225
className = "mx_AppsContainer"
226
+ resizeNotifier = { this . props . resizeNotifier }
224
227
>
225
228
{ apps }
226
229
{ spinner }
@@ -231,7 +234,16 @@ export default class AppsDrawer extends React.Component {
231
234
}
232
235
}
233
236
234
- const PersistentVResizer = ( { id, minHeight, maxHeight, className, handleWrapperClass, handleClass, children} ) => {
237
+ const PersistentVResizer = ( {
238
+ id,
239
+ minHeight,
240
+ maxHeight,
241
+ className,
242
+ handleWrapperClass,
243
+ handleClass,
244
+ resizeNotifier,
245
+ children,
246
+ } ) => {
235
247
const [ height , setHeight ] = useLocalStorageState ( "pvr_" + id , 100 ) ;
236
248
const [ resizing , setResizing ] = useState ( false ) ;
237
249
@@ -241,10 +253,15 @@ const PersistentVResizer = ({id, minHeight, maxHeight, className, handleWrapperC
241
253
maxHeight = { maxHeight }
242
254
onResizeStart = { ( ) => {
243
255
if ( ! resizing ) setResizing ( true ) ;
256
+ resizeNotifier . startResizing ( ) ;
257
+ } }
258
+ onResize = { ( ) => {
259
+ resizeNotifier . notifyTimelineHeightChanged ( ) ;
244
260
} }
245
261
onResizeStop = { ( e , dir , ref , d ) => {
246
262
setHeight ( height + d . height ) ;
247
263
if ( resizing ) setResizing ( false ) ;
264
+ resizeNotifier . stopResizing ( ) ;
248
265
} }
249
266
handleWrapperClass = { handleWrapperClass }
250
267
handleClasses = { { bottom : handleClass } }
0 commit comments