-
Notifications
You must be signed in to change notification settings - Fork 29
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
refactor(lib-content): reduce home and about page load times #6255
Changes from 3 commits
18eef34
19c0f47
b062583
1b3ce14
cefe131
eca456e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ import styled from 'styled-components' | |
import { useContext } from 'react' | ||
|
||
import Stats from '../../../components/Stats/Stats.js' | ||
import { YouTubeEmbed } from '@next/third-parties/google' | ||
|
||
const VideoWrapper = styled(Box)` | ||
border-radius: 8px; // same as Stat component | ||
|
@@ -37,7 +38,7 @@ const Discovery = ({ href, src, labelString }) => ( | |
<Anchor href={href}> | ||
<Box width='8rem'> | ||
<CircleImage> | ||
<Image alt='' src={src} width='100%' height='100%' /> | ||
<Image alt='' loading='lazy' src={src} width='100%' height='100%' /> | ||
</CircleImage> | ||
<Text | ||
color={{ light: 'dark-5', dark: 'white' }} | ||
|
@@ -120,13 +121,11 @@ export default function OurMission() { | |
<Stats /> | ||
|
||
<VideoWrapper> | ||
<iframe | ||
width='100%' | ||
<YouTubeEmbed | ||
height='100%' | ||
src='https://www.youtube-nocookie.com/embed/F-B8gXJyMHc?si=YGd16vJFYOB-rfrI' | ||
title='YouTube video player' | ||
frameborder='0' | ||
allowfullscreen | ||
width='100%' | ||
videoid='F-B8gXJyMHc' | ||
title='A Brief Introduction to the Zooniverse' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This page has a translations dictionary. I'll add this string to it. |
||
/> | ||
</VideoWrapper> | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ import { useTranslation } from '../../../../translations/i18n.js' | |
|
||
import Stats from '../../../../components/Stats/Stats.js' | ||
import SubHeading from '../../../../components/HeadingForAboutNav/SubHeading.js' | ||
import { YouTubeEmbed } from '@next/third-parties/google' | ||
|
||
const StyledSignIn = styled(Button)` | ||
width: 47%; | ||
|
@@ -115,13 +116,11 @@ export default function Introduction() { | |
</SpacedHeading> | ||
<Stats /> | ||
<VideoWrapper> | ||
<iframe | ||
width='100%' | ||
<YouTubeEmbed | ||
height='100%' | ||
src='https://www.youtube-nocookie.com/embed/F-B8gXJyMHc?si=YGd16vJFYOB-rfrI' | ||
title='YouTube video player' | ||
frameBorder='0' | ||
allowFullScreen | ||
width='100%' | ||
videoid='F-B8gXJyMHc' | ||
title='A Brief Introduction to the Zooniverse' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here, I'll put this in the translations dictionary. |
||
/> | ||
</VideoWrapper> | ||
</> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import { Anchor, Box, Paragraph } from 'grommet' | ||
import { YouTubeEmbed } from '@next/third-parties/google' | ||
import { useTranslation } from '../../../../translations/i18n.js' | ||
import styled, { css } from 'styled-components' | ||
import { SpacedHeading } from '@zooniverse/react-components' | ||
|
@@ -62,9 +63,9 @@ const VideoWrapper = styled(Box)` | |
` | ||
|
||
const YOUTUBE_SOURCES = [ | ||
'https://www.youtube-nocookie.com/embed/CaTNIoJy4Dg?si=-rG8luvWD_FtFBc5', // PH TESS | ||
'https://www.youtube-nocookie.com/embed/8lZiZoBcMjE?si=wPKWlRjQcKeTIOB5', // Wildcam Gorongosa | ||
'https://www.youtube-nocookie.com/embed/B6diEbpEblQ?si=tt3jtcINdleiBT8g' // Backyard Worlds | ||
['CaTNIoJy4Dg', 'Around the Zoo – Planet Hunters TESS'], | ||
['8lZiZoBcMjE', 'Around the Zoo – Wildcam Gorongosa'], | ||
['B6diEbpEblQ', 'Around the Zoo – Backyard Worlds'], | ||
Comment on lines
+66
to
+68
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not going to include these in the translations dictionary because it's a uniquely named series with Zooniverse project titles. |
||
] | ||
|
||
export default function Researchers() { | ||
|
@@ -93,15 +94,13 @@ export default function Researchers() { | |
pad={{ horizontal: 'xxsmall', bottom: 'xsmall' }} | ||
overflow={{ horizontal: 'auto' }} | ||
> | ||
{YOUTUBE_SOURCES.map(src => ( | ||
<VideoWrapper key={src}> | ||
<iframe | ||
width='100%' | ||
{YOUTUBE_SOURCES.map(([id, title]) => ( | ||
<VideoWrapper key={id}> | ||
<YouTubeEmbed | ||
height='100%' | ||
src={src} | ||
title='TESS YouTube video player' | ||
frameBorder='0' | ||
allowFullScreen | ||
width='100%' | ||
videoid={id} | ||
title={title} | ||
/> | ||
</VideoWrapper> | ||
))} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2041,6 +2041,13 @@ | |
resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.2.7.tgz#75e1d90758cb10a547e1cdfb878871da28123682" | ||
integrity sha512-pxsI23gKWRt/SPHFkDEsP+w+Nd7gK37Hpv0ngc5HpWy2e7cKx9zR/+Q2ptAUqICNTecAaGWvmhway7pj/JLEWA== | ||
|
||
"@next/third-parties@~14.2.7": | ||
version "14.2.7" | ||
resolved "https://registry.yarnpkg.com/@next/third-parties/-/third-parties-14.2.7.tgz#542e354cb129e5a4751fa3c28f96d00515a4d3b8" | ||
integrity sha512-cE/1MAvmbKFZ9VCCj+Gvv21rMm/72JRTeLr24QEqCBNe17xuXyCzg9c7cRCXLdbk1VTBSALZCK9o13gbOvSMKA== | ||
dependencies: | ||
third-party-capital "1.0.20" | ||
|
||
"@nicolo-ribaudo/[email protected]": | ||
version "2.1.8-no-fsevents.3" | ||
resolved "https://registry.yarnpkg.com/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8-no-fsevents.3.tgz#323d72dd25103d0c4fbdce89dadf574a787b1f9b" | ||
|
@@ -16685,6 +16692,11 @@ then-request@^6.0.0: | |
promise "^8.0.0" | ||
qs "^6.4.0" | ||
|
||
[email protected]: | ||
version "1.0.20" | ||
resolved "https://registry.yarnpkg.com/third-party-capital/-/third-party-capital-1.0.20.tgz#e218a929a35bf4d2245da9addb8ab978d2f41685" | ||
integrity sha512-oB7yIimd8SuGptespDAZnNkzIz+NWaJCu2RMsbs4Wmp9zSDUM8Nhi3s2OOcqYuv3mN4hitXc8DVx+LyUmbUDiA== | ||
|
||
through2@^2.0.0, through2@^2.0.3: | ||
version "2.0.5" | ||
resolved "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not listed in Grommet's docs but does get passed on to the html element (loading) 👍