Skip to content

Commit 29f4cbf

Browse files
authored
QA Fixes improving overall docs + mini app docs (#300)
* Make Ask AI Button primary CTA in header * Downgrade base.org button to standard link * Update submit to ecosystem to point to GH instructions * Update links doc to include viewcast and minikit instructions * fix typos
1 parent fabf899 commit 29f4cbf

5 files changed

Lines changed: 163 additions & 35 deletions

File tree

docs/custom.css

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,33 @@
1010
background-color: rgba(239, 68, 68, 0.1);
1111
}
1212

13+
.assistant-entry {
14+
background-color: #3c8aff;
15+
color: #ffffff;
16+
border: 1px solid rgba(0, 0, 0, 0.15);
17+
box-shadow: none;
18+
font-weight: 600;
19+
}
20+
21+
.assistant-entry:hover {
22+
transform: translateY(-1px);
23+
box-shadow: none;
24+
}
25+
26+
.assistant-entry:focus-visible {
27+
outline: 2px solid rgba(0, 0, 0, 0.25);
28+
outline-offset: 2px;
29+
}
30+
31+
.dark .assistant-entry {
32+
background-color: #3c8aff;
33+
border-color: rgba(0, 0, 0, 0.55);
34+
}
35+
36+
.dark .assistant-entry:focus-visible {
37+
outline: 2px solid rgba(0, 0, 0, 0.65);
38+
}
39+
1340
.base_header_img {
1441
margin: auto;
1542
}

