Skip to content

Commit b59d784

Browse files
authored
docs: grammar cleanup (#4268)
1 parent bcd2717 commit b59d784

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

docs/docs/guides/08-theming-with-react-navigation.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ title: Theming with React Navigation
44

55
# Theming with React Navigation
66

7-
In this guide we will look into how to apply theming for an application using React Native Paper and React Navigation at the same time.
7+
In this guide, we will look into how to apply theming for an application using React Native Paper and React Navigation at the same time.
88

9-
Offering different theme options, especially dark/light ones, becomes increasingly a standard requirement of the modern mobile application. Fortunately, both React Navigation and React Native Paper support configurable theming out-of-the-box.
9+
Offering different theme options, especially dark/light ones, has become increasingly a standard requirement of the modern mobile application. Fortunately, both React Navigation and React Native Paper support configurable theming out-of-the-box.
1010
But how to make them work together?
1111

1212
## Themes adaptation
@@ -29,9 +29,9 @@ import {
2929

3030
### Material Design 3
3131

32-
From v5, React Native Paper theme colors structure is following the Material Design 3 <i>(known as Material You)</i> colors system, which differs significantly from both previous Paper's theme and React Navigation theme.
32+
From v5, React Native Paper theme colors structure follows the Material Design 3 <i>(known as Material You)</i> colors system, which differs significantly from both the previous Paper's theme and React Navigation theme.
3333

34-
However, to simplify adapting React Navigation theme colors, to use the ones from React Native Paper, it's worth using a utility called `adaptNavigationTheme` – it accepts navigation compliant themes in both modes and returns their equivalents adjusted to Material Design 3.
34+
However, to simplify adapting React Navigation theme colors, to use the ones from React Native Paper, it's worth using a utility called `adaptNavigationTheme` – it accepts navigation-compliant themes in both modes and returns their equivalents adjusted to Material Design 3.
3535

3636
```ts
3737
import {
@@ -58,8 +58,8 @@ import {
5858
## Combining theme objects
5959

6060
Both libraries require a wrapper to be used at the entry point of the application.
61-
React Navigation exposes `NavigationContainer` which ensures that navigation works correctly, but also accepts `theme` as an optional property. Read more about setting up navigation [here](https://reactnavigation.org/docs/getting-started/).
62-
For React Native Paper theme to work, we need to use `PaperProvider` also at application's entry point.
61+
React Navigation exposes `NavigationContainer`, which ensures that navigation works correctly and accepts `theme` as an optional property. Read more about setting up navigation [here](https://reactnavigation.org/docs/getting-started/).
62+
For React Native Paper theme to work, we need to use `PaperProvider` also at the application's entry point.
6363

6464
```js
6565
import { NavigationContainer } from '@react-navigation/native';
@@ -121,7 +121,7 @@ export default function App() {
121121
122122
Our goal here is to combine those two themes, so that we could control the theme for the entire application from a single place.
123123
124-
To make things easier we can use [deepmerge](https://www.npmjs.com/package/deepmerge) package. With `yarn` we can install it like this
124+
To make things easier we can use [deepmerge](https://www.npmjs.com/package/deepmerge) package. We can install it with:
125125
126126
```bash npm2yarn
127127
npm install deepmerge
@@ -243,15 +243,15 @@ export default function App() {
243243
244244
## Customizing theme
245245
246-
We don't need to limit ourselves to the themes offered by the libraries in default. Both packages allow for custom themes to be applied.
247-
You can learn all about it their documentations:
246+
We don't need to limit ourselves to the themes offered by the libraries' default. Both packages allow for custom themes to be applied.
247+
You can learn all about it in their documentation:
248248
249249
- [Theming in React Navigation](https://reactnavigation.org/docs/themes/)
250250
- [Theming in React Native Paper](https://callstack.github.io/react-native-paper/docs/guides/theming)
251251
252252
## React Context for theme customization
253253
254-
Now, we wouldn't want to stay forever with dark theme being on, which is why we need to gain the ability to control theme dynamically. A bit of state management is needed for this purpose.
254+
Now, we wouldn't want to stay on dark theme forever, which is why we need to gain the ability to control theme dynamically. A bit of state management is needed for this purpose.
255255
256256
React Context proves itself very useful in handling cross-cutting concerns like global theme handling, so we will use just that.
257257
@@ -311,7 +311,7 @@ export default function App() {
311311
}
312312
```
313313
314-
Now that the Context is available at every component, all we need to do is import it. Next thing is to provide the user with some UI element to control changing the theme. We will use `Paper`'s [Switch](https://callstack.github.io/react-native-paper/docs/components/Switch) for this purpose.
314+
Now that the Context is available at every component, all we need to do is import it. Next, provide the user with some UI element to control changing the theme. We will use `Paper`'s [Switch](https://callstack.github.io/react-native-paper/docs/components/Switch) for this purpose.
315315
316316
```js
317317
import React from 'react';
@@ -347,10 +347,10 @@ And now you can switch between light and dark theme!
347347
348348
Thanks to the linking of themes that we did earlier, switching themes can be controlled with only one piece of state.
349349
350-
React Native Paper components will automatically use provided theme thanks to the `PaperProvider` that is wrapped around the entry point of our application, but we can also access theme values manually with `useTheme` hook,
350+
React Native Paper components will automatically use the provided theme thanks to the `PaperProvider` that is wrapped around the entry point of our application, but we can also access theme values manually with `useTheme` hook,
351351
exposed by the library. You can see how it's done in the `Header` component code above.
352352
353353
If light/dark themes are not enough for your use case, you can learn more about creating Material Design themes [here](https://material.io/design/material-theming/implementing-your-theme.html#color).
354-
On `main` branch of the example app, you will find implemented [Menu](https://callstack.github.io/react-native-paper/docs/components/Menu) component, which allows to choose a few custom themes. Inspecting code in `utils` and `Header` may give you some idea how to use your own themes with `Paper`, in addition to dedicated [docs](https://callstack.github.io/react-native-paper/docs/components/Menu).
354+
On `main` branch of the example app, you will find implemented [Menu](https://callstack.github.io/react-native-paper/docs/components/Menu) component, which allows you to choose a few custom themes. Inspecting code in `utils` and `Header` may give you some idea of how to use your own themes with `Paper`, in addition to dedicated [docs](https://callstack.github.io/react-native-paper/docs/components/Menu).
355355
356356
Read more about integrating `Paper` with `React Navigation` in a brilliant [article](https://reactnavigation.org/blog/2020/01/29/using-react-navigation-5-with-react-native-paper/) by [@trensik](https://twitter.com/trensik)

0 commit comments

Comments
 (0)