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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Chore]: Add class names to map control #1940

Merged
merged 1 commit into from
Aug 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions examples/demo-app/src/components/map-control/map-control.js
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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