Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"gatsby-source-contentful": "^2.0.1",
"gatsby-source-filesystem": "^2.0.16",
"gatsby-transformer-remark": "^2.1.5",
"intersection-observer": "^0.5.1",
"prismjs": "^1.15.0",
"react": "^16.8.0",
"react-dom": "^16.8.0",
Expand All @@ -51,7 +52,7 @@
"testUpdate": "yarn format-check && yarn tslint && yarn jestUpdate",
"test-ci": "yarn test --coverage && codecov",
"tslint": "tslint --project ./tsconfig.json",
"serve": "yarn run build && clear && gatsby serve"
"serve": "yarn build && clear && gatsby serve"
},
"devDependencies": {
"@babel/core": "^7.3.3",
Expand Down
7 changes: 5 additions & 2 deletions src/components/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ const Layout = ({ children, title, description, img }: Props) => {
if ('IntersectionObserver' in window) {
setupObserver();
} else {
// Fallback for browsers without IntersectionObserver support
magicHeroNumber();
// Use polyfill for browsers without IntersectionObserver support
import('intersection-observer')
.then(setupObserver)
// Fallback for browsers without IntersectionObserver support
Comment thread
BeniCheni marked this conversation as resolved.
.catch(magicHeroNumber);
}
});

Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6480,6 +6480,11 @@ internal-ip@^3.0.1:
default-gateway "^2.6.0"
ipaddr.js "^1.5.2"

intersection-observer@^0.5.1:
version "0.5.1"
resolved "https://registry.yarnpkg.com/intersection-observer/-/intersection-observer-0.5.1.tgz#e340fc56ce74290fe2b2394d1ce88c4353ac6dfa"
integrity sha512-Zd7Plneq82kiXFixs7bX62YnuZ0BMRci9br7io88LwDyF3V43cQMI+G5IiTlTNTt+LsDUppl19J/M2Fp9UkH6g==

into-stream@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/into-stream/-/into-stream-3.1.0.tgz#96fb0a936c12babd6ff1752a17d05616abd094c6"
Expand Down