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

[Maps] fix attribution overflow with exit full screen button #62699

Merged
merged 5 commits into from
Apr 8, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@
pointer-events: all;
padding-left: $euiSizeM;
}

.mapAttributionControl__fullScreen {
padding-left: $euiSizeXXL * 4 !important;
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not an expert on this.

Wouldn't margin-left work here? The attribution box won't stretch over the exit-full-screen-button then, as opposed to padding, where it does stretch over.

It would also remove the need for the !important override, which if I understand it is somewhat of a code-smell in CSS.

.mapAttributionControl__fullScreen {
  margin-left: $euiSizeXXL * 4;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
import { connect } from 'react-redux';
import { AttributionControl } from './view';
import { getLayerList } from '../../../selectors/map_selectors';
import { getIsFullScreen } from '../../../selectors/ui_selectors';

function mapStateToProps(state = {}) {
return {
layerList: getLayerList(state),
isFullScreen: getIsFullScreen(state),
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import React, { Fragment } from 'react';
import _ from 'lodash';
import { EuiText, EuiLink } from '@elastic/eui';
import classNames from 'classnames';

export class AttributionControl extends React.Component {
state = {
Expand Down Expand Up @@ -86,7 +87,11 @@ export class AttributionControl extends React.Component {
return null;
}
return (
<div className="mapAttributionControl">
<div
className={classNames('mapAttributionControl', {
mapAttributionControl__fullScreen: this.props.isFullScreen,
})}
>
<EuiText size="xs">
<small>
<strong>{this._renderAttributions()}</strong>
Expand Down