Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

Port over homepage #144

Merged
merged 20 commits into from
May 10, 2022
Merged

Port over homepage #144

merged 20 commits into from
May 10, 2022

Conversation

bretthayes
Copy link
Contributor

Ports over the homepage:

Test

  • linting, dev, and build (everything else is a straight port)

@bretthayes bretthayes added the team/content-platform Content Platform Team related tickets. label May 6, 2022
@bretthayes bretthayes added this to the AR - Sprint 3 milestone May 6, 2022
@bretthayes bretthayes requested review from st0nebreaker and zlonko May 6, 2022 18:58
@bretthayes bretthayes self-assigned this May 6, 2022
Copy link
Contributor

@st0nebreaker st0nebreaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! I didn't catch any issues

src/pages/index.tsx Show resolved Hide resolved
src/styles/pages/_index.scss Show resolved Hide resolved
Comment on lines +110 to +139
useEffect(() => {
const videos = features.map(
(vid, index): VideoElement => ({
el: document.querySelector(`.video-${index}`),
paused: true,
})
)

if (window.IntersectionObserver) {
for (const vid of videos) {
const observer = new IntersectionObserver(
entries => {
const currentVideo = entries[0]

if (!currentVideo.isIntersecting && !vid.paused) {
vid?.el?.pause()
vid.paused = true
} else if (vid.paused) {
vid?.el?.play()
vid.paused = false
}
},
{ threshold: 1 }
)

// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
observer.observe(vid.el!)
}
}
}, [])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is sweet! I haven't programmatically manipulated videos yet 🤓

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seconding @st0nebraker here. It'll be awesome to learn more about how this works!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks y'all! This was quite an interesting solution! We can chat about it sometime 🤓

Copy link
Contributor

@zlonko zlonko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's awesome to see the homepage finally on the Replatform! Thank you for going above and beyond with improvements to style, tracking, implementation across the repo, etc. This looks great!

Comment on lines +20 to +21
const image =
post.frontmatter.socialImage ?? 'https://about.sourcegraph.com/meta/sourcegraph-social-image-share-02.png'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did this happen to occur with Prettier? I saw a similar change today when I ran the script. I am not sure this is necessary. Perhaps let's update this rule when we revisit the Prettier cookbook?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, prettier likes to wrap things to new lines if they're too long. It's great for some things, but in this case it's kind-of weird eh? We can look into updating our prettier settings soon!

buttonLocation,
} from '@components'
import { ContentSection, BlockquoteWithBorder, IntegrationsSection, Layout, SelfHostedSection } from '@components'
import { buttonStyle, buttonLocation } from '@data'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very much appreciate how you gave button tracking its own new home!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Tim! I anticipate we'll probably add a few more things in this directory in the future. Excited to organize some more things soon too! ✨

Comment on lines +110 to +139
useEffect(() => {
const videos = features.map(
(vid, index): VideoElement => ({
el: document.querySelector(`.video-${index}`),
paused: true,
})
)

if (window.IntersectionObserver) {
for (const vid of videos) {
const observer = new IntersectionObserver(
entries => {
const currentVideo = entries[0]

if (!currentVideo.isIntersecting && !vid.paused) {
vid?.el?.pause()
vid.paused = true
} else if (vid.paused) {
vid?.el?.play()
vid.paused = false
}
},
{ threshold: 1 }
)

// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
observer.observe(vid.el!)
}
}
}, [])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seconding @st0nebraker here. It'll be awesome to learn more about how this works!

@zlonko zlonko mentioned this pull request May 10, 2022
@bretthayes bretthayes merged commit 0f83aac into main May 10, 2022
@bretthayes bretthayes deleted the brett/homepage branch May 10, 2022 16:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
team/content-platform Content Platform Team related tickets.
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Port over homepage Add new customer logos section when homepage updates are finalized
3 participants