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

[FE](feat): add close btns to map pop ups[GMW-758] #1025

Merged
merged 2 commits into from
Jan 15, 2024
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
9 changes: 9 additions & 0 deletions src/containers/map/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import Legend from 'containers/map/legend';
import MobileLegend from 'containers/map/mobile/legend';
import RestorationPopup from 'containers/map/restoration-popup';

import Icon from 'components/icon';
import Map from 'components/map';
import Controls from 'components/map/controls';
import BasemapSettingsControl from 'components/map/controls/basemap-settings';
Expand All @@ -51,6 +52,8 @@ import Popup from 'components/popup';
import { breakpoints } from 'styles/styles.config';
import type { RestorationPopUp, PopUpKey, LocationPopUp } from 'types/map';

import CLOSE_SVG from 'svgs/ui/close.svg?sprite';

import LayerManager from './layer-manager';
import LocationPopup from './location-pop-up';

Expand Down Expand Up @@ -379,6 +382,12 @@ const MapContainer = ({ mapId }: { mapId: string }) => {
latitude={locationPopUp?.popup[0]}
onClose={() => removePopup('location')}
>
<button
className="absolute -right-9 top-8 -right-[40px] h-11 w-10 cursor-pointer items-center justify-end rounded-r-[20px] bg-white/70 backdrop-blur-sm focus:outline-none focus:ring-2 focus:ring-slate-400 focus:ring-offset-2"
onClick={() => removePopup('location')}
>
<Icon icon={CLOSE_SVG} className="ml-1 h-6 w-6" description="Close" />
</button>
{!isEmpty(locationPopUp?.info) ? (
<LocationPopup
locationPopUpInfo={locationPopUp}
Expand Down
5 changes: 5 additions & 0 deletions src/containers/map/location-pop-up/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,24 @@ import { useRecoilState } from 'recoil';

import { useLocations } from 'containers/datasets/locations/hooks';

import Icon from 'components/icon';
import { WIDGET_SUBTITLE_STYLE } from 'styles/widgets';
import type { LocationPopUp } from 'types/map';

import CLOSE_SVG from 'svgs/ui/close.svg?sprite';

const LocationPopUP = ({
locationPopUpInfo,
nonExpansible,

className,
}: {
locationPopUpInfo: {
info: LocationPopUp;
feature: MapboxGeoJSONFeature;
};
nonExpansible: boolean;

className?: string;
}) => {
const [open, setOpen] = useState(nonExpansible);
Expand Down
Loading