Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/components/CommentFormMap/CommentFormMap.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ class CommentFormMap extends React.Component {
url={this.props.mapTileUrl}
attribution='&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
/>
<FeatureGroup
>
<FeatureGroup>
{this.props.contents !== null && <div>{this.props.contents}</div>}
<EditControl
position='topleft'
Expand All @@ -76,7 +75,7 @@ class CommentFormMap extends React.Component {
circlemarker: false,
polyline: false,
polygon: allToolsEnabled,
rectangle: allToolsEnabled,
rectangle: allToolsEnabled ? { showArea: false } : false,
marker: {
icon: new Leaflet.Icon({
iconUrl: leafletMarkerIconUrl,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Hearing/Comment/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ const Comment = (props) => {
</div>
{data.geojson && (
<div className='hearing-comment__map'>
<Button onClick={toggleMap} className='hearing-comment__map-toggle' aria-expanded={state.displayMap}>
<Button onClick={toggleMap} className='hearing-comment__map-toggle' variant='supplementary' aria-expanded={state.displayMap}>
<FormattedMessage id='commentShowMap'>{(text) => text}</FormattedMessage>
</Button>
{state.displayMap && data.geojson && (
Expand Down
7 changes: 1 addition & 6 deletions src/components/Hearing/HearingMap.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@ import OverviewMap from '../OverviewMap';

const HearingMap = ({ hearing, ...props }) => (
<div className='hearing-map'>
<OverviewMap
hearings={[hearing]}
style={{ width: '100%', height: '100%' }}
hideIfEmpty
{...props}
/>
<OverviewMap hearings={[hearing]} style={{ width: '100%', height: '16rem' }} hideIfEmpty {...props} />
</div>
);

Expand Down
8 changes: 4 additions & 4 deletions src/components/OverviewMap.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,19 +184,19 @@ const OverviewMap = ({ mapElementLimit = 0, showOnCarousel = false, ...props })
* @returns {Bool}
*/
const shouldMapRender = () => (showOnCarousel ? dimensions.height && dimensions.width : true);
/* eslint-disable react-hooks/exhaustive-deps */

/* eslint-disable react-hooks/exhaustive-deps */
useEffect(() => {
getHearingMapContent(hearings);
handleUpdateMapDimensions(mapContainer);
// Add any other functions that should run on component mount or hearings change here
}, [hearings]);
}, [hearings]);

if (typeof window === 'undefined') return null;
if (!contents && props.hideIfEmpty) {
return null;
}

return (
shouldMapRender() && (
<MapContainer
Expand Down
2 changes: 1 addition & 1 deletion src/components/UserComment/UserComment.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import FormatRelativeTime from '../../utils/FormatRelativeTime';


const UserComment = (props) => {

const [displayMap, setDisplayMap] = useState(false);
const { comment, locale } = props;
const { hearing_data: data } = comment;
Expand Down
1 change: 1 addition & 0 deletions src/components/admin/HearingFormStep3.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ const HearingFormStep3 = (props) => {
circle: false,
circlemarker: false,
polyline: false,
rectangle: { showArea: false },
marker: {
icon: new Leaflet.Icon({
iconUrl: leafletMarkerIconUrl,
Expand Down
Loading