mirror of
https://github.com/r-freeman/portfolio.git
synced 2025-06-28 00:20:20 +00:00
Update code component
This commit is contained in:
parent
709aba439e
commit
efd8dfb8f8
@ -19,9 +19,9 @@ export function Code({children}: { children: ReactNode }) {
|
|||||||
return (
|
return (
|
||||||
<pre className="relative group" ref={preRef}>
|
<pre className="relative group" ref={preRef}>
|
||||||
<button
|
<button
|
||||||
className="absolute top-0 right-0 m-5 text-zinc-400"
|
className="absolute top-0 right-0 m-5 text-zinc-400 rounded-lg hover:bg-[#121212] p-2"
|
||||||
onClick={handleCopy} aria-label={`${!copied ? 'Copy this code' : 'Copied!'}`}>
|
onClick={handleCopy} aria-label={`${!copied ? 'Copy this code' : 'Copied!'}`}>
|
||||||
<div className="relative size-6">
|
<div className="relative size-5">
|
||||||
<CheckIcon
|
<CheckIcon
|
||||||
className={clsx('absolute text-green-500 ease-in transform transition', !copied ? 'scale-0' : 'scale-100')}/>
|
className={clsx('absolute text-green-500 ease-in transform transition', !copied ? 'scale-0' : 'scale-100')}/>
|
||||||
<CopyIcon
|
<CopyIcon
|
||||||
|
Loading…
x
Reference in New Issue
Block a user