Skip to content

Commit

Permalink
fix: ensure all maps are referencing same container (#3199)
Browse files Browse the repository at this point in the history
  • Loading branch information
jessicamcinchak authored May 28, 2024
1 parent c7531a8 commit ad48c21
Showing 1 changed file with 7 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import React from "react";
import type { SiteAddress } from "../FindProperty/model";
import { FETCH_BLPU_CODES } from "../FindProperty/Public";
import { ErrorSummaryContainer } from "../shared/Preview/ErrorSummaryContainer";
import { MapContainer } from "../shared/Preview/MapContainer";
import type { PropertyInformation } from "./model";

export default Component;
Expand Down Expand Up @@ -79,16 +80,6 @@ export interface PresentationalProps {
handleSubmit?: handleSubmit;
}

const MapContainer = styled(Box)(({ theme }) => ({
padding: theme.spacing(1, 0),
width: "100%",
maxWidth: "none",
"& my-map": {
width: "100%",
height: "60vh",
},
}));

// Export this component for testing visual presentation with mocked props
export function Presentational(props: PresentationalProps) {
const {
Expand All @@ -103,7 +94,11 @@ export function Presentational(props: PresentationalProps) {
overrideAnswer,
handleSubmit,
} = props;
const teamName = useStore((state) => state.teamName);
const [teamName, environment] = useStore((state) => [
state.teamName,
state.previewEnvironment,
]);

const propertyDetails: PropertyDetail[] = [
{
heading: "Address",
Expand Down Expand Up @@ -131,7 +126,7 @@ export function Presentational(props: PresentationalProps) {
return (
<Card handleSubmit={handleSubmit}>
<CardHeader title={title} description={description} />
<MapContainer>
<MapContainer environment={environment}>
<p style={visuallyHidden}>
A static map centred on the property address, showing the title
boundary, often called the "blue-line" boundary in planning, of your
Expand Down

0 comments on commit ad48c21

Please sign in to comment.