doc(docs): add brand assets context menu#1406
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
hm I see I have is it needed for docs too @franky47 ? |
|
Yeah the feat/fix prefixes only apply to library code and control the version bump by semantic-release. Everything else is a doc/chore/etc. |
| const copyAsset = async (asset: BrandAsset) => { | ||
| const copied = await copyText(asset.svg) | ||
| if (copied) { | ||
| toast.success(`${asset.toastLabel} copied`) |
There was a problem hiding this comment.
suggestion: could we show a check icon inline in the menu to indicate the copy?
For a couple of reasons:
- It keeps the behaviour colocated with the control
- It avoids pulling in sonner as a dependency
The downside is we have to reserve a place for the checkmark to be displayed (could be overlaid on the left icon?) and it requires keeping the popup open. Maybe too many trade-offs.
What do you think?
There was a problem hiding this comment.
Yeah we could put a ghost button on the right side with copy icon that transforms to check to make it more obvious that it is clickable.
Let me see how it looks
There was a problem hiding this comment.
Perfect, we can remove the toast & sonner then.
| svg: string | ||
| } | ||
|
|
||
| const assetsDir = path.resolve(process.cwd(), '../res') |
There was a problem hiding this comment.
note: I'll have to make sure this works after ISR, Vercel is/was having issues with relative paths in the ISR lambda:
https://francoisbest.com/posts/2023/reading-files-on-vercel-during-nextjs-isr
| const copyAsset = async (asset: BrandAsset) => { | ||
| const copied = await copyText(asset.svg) | ||
| if (copied) { | ||
| toast.success(`${asset.toastLabel} copied`) |
There was a problem hiding this comment.
Perfect, we can remove the toast & sonner then.
Summary
Test