Skip to content

Commit 6108927

Browse files
committed
docs: Make homepage social image use full logo
1 parent b11c189 commit 6108927

File tree

3 files changed

+19
-16
lines changed

3 files changed

+19
-16
lines changed

docs/core/api/useSuspense.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ export const ProfileResource = createResource({
216216
});
217217
```
218218

219-
```tsx title="ProfileList"
219+
```tsx title="ProfileList" {5}
220220
import { useSuspense } from '@data-client/react';
221221
import { ProfileResource } from './ProfileResource';
222222

@@ -241,18 +241,23 @@ render(<ProfileList />);
241241

242242
</HooksPlayground>
243243

244+
### Pagination
245+
246+
Reactive [pagination](/rest/guides/pagination) is achieved with [mutable schemas](/rest/api/Collection)
247+
248+
<PaginationDemo />
249+
244250
### Sequential
245251

246252
When fetch parameters depend on data from another resource.
247253

248254
```tsx
249255
function PostWithAuthor() {
250256
const post = useSuspense(PostResource.get, { id });
251-
// post as Post
252257
const author = useSuspense(UserResource.get, {
258+
// highlight-next-line
253259
id: post.userId,
254260
});
255-
// author as User
256261
}
257262
```
258263

@@ -305,12 +310,11 @@ export const UserResource = createResource({
305310
});
306311
```
307312

308-
```tsx title="PostWithAuthor"
313+
```tsx title="PostWithAuthor" {7-11}
309314
import { PostResource, UserResource } from './Resources';
310315

311316
export default function PostWithAuthor({ id }: { id: string }) {
312317
const post = useSuspense(PostResource.get, { id });
313-
// post as Post
314318
const author = useSuspense(
315319
UserResource.get,
316320
post.userId
@@ -332,7 +336,7 @@ When entities are stored in [nested structures](/rest/guides/relational-data#nes
332336

333337
<TypeScriptEditor row={false}>
334338

335-
```typescript title="api/Post"
339+
```typescript title="api/Post" {15-19}
336340
export class PaginatedPost extends Entity {
337341
id = '';
338342
title = '';
@@ -348,19 +352,19 @@ export const getPosts = new RestEndpoint({
348352
path: '/post',
349353
searchParams: { page: '' },
350354
schema: {
351-
results: new schema.Collection([PaginatedPost]),
355+
posts: new schema.Collection([PaginatedPost]),
352356
nextPage: '',
353357
lastPage: '',
354358
},
355359
});
356360
```
357361

358-
```tsx title="ArticleList"
362+
```tsx title="ArticleList" {5-7}
359363
import { getPosts } from './api/Post';
360364

361365
export default function ArticleList({ page }: { page: string }) {
362366
const {
363-
results: posts,
367+
posts,
364368
nextPage,
365369
lastPage,
366370
} = useSuspense(getPosts, { page });
@@ -376,12 +380,6 @@ export default function ArticleList({ page }: { page: string }) {
376380

377381
</TypeScriptEditor>
378382

379-
### Pagination
380-
381-
Reactive [pagination](/rest/guides/pagination) is achieved with [mutable schemas](/rest/api/Collection)
382-
383-
<PaginationDemo />
384-
385383
### Server Side Rendering
386384

387385
[Server Side Rendering](../guides/ssr.md) to incrementally stream HTML,
@@ -398,6 +396,8 @@ continue showing the previous screen while the new data loads. Combined with
398396
loading indicators - improving the user experience.
399397

400398
Click one of the names to navigate to their todos. Here long loading states are indicated by the
401-
less intrusive _loading bar_, like YouTube and Robinhood use.
399+
less intrusive _loading bar_, like [YouTube](https://youtube.com) and [Robinhood](https://robinhood.com) use.
402400

403401
<StackBlitz app="todo-app" file="src/pages/Home/TodoList.tsx,src/pages/Home/index.tsx,src/useNavigationState.ts" height={600} />
402+
403+
If you need help adding this to your own custom router, check out the [official React guide](https://react.dev/reference/react/useTransition#building-a-suspense-enabled-router)

website/src/pages/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import Head from '@docusaurus/Head';
22
import Link from '@docusaurus/Link';
3+
import { PageMetadata } from '@docusaurus/theme-common';
34
import useBaseUrl from '@docusaurus/useBaseUrl';
45
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
56
import Layout from '@theme/Layout';
@@ -96,8 +97,10 @@ function HomepageEnder() {
9697
}
9798

9899
export default function Home() {
100+
const image = useBaseUrl('img/social/client_logo_and_text_card.png');
99101
return (
100102
<Layout description="Async State Management without the Management.">
103+
<PageMetadata image={image} />
101104
<Head>
102105
<title>The Reactive Data Client ✨</title>
103106
</Head>
19.1 KB
Loading

0 commit comments

Comments
 (0)