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

Fix deprecated window property #49

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
"version": "0.2.1",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"@testing-library/jest-dom": "^6.1.3",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.5.0",
"html-to-image": "^1.11.11",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.10.0",
"react-router-dom": "^6.16.0",
"react-scripts": "^5.0.1",
"web-vitals": "^2.1.4"
"web-vitals": "^3.4.0"
},
"scripts": {
"start": "react-scripts start",
Expand Down Expand Up @@ -39,7 +39,7 @@
]
},
"devDependencies": {
"eslint": "^8.39.0",
"eslint-plugin-react": "^7.32.2"
"eslint": "^8.49.0",
"eslint-plugin-react": "^7.33.2"
}
}
8 changes: 4 additions & 4 deletions src/PhilippinesMapJSX.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ const PhilippinesMapJSX = ({
: event.target.getBoundingClientRect().x + 200 - window.innerWidth;
setSelectedProvinceIndex(event.target.getAttribute('index'));
setMenuPosition({
x: event.target.getBoundingClientRect().x + window.pageXOffset - offsetX,
y: event.target.getBoundingClientRect().y + window.pageYOffset - offsetY,
x: event.target.getBoundingClientRect().x + window.scrollX - offsetX,
y: event.target.getBoundingClientRect().y + window.scrollY - offsetY,
});
setMenuVisible(true);
};
Expand All @@ -45,8 +45,8 @@ const PhilippinesMapJSX = ({
const targetElement = event.target.parentNode;
const position = targetElement.getBoundingClientRect();
setTooltipPosition({
x: position.x + window.pageXOffset,
y: position.y + window.pageYOffset,
x: position.x + window.scrollX,
y: position.y + window.scrollY,
});
const tooltipContent = targetElement.getAttribute('id').replace(/_/g, ' ');
setTooltipContent(tooltipContent);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Map.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const PhilippinesMap = () => {
localStorage.setItem('provinceLevels', JSON.stringify(clonePrevLevels));

return clonePrevLevels;
});
});

setMenuVisible(false);
},
Expand Down