Skip to content

Commit 9a96ada

Browse files
Merge master into dependabot/npm_and_yarn/modelina-website/next-14.2.21
2 parents f0442db + 8f8ae07 commit 9a96ada

File tree

2 files changed

+29
-4
lines changed

2 files changed

+29
-4
lines changed

modelina-website/src/components/CodeBlock.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import Highlight from 'react-syntax-highlighter';
55

66
import Caption from './Caption';
77
import IconClipboard from './icons/Clipboard';
8+
import IconCheck from './icons/IconCheck';
89

910
const theme = {
1011
hljs: {
@@ -270,10 +271,13 @@ export default function CodeBlock({
270271
className='absolute right-2 top-1 z-50 cursor-pointer bg-code-editor-dark text-xs text-gray-500 hover:text-gray-300 focus:outline-none'
271272
title='Copy to clipboard'
272273
>
273-
{showIsCopied && <span className='mr-2 inline-block pl-2 pt-1'>Copied!</span>}
274-
<span className='inline-block pt-1'>
275-
<IconClipboard className='-mt-0.5 inline-block size-4' />
276-
</span>
274+
<span>
275+
{showIsCopied ? (
276+
<IconCheck className='mt-2 mr-1 inline-block size-4' />
277+
) : (
278+
<IconClipboard className='mt-2 mr-1 inline-block size-4' />
279+
)}
280+
</span>
277281
</button>
278282
</div>
279283
)}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
export default function IconCheck({ className }: any) {
2+
return (
3+
<svg
4+
className={className || 'inline-block'}
5+
fill='currentColor'
6+
viewBox='0 0 22 22'
7+
8+
>
9+
<circle cx='12' cy='12' r='10' className='text-gray-500' />
10+
<path
11+
d='M7 12l3 3 7-7'
12+
fill='none'
13+
stroke='#252f3f'
14+
strokeWidth='2'
15+
strokeLinecap='round'
16+
strokeLinejoin='round'
17+
/>
18+
</svg>
19+
);
20+
}
21+

0 commit comments

Comments
 (0)