Skip to content

Commit 34452f5

Browse files
committed
Fix typos
1 parent ebb37ba commit 34452f5

3 files changed

Lines changed: 7 additions & 12 deletions

File tree

docs/Theming.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ const App = () => (
396396

397397
With this setup, the default application theme depends on the user's system settings. If the user has chosen a dark mode in their OS, react-admin will use the dark theme. Otherwise, it will use the light theme.
398398

399-
In addition, users can switch from one theme to the other using [the `<ToggleThemeButton>` component](./ToggleThemeButton.md), which appears in the AppBar as soon as you define a `daerkTheme` prop.
399+
In addition, users can switch from one theme to the other using [the `<ToggleThemeButton>` component](./ToggleThemeButton.md), which appears in the AppBar as soon as you define a `darkTheme` prop.
400400

401401
## Changing the Theme Programmatically
402402

docs/ToggleThemeButton.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,14 @@ It is enabled by default in the `<AppBar>` as soon as you define a dark theme vi
1616

1717
## Usage
1818

19-
You can add the `<ToggleThemeButton>` to a custom App Bar:
19+
You can add the `<ToggleThemeButton>` to a custom [`<AppBar toolbar>`](./AppBar.md#toolbar):
2020

2121
```jsx
2222
// in src/MyAppBar.js
23-
import { AppBar, TitlePortal, ToggleThemeButton } from 'react-admin';
23+
import { AppBar, ToggleThemeButton } from 'react-admin';
2424

2525
export const MyAppBar = () => (
26-
<AppBar toolbar={<ToggleThemeButton />}>
27-
<TitlePortal />
28-
</AppBar>>
26+
<AppBar toolbar={<ToggleThemeButton />} />
2927
);
3028
```
3129

packages/ra-ui-materialui/src/button/ToggleThemeButton.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,13 @@ import { RaThemeOptions, useThemesContext, useTheme } from '../layout';
1010
/**
1111
* Button toggling the theme (light or dark).
1212
*
13-
* Uses the light and dark theme defined in the <Admin> component.
13+
* Enabled by default in the <AppBar> when the <Admin> component has a darkMode.
1414
*
1515
* @example
16-
* import { AppBar, TitlePortal, ToggleThemeButton } from 'react-admin';
16+
* import { AppBar, ToggleThemeButton } from 'react-admin';
1717
*
1818
* const MyAppBar = () => (
19-
* <AppBar>
20-
* <TitlePortal />
21-
* <ToggleThemeButton />
22-
* </AppBar>
19+
* <AppBar toolbar={<ToggleThemeButton />} />
2320
* );
2421
*
2522
* const MyLayout = props => <Layout {...props} appBar={MyAppBar} />;

0 commit comments

Comments
 (0)