Skip to content

Commit 4208efe

Browse files
committed
docs: enhance Docusaurus configuration with Open Graph and Twitter metadata
1 parent ca1a845 commit 4208efe

File tree

2 files changed

+57
-1
lines changed

2 files changed

+57
-1
lines changed

docs/docs/usage-examples.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,31 @@ function useUpdateCheck() {
123123
return { updateAvailable, latestVersion }
124124
}
125125
```
126+
127+
## Use with TanStack Query
128+
129+
If you're using [TanStack Query (React Query)](https://tanstack.com/query) for modern fetching patterns:
130+
131+
```ts
132+
import { useQuery } from '@tanstack/react-query'
133+
import { needsUpdate } from 'react-native-nitro-version-check'
134+
135+
export const useNeedsUpdate = () => {
136+
return useQuery({
137+
queryKey: ['needs-update'],
138+
queryFn: needsUpdate,
139+
})
140+
}
141+
```
142+
143+
Then use it in your component:
144+
145+
```tsx
146+
function UpdateBanner() {
147+
const { data: shouldUpdate, isLoading } = useNeedsUpdate()
148+
149+
if (isLoading || !shouldUpdate) return null
150+
151+
return <Text>A new version is available!</Text>
152+
}
153+
```

docs/docusaurus.config.ts

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,41 @@ const config: Config = {
6060
property: "og:type",
6161
content: "website",
6262
},
63+
{
64+
property: "og:title",
65+
content: "Nitro Version Check",
66+
},
6367
{
6468
property: "og:description",
6569
content: "A fast, modern version-checking library for React Native, powered by Nitro Modules.",
6670
},
6771
{
6872
property: "og:image",
69-
content: "/img/social-cards/og-card.png",
73+
content: "https://alshehriali0.github.io/react-native-nitro-version-check/img/social-cards/og-card.png",
74+
},
75+
{
76+
property: "og:image:width",
77+
content: "1200",
78+
},
79+
{
80+
property: "og:image:height",
81+
content: "630",
82+
},
83+
{
84+
name: "twitter:card",
85+
content: "summary_large_image",
86+
},
87+
{
88+
name: "twitter:title",
89+
content: "Nitro Version Check",
90+
},
91+
{
92+
name: "twitter:description",
93+
content: "A fast, modern version-checking library for React Native, powered by Nitro Modules.",
94+
},
95+
{
96+
name: "twitter:image",
97+
content: "https://alshehriali0.github.io/react-native-nitro-version-check/img/social-cards/og-card.png",
7098
},
7199
{
72100
name: "keywords",

0 commit comments

Comments
 (0)