Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

HSIButton refactoring #817

Merged
merged 4 commits into from
May 19, 2021
Merged

HSIButton refactoring #817

merged 4 commits into from
May 19, 2021

Conversation

annarieger
Copy link
Member

  • Refactor HSIButton class to react's functional component
  • 馃敟 Breaking changes:
    • t was removed from class props
    • dispatch was removed from class props, react-redux hook will be used instead
    • additional optional propery onToggleCb was added to enable custom logic on HSIButton activation (e.g. show notification about tool state, queryable layers etc.)
    • default value for tooltip is set to Feature Info
    • default value for tooltipPlacement is set to right

Existing application may will have to adapt class invocation as follows:

<HsiButton           
    iconName="my-icon" --> provide icon if no default (`icon-circle`) is desired
    pressedIconName="my-icon"  --> provide icon if no default (`icon-circle`) is desired
    tooltip="My tooltip" --> provide your tooltip (default is `Feature Info`)
    tooltipPlacement="bottom" --> adjust tooltip placement (default is `right`)
    name="info"
    map={map}            
    t={t} --> remove it, it's obsolete!
    dispatch={dispatchFn} --> remove it, it's obsolete!
    onToggleCb={myOptionalCallback} --> pass optional callback function on button toggle
    ...
  />

Please review @terrestris/devs

Copy link
Member

@dnlkoch dnlkoch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice @annarieger!

Please add the breaking change to the CHANGELOG as well.

@annarieger
Copy link
Member Author

Very nice @annarieger!

Please add the breaking change to the CHANGELOG as well.

Done with 1ea3cf5.

Thanks! 馃崓

@annarieger annarieger merged commit 3885df1 into master May 19, 2021
@annarieger annarieger deleted the hsi-button-refactoring branch May 19, 2021 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants