Skip to content

Commit 1502934

Browse files
author
Ives van Hoorne
committed
Fix scroll jumping
1 parent 67ea602 commit 1502934

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

packages/homepage/src/components/Footer.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,17 @@ const Background = styled.div`
6767
z-index: 100;
6868
`;
6969

70+
const BasComponent = () => (
71+
<a
72+
id="bas"
73+
href="https://www.linkedin.com/in/basbuursma/"
74+
target="_blank"
75+
rel="noopener noreferrer"
76+
>
77+
Bas Buursma
78+
</a>
79+
);
80+
7081
export default () => (
7182
<Background id="footer">
7283
<MaxWidth width={1280}>
@@ -151,16 +162,7 @@ export default () => (
151162
</Container>
152163

153164
<Authors>
154-
By{' '}
155-
<a
156-
id="bas"
157-
href="https://www.linkedin.com/in/basbuursma/"
158-
target="_blank"
159-
rel="noopener noreferrer"
160-
>
161-
Bas Buursma
162-
</a>{' '}
163-
and{' '}
165+
By <BasComponent /> and{' '}
164166
<a
165167
id="ives"
166168
href="https://twitter.com/CompuIves"

packages/homepage/src/components/StickyNavigation.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,11 @@ export default class StickyNavigation extends React.PureComponent<Props> {
106106
};
107107

108108
componentDidMount() {
109-
window.addEventListener('scroll', this.handleScroll);
109+
// To prevent jumping
110+
setTimeout(() => {
111+
window.addEventListener('scroll', this.handleScroll);
112+
this.handleScroll();
113+
}, 500);
110114
const { y } = getScrollPos(Date.now(), false);
111115

112116
const { top, height } = document

0 commit comments

Comments
 (0)