A decentralized music tracking and discovery platform built on AT Protocol ๐ŸŽต rocksky.app
spotify atproto lastfm musicbrainz scrobbling listenbrainz

Add indicator when url is copied (#4) #12

merged opened by openwheel.racing targeting main

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.

Labels

None yet.

assignee

None yet.

Participants 2
AT URI
at://did:plc:up4ttgwowa4vd3ec4oebllv6/sh.tangled.repo.pull/3m4dlscgl3322
+14 -2
Diff #0
+14 -2
apps/web/src/layouts/Navbar/Navbar.tsx
··· 76 76 return ""; 77 77 }, [data]); 78 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 + 79 91 useEffect(() => { 80 92 if (profile?.spotifyConnected && !!localStorage.getItem("spotify")) { 81 93 localStorage.removeItem("spotify"); ··· 351 363 extension settings as a custom API URL: 352 364 </LabelMedium> 353 365 <Code className="mt-[15px]">{webscrobblerWebhook}</Code> 354 - <StatefulTooltip content="Copy API Key"> 366 + <StatefulTooltip content={tooltipContent}> 355 367 <Copy 356 - onClick={() => copy(webscrobblerWebhook)} 368 + onClick={handleCopyClick} 357 369 size={18} 358 370 color="var(--color-text)" 359 371 className="ml-[5px] cursor-pointer"

History

1 round 2 comments
sign up or login to add to the discussion
expand 2 comments

The issue didn't auto link so here is a link: (#4)[https://tangled.org/@rocksky.app/rocksky/issues/4]

Thanks for the PR! ๐Ÿ™Œ The indicator looks great and works as expected. No worries about the script, glad you managed to test it locally. I've already pushed a fix for the build script issue, so it should work fine now.

pull request successfully merged