mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-11 18:13:47 +00:00
Implemented map to show visits from every city
This commit is contained in:
@@ -9,12 +9,13 @@ import './OpenMapModalBtn.scss';
|
||||
export default class OpenMapModalBtn extends React.Component {
|
||||
static propTypes = {
|
||||
title: PropTypes.string.isRequired,
|
||||
locations: PropTypes.arrayOf(PropTypes.object),
|
||||
};
|
||||
|
||||
state = { mapIsOpened: false };
|
||||
|
||||
render() {
|
||||
const { title } = this.props;
|
||||
const { title, locations = [] } = this.props;
|
||||
const toggleMap = () => this.setState(({ mapIsOpened }) => ({ mapIsOpened: !mapIsOpened }));
|
||||
const buttonRef = React.createRef();
|
||||
|
||||
@@ -24,7 +25,7 @@ export default class OpenMapModalBtn extends React.Component {
|
||||
<FontAwesomeIcon icon={mapIcon} />
|
||||
</button>
|
||||
<UncontrolledTooltip placement="bottom" target={() => buttonRef.current}>Show in map</UncontrolledTooltip>
|
||||
<MapModal toggle={toggleMap} isOpen={this.state.mapIsOpened} title={title} />
|
||||
<MapModal toggle={toggleMap} isOpen={this.state.mapIsOpened} title={title} locations={locations} />
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user