File tree 2 files changed +39
-5
lines changed
2 files changed +39
-5
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import { cva } from 'class-variance-authority';
11
11
import { OpenPanel } from '@openpanel/web' ;
12
12
13
13
const rateButtonVariants = cva (
14
- 'inline-flex items-center gap-2 px-3 py-2 rounded-full font-medium border bg-fd-secondary text-fd-secondary-foreground text-sm [&_svg]:size-4 disabled:cursor-not-allowed' ,
14
+ 'inline-flex items-center gap-2 px-3 py-2 rounded-full font-medium border text-sm [&_svg]:size-4 disabled:cursor-not-allowed' ,
15
15
{
16
16
variants : {
17
17
active : {
@@ -142,12 +142,12 @@ export function Rate() {
142
142
</ button >
143
143
</ div >
144
144
) : (
145
- < form className = "flex flex-col gap-2 " onSubmit = { submit } >
145
+ < form className = "flex flex-col gap-3 " onSubmit = { submit } >
146
146
< textarea
147
147
autoFocus
148
148
value = { message }
149
149
onChange = { ( e ) => setMessage ( e . target . value ) }
150
- className = "border rounded-xl bg-fd-secondary text-fd-secondary-foreground p-3 text-sm resize-none focus-visible:outline-none placeholder:text-fd-muted-foreground"
150
+ className = "border rounded-lg bg-fd-secondary text-fd-secondary-foreground p-3 text-sm resize-none focus-visible:outline-none placeholder:text-fd-muted-foreground"
151
151
placeholder = "Leave your feedback..."
152
152
onKeyDown = { ( e ) => {
153
153
if ( ! e . shiftKey && e . key === 'Enter' ) {
@@ -157,7 +157,7 @@ export function Rate() {
157
157
/>
158
158
< button
159
159
type = "submit"
160
- className = { cn ( buttonVariants ( { color : 'outline' } ) , 'w-fit px-4 ' ) }
160
+ className = { cn ( buttonVariants ( { color : 'outline' } ) , 'w-fit px-3 ' ) }
161
161
>
162
162
Submit
163
163
</ button >
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ description: Receive feedback from your users
7
7
8
8
Feedback is crucial for knowing what your reader thinks, and help you to further improve documentation content.
9
9
10
- ### Setup
10
+ ### Installation
11
11
12
12
Copy the component.
13
13
@@ -33,3 +33,37 @@ const feedback: Feedback = {
33
33
34
34
posthog .capture (' on_rate_docs' , feedback );
35
35
```
36
+
37
+ ### Add to Page
38
+
39
+ Now add the ` <Rate /> ` component to your docs page:
40
+
41
+ ``` tsx
42
+ import defaultMdxComponents from ' fumadocs-ui/mdx' ;
43
+ import {
44
+ DocsPage ,
45
+ DocsTitle ,
46
+ DocsDescription ,
47
+ DocsBody ,
48
+ } from ' fumadocs-ui/page' ;
49
+ import { Rate } from ' @/components/rate' ;
50
+
51
+ export default async function Page() {
52
+ // other logic
53
+
54
+ return (
55
+ <DocsPage toc = { toc } full = { page .data .full } >
56
+ <DocsTitle >{ page .data .title } </DocsTitle >
57
+ <DocsDescription >{ page .data .description } </DocsDescription >
58
+ <DocsBody >
59
+ <Mdx
60
+ components = { {
61
+ ... defaultMdxComponents ,
62
+ }}
63
+ />
64
+ </DocsBody >
65
+ <Rate />
66
+ </DocsPage >
67
+ );
68
+ }
69
+ ```
You can’t perform that action at this time.
0 commit comments