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

restoration id fixed #1147

Merged
merged 1 commit into from
Jul 18, 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
2 changes: 1 addition & 1 deletion src/components/map/controls/basemap-settings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import InfoHiRes from './info-hi-res.mdx';
export const BasemapSettings = ({ className }: { className?: string }) => {
return (
<Tooltip>
<TooltipTrigger>
<TooltipTrigger asChild>
<Dialog>
<DialogTrigger>
<div
Expand Down
2 changes: 1 addition & 1 deletion src/components/map/controls/share/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const Share = ({
<>
{!disabled && (
<Tooltip>
<TooltipTrigger>
<TooltipTrigger asChild>
<Dialog>
<DialogTrigger>
<div
Expand Down
2 changes: 1 addition & 1 deletion src/containers/datasets/customize-widgets-deck/widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const CustomizeWidgetsDeck = () => {
You are showing{' '}
<span className="notranslate font-bold">
<Dialog>
<DialogTrigger asChild>
<DialogTrigger>
<span className={`${WIDGET_SELECT_STYLES} print:border-hidden`}>
{filteredWidgetsToDisplay.length} of {widgets.length - 1}
<Icon
Expand Down
2 changes: 1 addition & 1 deletion src/containers/datasets/restoration-sites/widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const RestorationSitesWidget = () => {
'border-b-2 border-b-grey-50 pb-5': areFiltersSelected,
})}
>
<DialogTrigger>
<DialogTrigger asChild>
<button
className={cn({
'flex space-x-2 bg-brand-800 text-xs text-white': true,
Expand Down
12 changes: 11 additions & 1 deletion src/containers/map/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ const MapContainer = ({ mapId }: { mapId: string }) => {
const restorationData = evt?.features.find(
({ layer }) => layer.id === 'mangrove_restoration-layer'
);

const interactiveLayers = evt?.features.find(
({ layer }) =>
layer.id === 'country-boundaries-layer' ||
Expand Down Expand Up @@ -318,7 +319,16 @@ const MapContainer = ({ mapId }: { mapId: string }) => {
}

// *ON MOUSE LEAVE
if (!restorationData && loaded) {

if (!restorationData && loaded && hoveredStateId) {
map?.setFeatureState(
{
sourceLayer: 'MOW_Global_Mangrove_Restoration_202212',
source: 'mangrove_restoration',
id: hoveredStateId,
},
{ hover: false }
);
hoveredStateId = null;
}
if (isDrawingToolEnabled && !customGeojson) {
Expand Down
4 changes: 2 additions & 2 deletions src/containers/widgets/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ const WidgetsContainer: FC = () => {
tooltipPosition={{ top: -50, left: 0 }}
message="Triggers deck to configure widgets"
>
<DialogTrigger>
<DialogTrigger asChild>
<button
type="button"
data-testid="widgets-deck-trigger"
Expand Down Expand Up @@ -293,7 +293,7 @@ const WidgetsContainer: FC = () => {
tooltipPosition={{ top: -50, left: 0 }}
message="Triggers deck to configure widgets"
>
<DialogTrigger>
<DialogTrigger asChild>
<motion.div
initial="rest"
whileHover="hover"
Expand Down
Loading