@@ -22,7 +22,7 @@ import type ResizeNotifier from "../../../utils/ResizeNotifier";
2222import ResizeHandle from "../elements/ResizeHandle" ;
2323import Resizer , { type IConfig } from "../../../resizer/resizer" ;
2424import PercentageDistributor from "../../../resizer/distributors/percentage" ;
25- import { Container , WidgetLayoutStore } from "../../../stores/widgets/WidgetLayoutStore" ;
25+ import { WidgetLayoutStore } from "../../../stores/widgets/WidgetLayoutStore" ;
2626import UIStore from "../../../stores/UIStore" ;
2727import { type ActionPayload } from "../../../dispatcher/payloads" ;
2828import Spinner from "../elements/Spinner" ;
@@ -39,9 +39,9 @@ interface IProps {
3939
4040interface IState {
4141 apps : {
42- [ Container . Top ] : IWidget [ ] ;
43- [ Container . Center ] : IWidget [ ] ;
44- [ Container . Right ] ?: IWidget [ ] ;
42+ [ "top" ] : IWidget [ ] ;
43+ [ "center" ] : IWidget [ ] ;
44+ [ "right" ] ?: IWidget [ ] ;
4545 } ;
4646 resizingVertical : boolean ; // true when changing the height of the apps drawer
4747 resizingHorizontal : boolean ; // true when changing the distribution of the width between widgets
@@ -119,7 +119,7 @@ export default class AppsDrawer extends React.Component<IProps, IState> {
119119 this . resizeContainer ?. classList . remove ( "mx_AppsDrawer--resizing" ) ;
120120 WidgetLayoutStore . instance . setResizerDistributions (
121121 this . props . room ,
122- Container . Top ,
122+ "top" ,
123123 this . topApps ( )
124124 . slice ( 1 )
125125 . map ( ( _ , i ) => this . resizer . forHandleAt ( i ) ! . size ) ,
@@ -152,7 +152,7 @@ export default class AppsDrawer extends React.Component<IProps, IState> {
152152 if ( prevProps . userId !== this . props . userId || prevProps . room !== this . props . room ) {
153153 // Room has changed, update apps
154154 this . updateApps ( ) ;
155- } else if ( this . getAppsHash ( this . topApps ( ) ) !== this . getAppsHash ( prevState . apps [ Container . Top ] ) ) {
155+ } else if ( this . getAppsHash ( this . topApps ( ) ) !== this . getAppsHash ( prevState . apps [ "top" ] ) ) {
156156 this . loadResizerPreferences ( ) ;
157157 }
158158 }
@@ -166,7 +166,7 @@ export default class AppsDrawer extends React.Component<IProps, IState> {
166166 } ;
167167
168168 private loadResizerPreferences = ( ) : void => {
169- const distributions = WidgetLayoutStore . instance . getResizerDistributions ( this . props . room , Container . Top ) ;
169+ const distributions = WidgetLayoutStore . instance . getResizerDistributions ( this . props . room , "top" ) ;
170170 if ( this . state . apps && this . topApps ( ) . length - 1 === distributions . length ) {
171171 distributions . forEach ( ( size , i ) => {
172172 const distributor = this . resizer . forHandleAt ( i ) ;
@@ -206,11 +206,11 @@ export default class AppsDrawer extends React.Component<IProps, IState> {
206206 } ;
207207
208208 private getApps = ( ) : IState [ "apps" ] => ( {
209- [ Container . Top ] : WidgetLayoutStore . instance . getContainerWidgets ( this . props . room , Container . Top ) ,
210- [ Container . Center ] : WidgetLayoutStore . instance . getContainerWidgets ( this . props . room , Container . Center ) ,
209+ [ "top" ] : WidgetLayoutStore . instance . getContainerWidgets ( this . props . room , "top" ) ,
210+ [ "center" ] : WidgetLayoutStore . instance . getContainerWidgets ( this . props . room , "center" ) ,
211211 } ) ;
212- private topApps = ( ) : IWidget [ ] => this . state . apps [ Container . Top ] ;
213- private centerApps = ( ) : IWidget [ ] => this . state . apps [ Container . Center ] ;
212+ private topApps = ( ) : IWidget [ ] => this . state . apps [ "top" ] ;
213+ private centerApps = ( ) : IWidget [ ] => this . state . apps [ "center" ] ;
214214
215215 private updateApps = ( ) : void => {
216216 if ( this . unmounted ) return ;
@@ -321,7 +321,7 @@ const PersistentVResizer: React.FC<IPersistentResizerProps> = ({
321321 resizeNotifier,
322322 children,
323323} ) => {
324- let defaultHeight = WidgetLayoutStore . instance . getContainerHeight ( room , Container . Top ) ;
324+ let defaultHeight = WidgetLayoutStore . instance . getContainerHeight ( room , "top" ) ;
325325
326326 // Arbitrary defaults to avoid NaN problems. 100 px or 3/4 of the visible window.
327327 if ( ! minHeight ) minHeight = 100 ;
@@ -352,7 +352,7 @@ const PersistentVResizer: React.FC<IPersistentResizerProps> = ({
352352 let newHeight = defaultHeight ! + d . height ;
353353 newHeight = percentageOf ( newHeight , minHeight , maxHeight ) * 100 ;
354354
355- WidgetLayoutStore . instance . setContainerHeight ( room , Container . Top , newHeight ) ;
355+ WidgetLayoutStore . instance . setContainerHeight ( room , "top" , newHeight ) ;
356356
357357 resizeNotifier . stopResizing ( ) ;
358358 } }
0 commit comments