Skip to content

Commit

Permalink
refactor(ui): adjust CopyButton position in CodeBlock component
Browse files Browse the repository at this point in the history
  • Loading branch information
tszhong0411 committed Feb 1, 2025
1 parent 3f6621c commit 7b9bd00
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/silver-moons-pump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@tszhong0411/ui': patch
---

Adjust CopyButton position in CodeBlock component
2 changes: 1 addition & 1 deletion packages/ui/src/code-block.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const CodeBlock = (props: CodeBlockProps) => {
<Icon className='size-3.5' />
</div>
<figcaption className='text-muted-foreground flex-1 truncate'>{title}</figcaption>
<CopyButton onCopy={onCopy} />
<CopyButton className='-me-2' onCopy={onCopy} />
</div>
) : (
<CopyButton className='absolute right-2 top-2 z-10' onCopy={onCopy} />
Expand Down

0 comments on commit 7b9bd00

Please sign in to comment.