Skip to content

Commit 93289d9

Browse files
committed
feat(frontend): add floating FeedbackButton to all pages
1 parent e9f4fa0 commit 93289d9

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

src/app/layout.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { Header } from "@/components/header";
77
import { Sidebar, SidebarProvider, SidebarSpacer } from "@/components/sidebar";
88
import { Footer } from "@/components/footer";
99
import { ScrollToTop } from "@/components/scroll-to-top";
10+
import { FeedbackButton } from "@/components/feedback-button";
1011
import { TRACKED_STABLECOINS } from "@/lib/stablecoins";
1112
import { DEAD_STABLECOINS } from "@/lib/dead-stablecoins";
1213
import { PEG_CURRENCY_COUNT } from "@/lib/classification";
@@ -107,6 +108,7 @@ export default function RootLayout({
107108
</div>
108109
</SidebarProvider>
109110
<ScrollToTop />
111+
<FeedbackButton />
110112
</Providers>
111113
<script
112114
type="application/ld+json"

src/components/feedback-button.tsx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
"use client";
2+
3+
import { useState } from "react";
4+
import { MessageSquarePlus } from "lucide-react";
5+
import { FeedbackModal } from "@/components/feedback-modal";
6+
7+
export function FeedbackButton() {
8+
const [open, setOpen] = useState(false);
9+
10+
return (
11+
<>
12+
<button
13+
onClick={() => setOpen(true)}
14+
aria-label="Send feedback"
15+
className="fixed bottom-6 right-6 z-50 flex items-center gap-2 rounded-full bg-primary px-4 py-2.5 text-sm font-medium text-primary-foreground shadow-lg transition-all hover:bg-primary/90 hover:shadow-xl active:scale-95"
16+
>
17+
<MessageSquarePlus className="h-4 w-4 shrink-0" />
18+
<span>Feedback</span>
19+
</button>
20+
<FeedbackModal open={open} onOpenChange={setOpen} />
21+
</>
22+
);
23+
}

0 commit comments

Comments
 (0)