Skip to content

Commit

Permalink
[Chore]: add class names to map control (#1940)
Browse files Browse the repository at this point in the history
  • Loading branch information
igorDykhta committed Aug 24, 2022
1 parent c7ed4db commit 5e20ac6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions examples/demo-app/src/components/map-control/map-control.js
Expand Up @@ -19,6 +19,7 @@
// THE SOFTWARE.

import React, {useState} from 'react';
import classnames from 'classnames';
import styled from 'styled-components';
import {Icons, IconRoundSmall, MapControlButton} from 'kepler.gl/components';

Expand Down Expand Up @@ -156,6 +157,7 @@ export function SampleMapPanel(props) {
</StyledProjectPanel>
) : (
<MapControlButton
className={classnames('map-control-button', 'info-panel', {isActive})}
onClick={e => {
e.preventDefault();
setActive(true);
Expand Down
4 changes: 2 additions & 2 deletions src/components/map/locale-panel.tsx
Expand Up @@ -65,7 +65,7 @@ function LocalePanelFactory(
return null;
}
return (
<div className="map-locale-controls" style={{position: 'relative'}}>
<div className="locale-panel-controls" style={{position: 'relative'}}>
{isActive ? (
<MapControlToolbar show={isActive}>
{availableLocales.map(locale => (
Expand All @@ -80,7 +80,7 @@ function LocalePanelFactory(
) : null}
<MapControlTooltip id="locale" message="tooltip.selectLocale">
<MapControlButton
className={classnames('map-control-button', 'map-locale', {isActive})}
className={classnames('map-control-button', 'locale-panel', {isActive})}
onClick={onClickButton}
active={isActive}
>
Expand Down
2 changes: 1 addition & 1 deletion test/browser/components/map/map-control-test.js
Expand Up @@ -184,7 +184,7 @@ test('MapControlFactory - click options', t => {

// click locale
wrapper
.find('.map-control-button.map-locale')
.find('.map-control-button.locale-panel')
.at(0)
.simulate('click');
t.ok(onToggleMapControl.calledTwice, 'should call onToggleMapControl');
Expand Down

0 comments on commit 5e20ac6

Please sign in to comment.