Skip to content

Commit

Permalink
refactor: delete unused scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
jsapro committed Jan 7, 2024
1 parent a28a992 commit 9436233
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 10 deletions.
2 changes: 0 additions & 2 deletions src/pages/catalog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ const Catalog: React.FC = () => {
.finally(() => {
setIsLoading(false);
});

window.scrollTo(0, 0);
}, []);

return (
Expand Down
4 changes: 0 additions & 4 deletions src/pages/category/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ const Category: React.FC = () => {
});
}, [category, navigate]);

useEffect(() => {
window.scrollTo(0, 0);
}, []);

const changeCheckboxState = (e: ChangeEvent<HTMLInputElement>) => {
if (e.target.name === 'vegetarian') {
setCheckboxState((prev) => ({ ...prev, vegetarian: !prev.vegetarian }));
Expand Down
4 changes: 0 additions & 4 deletions src/pages/product/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,6 @@ const Product: React.FC = () => {
}
}, [cartData, id]);

useEffect(() => {
window.scrollTo(0, 0);
}, []);

const handleAddCartClick = () => {
if (isLoaded || !productItem) return;
if (id !== undefined) {
Expand Down

0 comments on commit 9436233

Please sign in to comment.