tangled
alpha
login
or
join now
shi.gg
/
mellow-web
4
fork
atom
The weeb for the next gen discord boat - Wamellow
wamellow.com
bot
discord
4
fork
atom
overview
issues
pulls
pipelines
fix dev-dash copy link
shi.gg
2 years ago
ed66c81e
e426c9a1
+12
-2
2 changed files
expand all
collapse all
unified
split
app
dashboard
[guildId]
layout.tsx
components
copy-to-clipboard.tsx
+1
app/dashboard/[guildId]/layout.tsx
···
196
196
<div className="md:ml-auto mt-6 md:mt-0">
197
197
{web.devToolsEnabled &&
198
198
<CopyToClipboardButton
199
199
+
needsWait
199
200
text={getCanonicalUrl("leaderboard", params.guildId.toString())}
200
201
items={[
201
202
{ icon: <HiShare />, name: "Copy page url", description: "Creates a link to this specific page", text: getCanonicalUrl(...path.split("/").slice(1)) },
+11
-2
components/copy-to-clipboard.tsx
···
20
20
title?: string;
21
21
className?: string;
22
22
items?: { icon?: React.ReactNode, name: string, description?: string, text: string }[];
23
23
+
needsWait?: boolean;
23
24
}
24
25
25
25
-
export function CopyToClipboardButton({ icon, text, title, className = "", items }: Props) {
26
26
+
export function CopyToClipboardButton({
27
27
+
icon,
28
28
+
text,
29
29
+
title,
30
30
+
className,
31
31
+
items,
32
32
+
needsWait
33
33
+
}: Props) {
26
34
const timeoutRef = useRef<NodeJS.Timeout | null>(null);
27
35
28
36
const [saved, setSaved] = useState<boolean>(false);
29
37
30
38
const handleCopy = (t: string) => {
31
31
-
copyToClipboard(t);
39
39
+
copyToClipboard(t, needsWait);
32
40
setSaved(true);
33
41
34
42
if (timeoutRef.current) clearInterval(timeoutRef.current);
···
69
77
key={i}
70
78
description={item.description}
71
79
startContent={item.icon}
80
80
+
className="backdrop-blur-md"
72
81
>
73
82
{item.name}
74
83
</DropdownItem>