-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AKR:OTR:VKT:YKI:SHARED(Frontend) OPHAKRKEH-515 jest migration test fixes
- Loading branch information
Showing
14 changed files
with
312 additions
and
317 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,6 @@ | |
"akr:tslint": "yarn g:tsc --pretty --noEmit" | ||
}, | ||
"dependencies": { | ||
"shared": "npm:@opetushallitus/[email protected].31" | ||
"shared": "npm:@opetushallitus/[email protected].32" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,6 @@ | |
"otr:tslint": "yarn g:tsc --pretty --noEmit" | ||
}, | ||
"dependencies": { | ||
"shared": "npm:@opetushallitus/[email protected].31" | ||
"shared": "npm:@opetushallitus/[email protected].32" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 6 additions & 14 deletions
20
frontend/packages/shared/src/components/ScrollToTop/ScrollToTop.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,12 @@ | ||
import { History } from 'history'; | ||
import { useContext, useLayoutEffect } from 'react'; | ||
import { UNSAFE_NavigationContext } from 'react-router-dom'; | ||
import { useLayoutEffect } from 'react'; | ||
import { useLocation } from 'react-router-dom'; | ||
|
||
export const ScrollToTop = () => { | ||
// FIXME: UNSAFE_NavigationContext is no longer allowed in react router 6 | ||
/* | ||
const navigator = useContext(UNSAFE_NavigationContext).navigator as History; | ||
const location = useLocation(); | ||
|
||
useLayoutEffect(() => { | ||
const unlisten = navigator.listen(({ action }) => { | ||
if (action !== 'POP') { | ||
window.scrollTo({ left: 0, top: 0 }); | ||
} | ||
}); | ||
window.scrollTo({ left: 0, top: 0 }); | ||
}, [location]); | ||
|
||
return unlisten; | ||
}, [navigator]); | ||
*/ | ||
return null; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,6 @@ | |
}, | ||
"dependencies": { | ||
"reduxjs-toolkit-persist": "^7.2.1", | ||
"shared": "npm:@opetushallitus/[email protected].31" | ||
"shared": "npm:@opetushallitus/[email protected].32" | ||
} | ||
} |
Oops, something went wrong.