From 1c355ab630f91a10e53f2af4e8cbfccdcc84f2f2 Mon Sep 17 00:00:00 2001 From: dan Date: Fri, 28 Jan 2022 18:55:27 +0000 Subject: [PATCH] [Beta] Change "You will learn" for chapters (#4239) --- beta/src/components/MDX/MDXComponents.tsx | 11 +++++++++-- beta/src/pages/learn/adding-interactivity.md | 2 +- beta/src/pages/learn/describing-the-ui.md | 2 +- beta/src/pages/learn/installation.md | 2 +- beta/src/pages/learn/managing-state.md | 2 +- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/beta/src/components/MDX/MDXComponents.tsx b/beta/src/components/MDX/MDXComponents.tsx index 21cf3fa9..ccd3518f 100644 --- a/beta/src/components/MDX/MDXComponents.tsx +++ b/beta/src/components/MDX/MDXComponents.tsx @@ -135,8 +135,15 @@ function MathI({children}: {children: any}) { ); } -function YouWillLearn({children}: {children: any}) { - return {children}; +function YouWillLearn({ + children, + isChapter, +}: { + children: any; + isChapter?: boolean; +}) { + let title = isChapter ? 'In this chapter' : 'You will learn'; + return {children}; } // TODO: typing. diff --git a/beta/src/pages/learn/adding-interactivity.md b/beta/src/pages/learn/adding-interactivity.md index b296f16b..67a48ec4 100644 --- a/beta/src/pages/learn/adding-interactivity.md +++ b/beta/src/pages/learn/adding-interactivity.md @@ -8,7 +8,7 @@ Some things on the screen update in response to user input. For example, clickin - + * [How to handle user-initiated events](/learn/responding-to-events) * [How to make components "remember" information with state](/learn/state-a-components-memory) diff --git a/beta/src/pages/learn/describing-the-ui.md b/beta/src/pages/learn/describing-the-ui.md index eee52d18..442e1407 100644 --- a/beta/src/pages/learn/describing-the-ui.md +++ b/beta/src/pages/learn/describing-the-ui.md @@ -8,7 +8,7 @@ React is a JavaScript library for rendering user interfaces (UI). UI is built fr - + * [How to write your first React component](/learn/your-first-component) * [When and how to create multi-component files](/learn/importing-and-exporting-components) diff --git a/beta/src/pages/learn/installation.md b/beta/src/pages/learn/installation.md index 3950ca13..f19f389d 100644 --- a/beta/src/pages/learn/installation.md +++ b/beta/src/pages/learn/installation.md @@ -8,7 +8,7 @@ React has been designed from the start for gradual adoption, and you can use as - + * [How to add React to an HTML page](/learn/add-react-to-a-website) * [How to start a standalone React project](/learn/start-a-new-react-project) diff --git a/beta/src/pages/learn/managing-state.md b/beta/src/pages/learn/managing-state.md index 57b79bf8..3fa3ad05 100644 --- a/beta/src/pages/learn/managing-state.md +++ b/beta/src/pages/learn/managing-state.md @@ -8,7 +8,7 @@ As your application grows, it helps to be more intentional about how your state - + * [How to think about UI changes as state changes](/learn/reacting-to-input-with-state) * [How to structure state well](/learn/choosing-the-state-structure)