docs/docs.json

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@
499499
{
500500
"group": "Resources",
501501
"pages": [
502-
"mini-apps/resources/resources",
502+
"mini-apps/resources/templates",
503503
"mini-apps/llms-full.txt"
504504
]
505505
}
@@ -1247,13 +1247,12 @@
12471247
{
12481248
"label": "Support",
12491249
"href": "https://discord.com/invite/buildonbase"
1250+
},
1251+
{
1252+
"label": "Base.org",
1253+
"href": "https://base.org"
12501254
}
1251-
],
1252-
"primary": {
1253-
"type": "button",
1254-
"label": "Base.org",
1255-
"href": "https://base.org"
1256-
}
1255+
]
12571256
},
12581257
"footer": {
12591258
"socials": {

docs/get-started/base.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Explore [all products](/get-started/products) and [use cases](/get-started/use-c
8989
<Card
9090
title="Submit to Base Ecosystem Page"
9191
icon="globe"
92-
href="https://www.base.org/ecosystem"
92+
href="https://github.com/base/web?tab=readme-ov-file#updating-the-base-ecosystem-page"
9393
>
9494
Showcase your project to the Base community and get discovered.
9595
</Card>

docs/mini-apps/features/links.mdx

Lines changed: 128 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -18,39 +18,141 @@ Avoid using direct HTML links (`<a href="">`, `<Link href="">`) or static URLs i
1818
## External Navigation
1919

2020
### Opening External URLs
21+
<Tabs>
22+
<Tab title="With MiniKit">
23+
24+
Use [`useOpenUrl()`](/mini-apps/technical-reference/minikit/hooks/useOpenUrl) to safely open external websites in the client's in-app browser:
25+
```tsx components/ExternalLinks.tsx
26+
import { useOpenUrl } from '@coinbase/onchainkit/minikit';
27+
28+
export default function ExternalLinks() {
29+
const openUrl = useOpenUrl();
30+
31+
return (
32+
<div className="external-links">
33+
<button onClick={() => openUrl('https://base.org')}>
34+
Visit Base.org
35+
</button>
36+
<button onClick={() => openUrl('https://twitter.com/base')}>
37+
Follow on Twitter
38+
</button>
39+
<button onClick={() => openUrl('https://discord.gg/basechain')}>
40+
Join Discord
41+
</button>
42+
</div>
43+
);
44+
}
2145

22-
Use `sdk.actions.openUrl()` to safely open external websites in the client's in-app browser:
46+
// Incorrect: Direct HTML link
47+
// <a href="https://example.com">Visit Site</a>
48+
```
49+
</Tab>
2350

24-
```typescript App.tsx
25-
import { sdk } from '@@farcaster/miniapp-sdk';
51+
<Tab title="Without MiniKit">
2652

27-
// Correct: Use SDK action
28-
const openExternalSite = () => {
29-
sdk.actions.openUrl('https://example.com');
30-
};
53+
Use `sdk.actions.openUrl()` to safely open external websites in the client's in-app browser:
3154

32-
// Incorrect: Direct HTML link
33-
// <a href="https://example.com">Visit Site</a>
34-
```
55+
```typescript App.tsx
56+
import { sdk } from '@farcaster/miniapp-sdk';
57+
58+
// Correct: Use SDK action
59+
const openExternalSite = () => {
60+
sdk.actions.openUrl('https://example.com');
61+
};
62+
63+
// Incorrect: Direct HTML link
64+
// <a href="https://example.com">Visit Site</a>
65+
```
66+
</Tab>
67+
</Tabs>
3568

3669
### Composing Casts
3770

38-
Use `sdk.actions.composeCast()` instead of composer intent URLs:
71+
<Tabs>
72+
<Tab title="With MiniKit">
73+
74+
Use [`useComposeCast()`](/mini-apps/technical-reference/minikit/hooks/useComposeCast) to open the native composer with prefilled content:
75+
```tsx components/ShareCast.tsx
76+
import { useComposeCast } from '@coinbase/onchainkit/minikit';
77+
78+
export default function ShareCast() {
79+
const { composeCast } = useComposeCast();
80+
81+
return (
82+
<button
83+
onClick={() =>
84+
composeCast({
85+
text: 'Check out this Mini App!',
86+
embeds: [window.location.href]
87+
})
88+
}
89+
>
90+
Share This App
91+
</button>
92+
);
93+
}
94+
95+
// Incorrect: Composer intent URLs
96+
// window.open('https://farcaster.com/~/compose?text=...')
97+
```
98+
</Tab>
3999

40-
```typescript App.tsx
41-
import { sdk } from '@farcaster/miniapp-sdk';
100+
<Tab title="Without MiniKit">
42101

43-
// Correct: Use SDK action
44-
const shareContent = () => {
45-
sdk.actions.composeCast({
46-
text: 'Check out this Mini App!',
47-
embeds: ['https://yourminiapp.com']
48-
});
49-
};
102+
Use `sdk.actions.composeCast()` instead of composer intent URLs:
50103

51-
// Incorrect: Composer intent URLs
52-
// window.open('https://farcaster.com/~/compose?text=...')
53-
```
104+
```typescript App.tsx
105+
import { sdk } from '@farcaster/miniapp-sdk';
106+
107+
// Correct: Use SDK action
108+
const shareContent = () => {
109+
sdk.actions.composeCast({
110+
text: 'Check out this Mini App!',
111+
embeds: ['https://yourminiapp.com']
112+
});
113+
};
114+
115+
// Incorrect: Composer intent URLs
116+
// window.open('https://farcaster.com/~/compose?text=...')
117+
```
118+
</Tab>
119+
</Tabs>
120+
121+
### Viewing Casts
122+
123+
<Tabs>
124+
<Tab title="With MiniKit">
125+
126+
Use [`useViewCast()`](/mini-apps/technical-reference/minikit/hooks/useViewCast) to open a specific cast by its hash:
127+
```tsx components/ViewCastButton.tsx
128+
import { useViewCast } from '@coinbase/onchainkit/minikit';
129+
130+
export default function ViewCastButton() {
131+
const viewCast = useViewCast('0x1234567890abcdef1234567890abcdef12345678');
132+
133+
return (
134+
<button onClick={viewCast}>
135+
View Cast
136+
</button>
137+
);
138+
}
139+
```
140+
</Tab>
141+
142+
<Tab title="Without MiniKit">
143+
144+
Use `sdk.actions.viewCast()` instead of cast intent URLs:
145+
146+
```typescript App.tsx
147+
import { sdk } from '@farcaster/miniapp-sdk';
148+
149+
// Correct: Use SDK action
150+
const viewCast = () => {
151+
sdk.actions.viewCast('https://farcaster.com/cast/1234567890');
152+
};
153+
```
154+
</Tab>
155+
</Tabs>
54156

55157
## Best Practices
56158

@@ -67,7 +169,7 @@ Before implementing any navigation or linking functionality:
67169
When using features that may not be supported in all clients:
68170

69171
```javascript App.tsx
70-
import { sdk } from '@@farcaster/miniapp-sdk';
172+
import { sdk } from '@farcaster/miniapp-sdk';
71173

72174
const handleExternalLink = (url) => {
73175
try {
@@ -88,7 +190,7 @@ Don't hardcode URLs specific to particular clients (like Warpcast URLs). Instead
88190
### Navigation Buttons
89191

90192
```javascript NavigationComponent.tsx
91-
import { sdk } from '@@farcaster/miniapp-sdk';
193+
import { sdk } from 'farcaster/miniapp-sdk';
92194

93195
const NavigationComponent = () => {
94196
const handleExternalLink = () => {
@@ -118,7 +220,7 @@ const NavigationComponent = () => {
118220
### Conditional Navigation
119221

120222
```javascript ConditionalNavigation.tsx
121-
import { sdk } from '@@farcaster/miniapp-sdk';
223+
import { sdk } from 'farcaster/miniapp-sdk';
122224

123225
const ConditionalNavigation = () => {
124226
const context = sdk.context;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Production-ready code repositories that you can clone and deploy immediately.
7171
<Card
7272
title="Full Mini Demo"
7373
icon="github"
74-
href="https://github.com/base/demos/tree/master/minikit/full-mini-demo"
74+
href="https://github.com/base/demos/tree/master/minikit/mini-app-full-demo"
7575
>
7676
A comprehensive showcase demonstrating the complete range of MiniKit capabilities and Base ecosystem integrations.
7777
</Card>

0 commit comments

Comments
 (0)