Skip to content

Commit e82301b

Browse files
committed
Misc doc fixes
1 parent 129c5e3 commit e82301b

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

docs/Show.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,11 +308,14 @@ export const PostShow = () => (
308308

309309
```jsx
310310
import { Show, IsOffline } from 'react-admin';
311+
import { Alert } from '@mui/material';
311312

312313
export const PostShow = () => (
313314
<Show offline={<p>No network. Could not load the post.</p>}>
314315
<IsOffline>
315-
No network. The post data may be outdated.
316+
<Alert severity="warning">
317+
You are offline, the data may be outdated
318+
</Alert>
316319
</IsOffline>
317320
...
318321
</Show>

docs/ShowBase.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ const BookShow = () => (
113113
By default, the `<ShowBase>` component will automatically redirect the user to the login page if the user is not authenticated. If you want to disable this behavior and allow anonymous access to a show page, set the `disableAuthentication` prop to `true`.
114114

115115
```jsx
116-
import { ShowBase } from 'ra-core';
116+
import { ShowBase } from 'react-admin';
117117

118118
const PostShow = () => (
119119
<ShowBase disableAuthentication>
@@ -127,7 +127,7 @@ const PostShow = () => (
127127
By default, `<ShowBase>` deduces the identifier of the record to show from the URL path. So under the `/posts/123/show` path, the `id` prop will be `123`. You may want to force a different identifier. In this case, pass a custom `id` prop.
128128

129129
```jsx
130-
import { ShowBase } from 'ra-core';
130+
import { ShowBase } from 'react-admin';
131131

132132
export const PostShow = () => (
133133
<ShowBase id="123">
@@ -143,7 +143,7 @@ export const PostShow = () => (
143143
By default, `<ShowBase>` renders nothing while checking for authentication and permissions. You can provide your own component via the `loading` prop:
144144

145145
```jsx
146-
import { ShowBase } from 'ra-core';
146+
import { ShowBase } from 'react-admin';
147147

148148
export const PostShow = () => (
149149
<ShowBase loading={<p>Checking for permissions...</p>}>
@@ -157,7 +157,7 @@ export const PostShow = () => (
157157
By default, `<ShowBase>` renders nothing when there is no connectivity and the record hasn't been cached yet. You can provide your own component via the `offline` prop:
158158

159159
```jsx
160-
import { ShowBase } from 'ra-core';
160+
import { ShowBase } from 'react-admin';
161161

162162
export const PostShow = () => (
163163
<ShowBase offline={<p>No network. Could not load the post.</p>}>
@@ -169,7 +169,7 @@ export const PostShow = () => (
169169
**Tip**: If the record is in the Tanstack Query cache but you want to warn the user that they may see an outdated version, you can use the `<IsOffline>` component:
170170

171171
```jsx
172-
import { ShowBase, IsOffline } from 'ra-core';
172+
import { ShowBase, IsOffline } from 'react-admin';
173173

174174
export const PostShow = () => (
175175
<ShowBase offline={<p>No network. Could not load the post.</p>}>
@@ -258,7 +258,7 @@ const BookShow = () => (
258258
By default, `<ShowBase>` operates on the current `ResourceContext` (defined at the routing level), so under the `/posts/1/show` path, the `resource` prop will be `posts`. You may want to force a different resource. In this case, pass a custom `resource` prop, and it will override the `ResourceContext` value.
259259

260260
```jsx
261-
import { ShowBase } from 'ra-core';
261+
import { ShowBase } from 'react-admin';
262262

263263
export const UsersShow = () => (
264264
<ShowBase resource="users">

0 commit comments

Comments
 (0)