Skip to content

Simplify the bilingual team member info update process #32

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

Merged
merged 8 commits into from
Sep 13, 2021
Prev Previous commit
Next Next commit
[UPD] improve ref update by checking for scrollY instead of fix time
  • Loading branch information
Carms Ng committed Sep 13, 2021
commit 331cc5b2f28bbf1c337524452db2845a693fd64b
10 changes: 7 additions & 3 deletions src/components/stacked-avatar.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,13 @@ export default function StackedAvatar({ sectionRefs, setTeamIndex, pausedRef })
const top = sectionRefs.current[2].offsetTop
// Navigate to the Team Section
window.scrollTo({ top, behavior: 'smooth' })
setTimeout(() => {
pausedRef.current = false
}, 1000);
// Un-pause observer effects when completed
const checkIfScrollCompleted = setInterval(() => {
if (window.scrollY === top) {
pausedRef.current = false;
clearInterval(checkIfScrollCompleted);
}
}, 25);
}

const members = content.nodes.map(member => member.en)
Expand Down