Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Chore] refactored side-panel from class to functional component (#1536)
* chore: refactored side-panel from class to functional component * created new side panel content component to isolate logic to toggle panels Signed-off-by: Shan He <heshan0131@gmail.com> Co-authored-by: Giuseppe Macrì <macri.giuseppe@gmail.com>
- Loading branch information
1 parent
16fab11
commit 2e6f8b7
Showing
15 changed files
with
458 additions
and
419 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import React from 'react'; | ||
import {Datasets, Filter, AnimationConfig} from 'reducers/vis-state-updaters'; | ||
import {UiState} from 'reducers/ui-state-updaters'; | ||
import * as UIStateActions from 'actions/ui-state-actions'; | ||
import * as VisStateActions from 'actions/vis-state-actions'; | ||
import {Layer} from 'layers'; | ||
|
||
export type BottomWidgetProps = { | ||
datasets: Datasets; | ||
filters: Filter[]; | ||
layers: Layer[]; | ||
animationConfig: AnimationConfig; | ||
uiStateActions: typeof UIStateActions; | ||
visStateActions: typeof VisStateActions; | ||
rootRef: React.ForwardedRef<HTMLDivElement>; | ||
containerW: number; | ||
uiState: UiState; | ||
sidePanelWidth: number; | ||
toggleModal: typeof UIStateActions.toggleModal; | ||
children?: React.ReactNode; | ||
}; | ||
|
||
export function BottomWidgetFactory( | ||
TimeWidget: typeof React.Component, | ||
AnimationControl: typeof React.Component, | ||
FilterAnimationController: typeof React.Component, | ||
LayerAnimationController: typeof React.Component | ||
): any; | ||
|
||
export default BottomWidgetFactory; | ||
|
||
export function LayerAnimationControllerFactory(): React.Component; | ||
export function FilterAnimationControllerFactory(): React.Component; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import {ComponentType} from 'react'; | ||
import {Datasets, Filter, InteractionConfig, MapStyle} from '../reducers'; | ||
import {Layer, LayerClassesType} from '../layers'; | ||
|
||
import * as MapStyleActions from 'actions/map-style-actions'; | ||
import * as VisStateActions from 'actions/vis-state-actions'; | ||
import * as MapStateActions from 'actions/map-state-actions'; | ||
|
||
export type SidePanelItem = { | ||
id: stirng; | ||
label: string; | ||
iconComponent: ComponentType<any>; | ||
}; | ||
|
||
export type SidePanelProps = { | ||
filters: Filter; | ||
interactionConfig: InteractionConfig; | ||
layerBlending: stirng; | ||
layers: Layer; | ||
layerClasses: LayerClassesType; | ||
mapStyle: MapStyle; | ||
width: number; | ||
datasets: Datasets; | ||
visStateActions: typeof VisStateActions; | ||
mapStateActions: typeof MapStateActions; | ||
mapStyleActions: typeof MapStyleActions; | ||
availableProviders: object; | ||
mapSaved?: string | null; | ||
panels: SidePanelItem[]; | ||
}; | ||
|
||
export const SidePanel: PureComponent<SidePanelProps>; | ||
export default function SidePanelFactory(): PureComponent<SidePanelProps>; |
Oops, something went wrong.