Skip to content

Commit

Permalink
addition of the videos page
Browse files Browse the repository at this point in the history
with cards inside.
  • Loading branch information
Kiki Saintonge committed Apr 24, 2020
1 parent a608077 commit fa9677c
Show file tree
Hide file tree
Showing 6 changed files with 173 additions and 17 deletions.
4 changes: 2 additions & 2 deletions website/pages/en/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,8 @@ class Index extends React.Component {
<Section background="tint">
<div className="CenterContent" style={{marginTop: -50}}>
<div>
<h1 style={{textAlign: 'center', color: '#0e53bd'}}>Take Your App Further</h1>
<p style={{textAlign: 'center', marginTop: -10}}>Build on the basics to construct your first React Native app</p>
<a href="videos"><h1 style={{textAlign: 'center', color: '#0e53bd'}}>Take Your App Further</h1></a>
<p style={{textAlign: 'center', marginTop: -10}}>Build on the basics to constructing your first React Native for Windows + Mac app</p>

<div className="row">
<div className="column">
Expand Down
13 changes: 2 additions & 11 deletions website/pages/en/versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ const textContent = {
Once the release has had significant time to be tested and contributers have addressed as many issues as possible, the release will be upgraded to a **Stable version** and become present in the corosponding section below.
`,
latestverison: `
The latest and greatest, bleeding edge version release of React Native for Windows will be listed and updated here.
`,
stablelegacyversions: `
The most recent and stable version will be used automatically when the
*npx react-native-windows-init*
Expand Down Expand Up @@ -74,15 +71,9 @@ class Versions extends React.Component {
const VersioningInformation = () => (
<Section background="light">
<div className="content">
<h1 style={{fontSize: '60px', marginTop: '-20px', fontWeight: 'bold'}}>React Native for Windows Versions </h1>
<h1 style={{fontSize: '60px', marginTop: '-20px', fontWeight: 'bold'}}>Versions </h1>
<MarkdownBlock>{textContent.introtext}</MarkdownBlock>
<h1 style={{fontWeight: 'bold'}}>Latest version</h1>
<MarkdownBlock>{textContent.latestverison}</MarkdownBlock>
<TableRow versionNumber="MASTER"
docLink={docsUrl + 'docs/next/getting-started'}
changeLogLink={repoUrl + '/compare/' + currentVersion + '-stable...master'}
changeLogText={'Commits since ' + currentVersion}/>
<h1 style={{fontWeight: 'bold'}}>Stable versions</h1>
<h1 style={{fontWeight: 'bold'}}>Version History</h1>
<MarkdownBlock>{textContent.stablelegacyversions}</MarkdownBlock>
{stableVersions.map(function(version) {
return (
Expand Down
158 changes: 158 additions & 0 deletions website/pages/en/videos.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/

const React = require("react");
const CompLibrary = require("../../core/CompLibrary.js");
const MarkdownBlock = CompLibrary.MarkdownBlock; /* Used to read markdown */

const CWD = process.cwd();
const siteConfig = require(CWD + '/siteConfig.js');
const versions = require(CWD + '/versions.json');

const docsUrl = siteConfig.url + siteConfig.baseUrl;
const repoUrl = siteConfig.repoUrl;

const textContent = {
introtext: `
Markdown text for video page.
`,
};

class Videos extends React.Component {
render() {

let currentVersion = versions.length > 0 ? versions[0] : null;
let latestVersions = ['next'].concat(
versions.filter(version => version.indexOf('-RC') !== -1)
);
const stableVersions = versions.filter(
version => version.indexOf('-RC') === -1
);

const { config: siteConfig, language = "" } = this.props;
const { baseUrl } = siteConfig;

const VideoCardItem = ({ videolength, videotitle, videotype, videodifficulty, speakername, imgurl, videodisc}) => (

<div className="videocard">
<div style={{position: 'relative'}}>
<div style={{maxWidth: '100%', maxHeight: '100%'}}>
<img src={imgurl} alt="videoimg"/>
</div>
<div className="videocardlengthtip">
<div>
<div className="videocardtipbackground">
<div>
<img src="./img/homepage/timeicon.png" alt="timeicon"/>
</div>
<div>
<p style={{color: '#fff', marginLeft: 8, marginTop: 4, fontSize: 14}}>{videolength}</p>
</div>
</div>
</div>
</div>
</div>
<div className="videocardcontent">
<div className="videocardheader">
<p style={{fontsize: 46, fontWeight: 700}}>{videotitle}</p>
<div className="videocardinfo">
<p style={{fontSize: 14}}>{videotype}</p>
<div className="subtitledot"/>
<p style={{fontSize: 14}}>{videodifficulty}</p>
<div>{videodisc}</div>
</div>
</div>
<div className="videocarddriverinfo" style={{color: '#0e53bd'}}>
<a href={"https://twitter.com/" + speakername}>
<div className="row" style={{marginTop: 20}}>
<div style={{display: 'inline-block'}}>
<img style={{borderRadius: '50%', width: '32px', height: '32px'}} src={"https://avatars.io/twitter/" + speakername} alt="speakericon"/>
</div>
<div style={{display: 'inline-block', marginLeft: 5}}>
<div>@{speakername}</div>
</div>
</div>

</a>
</div>
</div>
</div>
);

const Section = ({ children, className, background = "light" }) => (
<section className={`Section ${className} ${background}`}>
{children}
</section>
);

const VideoCardList = () => (
<Section background="tint">
<div className="content">
<MarkdownBlock>{textContent.introtext}</MarkdownBlock>
<div className="row">
<div className="column">
<VideoCardItem
videolength="10 mins"
videotitle="Community Modules for Mac"
videotype="Walkthrough"
videodifficulty="Beginner"
speakername="alloy"
imgurl="./img/homepage/eloy_rn4m_preview.png"
videodisc="Set up your Mac environment to build React Native for MacOS apps, as well as how to install community modules."/>
</div>
<div className="column">
<VideoCardItem
videolength="0 mins"
videotitle="Example Card"
videotype="Type of Video"
videodifficulty="Difficulty"
speakername="reactwindows"
imgurl="./img/homepage/video_learning_image-small.png"
videodisc="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."/>
</div>
<div className="column">
<VideoCardItem
videolength="0 mins"
videotitle="Example Card"
videotype="Type of Video"
videodifficulty="Difficulty"
speakername="reactwindows"
imgurl="./img/homepage/video_learning_image-small.png"
videodisc="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."/>
</div>
<div className="column">
<VideoCardItem
videolength="0 mins"
videotitle="Example Card"
videotype="Type of Video"
videodifficulty="Difficulty"
speakername="reactwindows"
imgurl="./img/homepage/video_learning_image-small.png"
videodisc="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."/>
</div>
<div className="column">
<VideoCardItem
videolength="0 mins"
videotitle="Example Card"
videotype="Type of Video"
videodifficulty="Difficulty"
speakername="reactwindows"
imgurl="./img/homepage/video_learning_image-small.png"
videodisc="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."/>
</div>
</div>
</div>
</Section>
);

return (
<div className="homepage">
<VideoCardList />
</div>
);
}
}

module.exports = Videos;
4 changes: 2 additions & 2 deletions website/siteConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ const siteConfig = {
{ doc: "getting-started", label: "Docs" },
{ doc: "flyout-component", label: "APIs" },
{ blog: true, label: "Blog" },
{ href: "https://microsoft.github.io/react-native-windows/", label: "Videos" },
{ href: repoUrl + "-samples/tree/master/samples", label: "Samples" },
{ page: "videos", label: "Videos" },
{ href: repoUrl + "-samples/tree/master/samples", label: "Samples" },
// { search: true }, https://community.algolia.com/docsearch/what-is-docsearch.html
{ href: repoUrl, label: "GitHub" }
],
Expand Down
1 change: 1 addition & 0 deletions website/static/css/header.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
text-decoration: none;
font-weight: 400;
transition: color 0.15s ease-out;
color: black;
}

.fixedHeaderContainer header h3:hover {
Expand Down
10 changes: 8 additions & 2 deletions website/static/css/homepage/HeaderHero.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
display: flex;
-ms-flex-direction: column;
flex-direction: column;
width: 390px;
max-width: 390px;
}

.videocardcontent {
Expand All @@ -47,7 +47,7 @@
-ms-flex-direction: column;
flex-direction: column;
padding: 20px 30px 32px;
height: 140px;
min-height: 140px;
}

.videocardlengthtip {
Expand Down Expand Up @@ -112,6 +112,12 @@
clear: both;
}

@media screen and (max-width: 1024px) {
.yourClass {
display: none !important;
}
}

.HeaderHero .title {
font-size: 36px;
color: $brand;
Expand Down

0 comments on commit fa9677c

Please sign in to comment.