{
*/
const AccordionBlock = (
<>
-
+
-
+
) => {
return createSelector(
currentChallengeIdSelector,
@@ -129,6 +127,16 @@ const mapDispatchToProps = (dispatch: Dispatch) =>
},
dispatch
);
+const handleHashChange = () => {
+ const id = window.location.hash.replace('#', '');
+ if (id) {
+ scroller.scrollTo(id, {
+ smooth: true,
+ duration: 500,
+ offset: -50
+ });
+ }
+};
const SuperBlockIntroductionPage = (props: SuperBlockProps) => {
const { t } = useTranslation();
@@ -136,13 +144,10 @@ const SuperBlockIntroductionPage = (props: SuperBlockProps) => {
initializeExpandedState();
props.tryToShowDonationModal();
- setTimeout(() => {
- configureAnchors({ offset: -40, scrollDuration: 400 });
- }, 0);
+ handleHashChange();
- return () => {
- configureAnchors({ offset: -40, scrollDuration: 0 });
- };
+ window.addEventListener('hashchange', handleHashChange);
+ return () => window.removeEventListener('hashchange', handleHashChange);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
diff --git a/curriculum/i18n-curriculum b/curriculum/i18n-curriculum
deleted file mode 160000
index b8ee7a88d29..00000000000
--- a/curriculum/i18n-curriculum
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit b8ee7a88d29fc4757b946c83851ae017936bd142
diff --git a/package.json b/package.json
index 6ff1e93056e..d3be489df55 100644
--- a/package.json
+++ b/package.json
@@ -133,12 +133,6 @@
},
"packageManager": "pnpm@10.18.0",
"pnpm": {
- "peerDependencyRules": {
- "allowedVersions": {
- "react-scrollable-anchor>react": "17",
- "react-scrollable-anchor>react-dom": "17"
- }
- },
"onlyBuiltDependencies": [
"@freecodecamp/ui",
"@prisma/client",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 649e7065c95..03a1bebc2f5 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -510,9 +510,9 @@ importers:
react-responsive:
specifier: 9.0.2
version: 9.0.2(react@17.0.2)
- react-scrollable-anchor:
- specifier: 0.6.1
- version: 0.6.1(react-dom@17.0.2(react@17.0.2))(react@17.0.2)
+ react-scroll:
+ specifier: 1.9.0
+ version: 1.9.0(react-dom@17.0.2(react@17.0.2))(react@17.0.2)
react-spinkit:
specifier: 3.0.0
version: 3.0.0
@@ -628,9 +628,9 @@ importers:
'@types/react-responsive':
specifier: 8.0.8
version: 8.0.8
- '@types/react-scrollable-anchor':
- specifier: 0.6.4
- version: 0.6.4
+ '@types/react-scroll':
+ specifier: 1.8.10
+ version: 1.8.10
'@types/react-spinkit':
specifier: 3.0.10
version: 3.0.10
@@ -4745,8 +4745,8 @@ packages:
'@types/react-responsive@8.0.8':
resolution: {integrity: sha512-HDUZtoeFRHrShCGaND23HmXAB9evOOTjkghd2wAasLkuorYYitm5A1XLeKkhXKZppcMBxqB/8V4Snl6hRUTA8g==}
- '@types/react-scrollable-anchor@0.6.4':
- resolution: {integrity: sha512-Yn81DRAXPdOkqvDC6JO9KsTQv2g3bu45WGDfuI5G08vMntT7EvbBGrOeCuPkMQ8Q2JeZoP3TbKEMzLhJ8yAlGA==}
+ '@types/react-scroll@1.8.10':
+ resolution: {integrity: sha512-RD4Z7grbdNGOKwKnUBKar6zNxqaW3n8m9QSrfvljW+gmkj1GArb8AFBomVr6xMOgHPD3v1uV3BrIf01py57daQ==}
'@types/react-spinkit@3.0.10':
resolution: {integrity: sha512-grNfPdesm/xVJPyohfW752bM8N9kuJUx2yFo0I41mZwF3BuXt4+IV4TwaCPcBtA1V3C5r2NUPyqfEUpNTtWbvA==}
@@ -9508,9 +9508,6 @@ packages:
resolution: {integrity: sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==}
engines: {node: '>=4.0'}
- jump.js@1.0.1:
- resolution: {integrity: sha512-KXS4lfs3AcGdYl7cXk4X9mHb6PWIdrvBzGJs/QnG2g6niRoORkwisedbdjKu0VyUYmE2x7V+cV9ypSpaGRL0zg==}
-
just-curry-it@3.2.1:
resolution: {integrity: sha512-Q8206k8pTY7krW32cdmPsP+DqqLgWx/hYPSj9/+7SYqSqz7UuwPbfSe07lQtvuuaVyiSJveXk0E5RydOuWwsEg==}
@@ -11784,11 +11781,11 @@ packages:
peerDependencies:
react: '>=16.8'
- react-scrollable-anchor@0.6.1:
- resolution: {integrity: sha512-baaZKLXEmmaJzVXthx57K0jFgZjRiSEkhVTTssX03bzB097lIE1BYPVgtpgpAoETxTbiM+vDRJ2IPtClSQlj0A==}
+ react-scroll@1.9.0:
+ resolution: {integrity: sha512-mamNcaX9Ng+JeSbBu97nWwRhYvL2oba+xR2GxvyXsbDeGP+gkYIKZ+aDMMj/n20TbV9SCWm/H7nyuNTSiXA6yA==}
peerDependencies:
- react: ^15.3.0 || ^16.0.0
- react-dom: ^15.3.0 || ^16.0.0
+ react: ^15.5.4 || ^16.0.0 || ^17.0.0 || ^18.0.0
+ react-dom: ^15.5.4 || ^16.0.0 || ^17.0.0 || ^18.0.0
react-shallow-renderer@16.15.0:
resolution: {integrity: sha512-oScf2FqQ9LFVQgA73vr86xl2NaOIX73rh+YFqcOp68CWj56tSfgtGKrEbyhCj0rSijyG9M1CYprTh39fBi5hzA==}
@@ -19493,7 +19490,7 @@ snapshots:
dependencies:
'@types/react': 17.0.83
- '@types/react-scrollable-anchor@0.6.4':
+ '@types/react-scroll@1.8.10':
dependencies:
'@types/react': 17.0.83
@@ -25883,8 +25880,6 @@ snapshots:
object.assign: 4.1.5
object.values: 1.1.7
- jump.js@1.0.1: {}
-
just-curry-it@3.2.1: {}
jwa@1.4.1:
@@ -28658,9 +28653,9 @@ snapshots:
'@remix-run/router': 1.11.0
react: 17.0.2
- react-scrollable-anchor@0.6.1(react-dom@17.0.2(react@17.0.2))(react@17.0.2):
+ react-scroll@1.9.0(react-dom@17.0.2(react@17.0.2))(react@17.0.2):
dependencies:
- jump.js: 1.0.1
+ lodash.throttle: 4.1.1
prop-types: 15.8.1
react: 17.0.2
react-dom: 17.0.2(react@17.0.2)