Skip to content
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

Adding Explain Like I'm 5 video to the home page #2971

Merged
merged 4 commits into from
Feb 24, 2022
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
16 changes: 8 additions & 8 deletions website/src/css/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -658,20 +658,20 @@ html[data-theme="dark"] .Section p a {
@extend %link-style-dark;
}

/* Talks */
/* VideoContent */

.Talks {
.VideoContent {
.twitter-follow-button {
margin-top: 1.5rem;
}
}

@media only screen and (max-width: 960px) {
.Talks .TwoColumns {
.VideoContent .TwoColumns {
grid-gap: 2rem;
}

.Talks .column.last {
.VideoContent .column.last {
width: 100%;
display: flex;
justify-content: center;
Expand All @@ -681,13 +681,13 @@ html[data-theme="dark"] .Section p a {
* If the full-width video won't fit, make it full-width.
* https://jameshfisher.com/2017/08/30/how-do-i-make-a-full-width-iframe/
*/
.Talks .vidWrapper {
.VideoContent .vidWrapper {
position: relative;
width: 100%;
padding-top: 56.25%;
}

.Talks iframe {
.VideoContent iframe {
position: absolute;
top: 0;
left: 0;
Expand All @@ -698,11 +698,11 @@ html[data-theme="dark"] .Section p a {

@media only screen and (min-width: 961px) {
/* Give more width for the video */
.Talks .TwoColumns {
.VideoContent .TwoColumns {
grid-template-columns: 1fr 2fr;
}

.Talks iframe {
.VideoContent iframe {
width: 560px;
height: 315px;
}
Expand Down
83 changes: 56 additions & 27 deletions website/src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,13 @@ function HomeCallToAction() {
);
}

function TwitterButton() {
function TwitterButton({accountName}) {
return (
<a
href="https://twitter.com/intent/follow?screen_name=reactnative&region=follow_link"
href={`https://twitter.com/intent/follow?screen_name=${accountName}&region=follow_link`}
className="twitter-follow-button">
<div className="icon" />
Follow @reactnative
Follow @{accountName}
</a>
);
}
Expand Down Expand Up @@ -245,7 +245,7 @@ function HeaderHero() {
return (
<Section background="dark" className="HeaderHero">
<div className="socialLinks">
<TwitterButton />
<TwitterButton accountName="reactnative" />
<GitHubStarButton />
</div>
<TwoColumns
Expand Down Expand Up @@ -365,30 +365,59 @@ function FastRefresh() {
);
}

function Talks() {
function VideoContent() {
return (
<Section className="Talks" background="tint">
<TwoColumns
columnOne={
<TextColumn
title="Talks"
text={textContent.talks}
moreContent={<TwitterButton />}
/>
}
columnTwo={
<div className="vidWrapper">
<iframe
src="https://www.youtube.com/embed/NCAY0HIfrwc"
title="Mobile Innovation with React Native, ComponentKit, and Litho"
frameBorder="0"
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
allowFullScreen
<div>
<Section className="VideoContent" background="tint">
<br />
<TwoColumns
columnOne={
<TextColumn
title="Talks and Videos"
text={textContent.talks}
moreContent={<TwitterButton accountName="reactnative" />}
/>
</div>
}
/>
</Section>
}
columnTwo={
<div className="vidWrapper">
<iframe
src="https://www.youtube.com/embed/NCAY0HIfrwc"
title="Mobile Innovation with React Native, ComponentKit, and Litho"
frameBorder="0"
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
allowFullScreen
/>
</div>
}
/>
<br />
<TwoColumns
columnOne={
<>
<p>
The{' '}
<a href="https://opensource.facebook.com/">
Meta Open Source team
</a>{' '}
has put together a short overview of React Native, where they
explained the project in beginner's terms.
</p>
</>
}
columnTwo={
<div className="vidWrapper">
<iframe
src="https://www.youtube.com/embed/wUDeLT6WXnQ"
title="Explain Like I'm 5: React Native"
frameBorder="0"
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
allowFullScreen
/>
</div>
}
/>
</Section>
</div>
);
}

Expand Down Expand Up @@ -542,7 +571,7 @@ const Index = () => {
<NativeDevelopment />
<CrossPlatform />
<FastRefresh />
<Talks />
<VideoContent />
<Community />
<GetStarted />
</Layout>
Expand Down