A decentralized music tracking and discovery platform built on AT Protocol 🎵

Add indicator when url is copied (#4)

Add an indicator when the URL is copied, per issue #4. I had a hell of a time trying to get this to run on my computer for some reason (my computer seemingly can't find `bun run build:raichu` in the repo), so it was easier to just MVP'd it in using a vite react app with basic-ui locally and it worked well, just to test this page. It just changes the text "Copy API Key" to "Copied!" and it then resets back after 1500 ms.

authored by openwheel.racing and committed by

Tangled a717f639 54f34f48

+14 -2
+14 -2
apps/web/src/layouts/Navbar/Navbar.tsx
··· 76 return ""; 77 }, [data]); 78 79 useEffect(() => { 80 if (profile?.spotifyConnected && !!localStorage.getItem("spotify")) { 81 localStorage.removeItem("spotify"); ··· 351 extension settings as a custom API URL: 352 </LabelMedium> 353 <Code className="mt-[15px]">{webscrobblerWebhook}</Code> 354 - <StatefulTooltip content="Copy API Key"> 355 <Copy 356 - onClick={() => copy(webscrobblerWebhook)} 357 size={18} 358 color="var(--color-text)" 359 className="ml-[5px] cursor-pointer"
··· 76 return ""; 77 }, [data]); 78 79 + const [tooltipContent, setTooltipContent] = useState("Copy API Key"); 80 + 81 + const handleCopyClick = () => { 82 + copy(webscrobblerWebhook); 83 + 84 + setTooltipContent("Copied!"); 85 + 86 + setTimeout(() => { 87 + setTooltipContent("Copy API Key"); 88 + }, 1500); 89 + } 90 + 91 useEffect(() => { 92 if (profile?.spotifyConnected && !!localStorage.getItem("spotify")) { 93 localStorage.removeItem("spotify"); ··· 363 extension settings as a custom API URL: 364 </LabelMedium> 365 <Code className="mt-[15px]">{webscrobblerWebhook}</Code> 366 + <StatefulTooltip content={tooltipContent}> 367 <Copy 368 + onClick={handleCopyClick} 369 size={18} 370 color="var(--color-text)" 371 className="ml-[5px] cursor-pointer"