Browse Source

[Beta] Change "You will learn" for chapters (#4239)

main
dan 3 years ago
committed by GitHub
parent
commit
1c355ab630
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      beta/src/components/MDX/MDXComponents.tsx
  2. 2
      beta/src/pages/learn/adding-interactivity.md
  3. 2
      beta/src/pages/learn/describing-the-ui.md
  4. 2
      beta/src/pages/learn/installation.md
  5. 2
      beta/src/pages/learn/managing-state.md

11
beta/src/components/MDX/MDXComponents.tsx

@ -135,8 +135,15 @@ function MathI({children}: {children: any}) {
);
}
function YouWillLearn({children}: {children: any}) {
return <SimpleCallout title="You will learn">{children}</SimpleCallout>;
function YouWillLearn({
children,
isChapter,
}: {
children: any;
isChapter?: boolean;
}) {
let title = isChapter ? 'In this chapter' : 'You will learn';
return <SimpleCallout title={title}>{children}</SimpleCallout>;
}
// TODO: typing.

2
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
</Intro>
<YouWillLearn>
<YouWillLearn isChapter={true}>
* [How to handle user-initiated events](/learn/responding-to-events)
* [How to make components "remember" information with state](/learn/state-a-components-memory)

2
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
</Intro>
<YouWillLearn>
<YouWillLearn isChapter={true}>
* [How to write your first React component](/learn/your-first-component)
* [When and how to create multi-component files](/learn/importing-and-exporting-components)

2
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
</Intro>
<YouWillLearn>
<YouWillLearn isChapter={true}>
* [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)

2
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
</Intro>
<YouWillLearn>
<YouWillLearn isChapter={true}>
* [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)

Loading…
Cancel
Save