-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Chore]: Technical: add types for side panel root components #1822
Conversation
Signed-off-by: Evgeny Zhgulev <evgeny.zhgulev@actionengine.com>
Signed-off-by: Evgeny Zhgulev <evgeny.zhgulev@actionengine.com>
d39075c
to
c22a144
Compare
Signed-off-by: Evgeny Zhgulev <evgeny.zhgulev@actionengine.com>
Signed-off-by: Evgeny Zhgulev <evgeny.zhgulev@actionengine.com>
type PanelToggleProps = { | ||
panels: PanelItem[]; | ||
activePanel: string; | ||
togglePanel: typeof toggleSidePanel; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use ActionHandler<>
#1801 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
const PanelToggle = ({activePanel, panels, togglePanel}) => { | ||
|
||
function PanelToggleFactory(PanelTab: ReturnType<typeof PanelTabFactory>) { | ||
const PanelToggle = ({activePanel, panels, togglePanel}: PanelToggleProps) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to be consistent...
const PanelToggle = React.FC<PanelToggleProps>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
@@ -45,7 +62,7 @@ export const StyledPanelTab = styled.div.attrs({ | |||
`; | |||
|
|||
export function PanelTabFactory() { | |||
const PanelTab = ({isActive, onClick, panel}) => ( | |||
const PanelTab = ({isActive, onClick, panel}: PanelTabProps) => ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const PanelTab: React.FC<PanelTabProps> = ({isActive, onClick, panel}) => ()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
const dropdownItemsSelector = getDropdownItemsSelector(); | ||
|
||
const SaveExportDropdown = props => ( | ||
const SaveExportDropdown = (props: DropdownComponentProps) => ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use SaveExportDropdown: React.FC<DropdownComponentProps>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
const dropdownItemsSelector = getDropdownItemsSelector(); | ||
|
||
const CloudStorageDropdown = props => ( | ||
const CloudStorageDropdown = (props: DropdownComponentProps) => ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use CloudStorageDropdown: React.FC<DropdownComponentProps>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
@@ -86,7 +154,7 @@ const StyledToolbar = styled(Toolbar)` | |||
position: absolute; | |||
`; | |||
|
|||
export const PanelAction = ({item, onClick}) => ( | |||
export const PanelAction = ({item, onClick}: PanelActionProps) => ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PanelAction: React.FC<PanelActionProps>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
@@ -101,7 +169,7 @@ export const PanelAction = ({item, onClick}) => ( | |||
); | |||
|
|||
export const PanelHeaderDropdownFactory = () => { | |||
const PanelHeaderDropdown = ({items, show, onClose, id}) => { | |||
const PanelHeaderDropdown = ({items, show, onClose, id}: PanelHeaderDropdownProps) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PanelHeaderDropdown: React.FC<PanelHeaderDropdownProps>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
@@ -66,7 +96,7 @@ const LayerBlendingSelector = ({layerBlending, updateLayerBlending, intl}) => { | |||
<FormattedMessage id="layerBlending.title" /> | |||
</PanelLabel> | |||
<ItemSelector | |||
selectedItems={intl.formatMessage({id: LAYER_BLENDINGS[layerBlending].label})} | |||
selectedItems={[intl.formatMessage({id: LAYER_BLENDINGS[layerBlending].label})]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
selectedItems don't need to be an array
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
filters: Filter[]; | ||
datasets: Datasets; | ||
layers: Layer[]; | ||
showDatasetTable: typeof VisStateActions.showDatasetTable; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use ActionHandler<>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
Signed-off-by: Evgeny Zhgulev <evgeny.zhgulev@actionengine.com>
Signed-off-by: Evgeny Zhgulev <evgeny.zhgulev@actionengine.com>
Signed-off-by: Evgeny Zhgulev <evgeny.zhgulev@actionengine.com>
Signed-off-by: Evgeny Zhgulev <evgeny.zhgulev@actionengine.com>
Signed-off-by: Evgeny Zhgulev evgeny.zhgulev@actionengine.com