Skip to content

Commit

Permalink
ZoomControls renders divider with configured className from props if …
Browse files Browse the repository at this point in the history
…given
  • Loading branch information
barmintor committed Oct 27, 2023
1 parent b9d0792 commit f75e516
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/ZoomControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class ZoomControls extends Component {
*/
render() {
const {
displayDivider, showZoomControls, t, zoomToWorld,
classes, displayDivider, showZoomControls, t, zoomToWorld,
} = this.props;

if (!showZoomControls) {
Expand All @@ -81,13 +81,14 @@ export class ZoomControls extends Component {
<MiradorMenuButton aria-label={t('zoomReset')} onClick={() => zoomToWorld(false)}>
<RestoreZoomIcon />
</MiradorMenuButton>
{displayDivider && <Box component="span" sx={dividerStyle} />}
{displayDivider && <Box component="span" sx={dividerStyle} className={classes?.divider} />}
</StyledZoomControlsWrapper>
);
}
}

ZoomControls.propTypes = {
classes: PropTypes.objectOf(PropTypes.string),
displayDivider: PropTypes.bool,
showZoomControls: PropTypes.bool,
t: PropTypes.func,
Expand All @@ -102,6 +103,7 @@ ZoomControls.propTypes = {
};

ZoomControls.defaultProps = {
classes: {},
displayDivider: true,
showZoomControls: false,
t: key => key,
Expand Down

0 comments on commit f75e516

Please sign in to comment.