File tree Expand file tree Collapse file tree 2 files changed +29
-4
lines changed
modelina-website/src/components Expand file tree Collapse file tree 2 files changed +29
-4
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import Highlight from 'react-syntax-highlighter';
55
66import Caption from './Caption' ;
77import IconClipboard from './icons/Clipboard' ;
8+ import IconCheck from './icons/IconCheck' ;
89
910const 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 ) }
Original file line number Diff line number Diff line change 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+
You can’t perform that action at this time.
0 commit comments