Skip to content

Commit

Permalink
learnreact.com: add layout links and copyright
Browse files Browse the repository at this point in the history
  • Loading branch information
chantastic committed Jan 28, 2020
1 parent 1e15a18 commit f25fa96
Show file tree
Hide file tree
Showing 33 changed files with 228 additions and 135 deletions.
16 changes: 16 additions & 0 deletions learnreact.com/components/layout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export default function({ children, ...props }) {
return (
<div>
<main {...props} style={{ maxWidth: "32em" }}>
<p>
<strong>
<a href="/">Learn React</a>
</strong>
</p>

{children}
</main>
<footer>&copy; {new Date().getFullYear()} Michael Chan</footer>
</div>
);
}
52 changes: 31 additions & 21 deletions learnreact.com/pages/courses/2014-react-basics.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
import Layout from "../../components/layout";

<Layout>
<Head>
<title>Learn React | React Basics (2014)</title>
</Head>

# React Basics (2014)

(out of date) React Basics for v0.12

## Lessons

<Index />
</Layout>

export const lessons = [
{
Expand Down Expand Up @@ -36,27 +44,29 @@ export const lessons = [

export function Lesson({ title, course, videoEmbed, ...props }) {
return (
<article {...props}>
<Head>
<title>
Learn React | {course} > {title}
</title>
</Head>
<h2>
<a href="/courses/2014-react-basics">{course}</a>
</h2>
<h1>{title}</h1>
<iframe
width="560"
height="315"
frameBorder="0"
allow="autoplay; encrypted-media"
allowFullScreen
src={videoEmbed}
{...props}
></iframe>
<Index />
</article>
<Layout>
<article {...props}>
<Head>
<title>
Learn React | {course} > {title}
</title>
</Head>
<h2>
<a href="/courses/2014-react-basics">{course}</a>
</h2>
<h3>{title}</h3>
<iframe
width="560"
height="315"
frameBorder="0"
allow="autoplay; encrypted-media"
allowFullScreen
src={videoEmbed}
{...props}
></iframe>
<Index />
</article>
</Layout>
);
}

Expand Down
56 changes: 33 additions & 23 deletions learnreact.com/pages/courses/2018-essential-npm.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
import Layout from "../../components/layout";

<Layout>
<Head>
<title>Learn React | Essential NPM</title>
</Head>

# Essential NPM

Are you an NPM button masher? Do lack confidence when adding, updating, are removing dependencies? Are you worried you might change a dependency only to break your site? Essential NPM is for you. In it are the secrets of the NPM command line utility for application developers. In a few short lessons you'll gain total confidence in managing your dependencies with NPM

## Lessons:

<Index />
</Layout>


export const lessons = [
{
Expand Down Expand Up @@ -87,31 +96,32 @@ export const lessons = [
videoEmbed: "https://www.youtube.com/embed/AhfXHzTCmTU",
uri: "/lessons/2018-essential-npm-16-summary"
}
];
].map(lesson => ({ ...lesson, course: "Essential NPM"}));

export function Lesson({ title, course, videoEmbed, ...props }) {
export function Lesson({ title, course, videoEmbed }) {
return (
<article {...props}>
<Head>
<title>
Learn React | {course} > {title}
</title>
</Head>
<h2>
<a href="/courses/2018-essential-npm">{course}</a>
</h2>
<h1>{title}</h1>
<iframe
width="560"
height="315"
frameBorder="0"
allow="autoplay; encrypted-media"
allowFullScreen
src={videoEmbed}
{...props}
></iframe>
<Index />
</article>
<Layout>
<article>
<Head>
<title>
Learn React | {course} > {title}
</title>
</Head>
<h2>
<a href="/courses/2018-essential-npm">{course}</a>
</h2>
<h3>{title}</h3>
<iframe
width="560"
height="315"
frameBorder="0"
allow="autoplay; encrypted-media"
allowFullScreen
src={videoEmbed}
></iframe>
<Index />
</article>
</Layout>
);
}

Expand Down
11 changes: 9 additions & 2 deletions learnreact.com/pages/courses/2018-essential-react.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
# Essential React
import Layout from "../../components/layout"

<Layout>
<Head>
<title>Learn React | Essential React</title>
</Head>

# Essential React
Learn Essential React—the kind that makes you money. If you want to sound smart buzz-wordy at your next meet up, move along. This course is for doers. It moves fast from "Hello World" to advanced component composition, serving as a good overview of the best parts of React. Learn Essential React and start shipping code today!

## Lessons:

<Index />
</Layout>

export const lessons = [
{
Expand Down Expand Up @@ -147,7 +154,7 @@ export function Lesson({ title, course, videoEmbed }) {
<h2>
<a href="/courses/2018-essential-npm">{course}</a>
</h2>
<h1>{title}</h1>
<h3>{title}</h3>
<iframe
width="560"
height="315"
Expand Down
33 changes: 22 additions & 11 deletions learnreact.com/pages/courses/2018-the-context-api.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
import Layout from "../../components/layout"

<Layout>
<Head>
<title>Learn React: The Context API</title>
</Head>

# The Context API

Want to join the ranks of open source projects like Redux, React Router, and Styled Components? You need to learn Context. Context is an API that allows you to distribute data to every component in a component tree without drilling prop-holes. This course is an in-depth look at the Context API, new in 16.3. It covers the the part system: Create, Consumer, and Provide. And explores the ergonomics of working with Context in your apps and components.
Expand All @@ -6,6 +13,8 @@ Want to join the ranks of open source projects like Redux, React Router, and Sty

<Index />

</Layout>

export const lessons = [
{
title: "Overview",
Expand Down Expand Up @@ -68,7 +77,7 @@ export const lessons = [

export function Lesson({ title, course, videoEmbed }) {
return (
<>
<Layout>
<Head>
<title>
Learn React | {course} > {title}
Expand All @@ -77,17 +86,19 @@ export function Lesson({ title, course, videoEmbed }) {
<h2>
<a href="/courses/2018-the-context-api">{course}</a>
</h2>
<h1>{title}</h1>
<iframe
width="560"
height="315"
frameBorder="0"
allow="autoplay; encrypted-media"
allowFullScreen
src={videoEmbed}
></iframe>
<article>
<h1>{title}</h1>
<iframe
width="560"
height="315"
frameBorder="0"
allow="autoplay; encrypted-media"
allowFullScreen
src={videoEmbed}
></iframe>
</article>
<Index />
</>
</Layout>
);
}

Expand Down
48 changes: 27 additions & 21 deletions learnreact.com/pages/courses/function-components.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import Layout from "../../components/layout";

<Layout>
<Head>
<title>Learn React | Function Components</title>
</Head>
Expand All @@ -9,6 +12,7 @@ Function components are the simplest way to write components in React. They don'
## Lessons:

<Index />
</Layout>

export const lessons = [
{
Expand Down Expand Up @@ -67,27 +71,29 @@ export const lessons = [

export function Lesson({ title, course, videoEmbed, ...props }) {
return (
<article {...props}>
<Head>
<title>
Learn React | {course} > {title}
</title>
</Head>
<h2>
<a href="/courses/function-components">{course}</a>
</h2>
<h1>{title}</h1>
<iframe
width="560"
height="315"
frameborder="0"
allow="autoplay; encrypted-media"
allowfullscreen
src={videoEmbed}
{...props}
></iframe>
<Index />
</article>
<Layout>
<article {...props}>
<Head>
<title>
Learn React | {course} > {title}
</title>
</Head>
<h2>
<a href="/courses/function-components">{course}</a>
</h2>
<h3>{title}</h3>
<iframe
width="560"
height="315"
frameborder="0"
allow="autoplay; encrypted-media"
allowfullscreen
src={videoEmbed}
{...props}
></iframe>
<Index />
</article>
</Layout>
);
}

Expand Down
15 changes: 11 additions & 4 deletions learnreact.com/pages/courses/style-with-components.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
# Style with Components
import Layout from "../../components/layout";

<Layout>
<Head>
<title>Learn React | Style with Components</title>
</Head>

# Style with Components
Learn to compose React components for styling. Whether you prefer CSS, inline-styles, or a CSS-in-JS solution, you can use style components to keep your codebase clean and maintainable.

## Lessons:

<Index />
</Layout>

export const lessons = [
{
Expand Down Expand Up @@ -52,7 +59,7 @@ export const lessons = [

export function Lesson({ title, course, videoEmbed }) {
return (
<>
<Layout>
<Head>
<title>
Learn React | {course} > {title}
Expand All @@ -61,7 +68,7 @@ export function Lesson({ title, course, videoEmbed }) {
<h2>
<a href="/courses/2018-the-context-api">{course}</a>
</h2>
<h1>{title}</h1>
<h3>{title}</h3>
<iframe
width="560"
height="315"
Expand All @@ -71,7 +78,7 @@ export function Lesson({ title, course, videoEmbed }) {
src={videoEmbed}
></iframe>
<Index />
</>
</Layout>
);
}

Expand Down
7 changes: 4 additions & 3 deletions learnreact.com/pages/index.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import Courses from "./courses/index.md"
import Layout from "../components/layout"
import Courses from "./courses/index.mdx"

<>
<Layout>

<Head>
<title>Learn React</title>
</Head>

<Courses />
</>
</Layout>
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { Lesson, Index, lessons } from "../courses/2018-essential-react.mdx";
import Layout from "../../components/layout"

<article>
<Layout>
<Lesson {...lessons[0]} />

Welcome to Essential React! In this course we’ll cover all of the essential knowledge you need to have about React components. We’ll state easy! We’re going to start with `Hello World!` and JSX. How to get started and what they are. But we’re going to progress pretty quickly to events. and state, and state management, lifecycle events, and get all the way to advanced composition of components. Yes! Advanced composition. But don’t be afraid, I think you can handle it. We’re going to take it one step at a time. Only one new concept per video. The whole thing will take about fourty to fourty-five minutes, but by the end you’ll know everything that you need to know to write stellar React apps. We’ll build this Pokemon component that allows you to page through all of the Pokemon available on Pokeapi.co. It’s going to be a lot of fun! Let’s get started.

<Index />
</article>
</Layout>
Loading

0 comments on commit f25fa96

Please sign in to comment.