File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed
Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change 1+ import React from "react" ;
12import { motion } from "framer-motion" ;
23import classnames from "classnames" ;
34
@@ -11,6 +12,8 @@ const Button = ({
1112 href = "" ,
1213 to = "" ,
1314 type = "button" ,
15+ icon = null ,
16+ iconSize = 16 ,
1417 ...otherProps
1518} ) => {
1619 let Parent , elementSpecificProps ;
@@ -31,6 +34,8 @@ const Button = ({
3134 if ( ! disabled ) onClick ( ) ;
3235 } ;
3336
37+ const Icon = icon || React . Fragment ;
38+
3439 return (
3540 < Parent
3641 onClick = { handleClick }
@@ -48,6 +53,7 @@ const Button = ({
4853 { ...elementSpecificProps }
4954 >
5055 { label && < span > { label } </ span > }
56+ { icon && < Icon size = { iconSize } className = "cs-ui-btn__icon" /> }
5157 </ Parent >
5258 ) ;
5359} ;
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ export default function Home() {
5454 } ;
5555
5656 const handleDemoJson = ( ) => {
57- setInputString ( JSON . stringify ( DEMO_STRING ) ) ;
57+ setInputString ( JSON . stringify ( DEMO_JSON_STRING ) ) ;
5858 setOutputString ( "" ) ;
5959 } ;
6060
@@ -93,14 +93,21 @@ export default function Home() {
9393 />
9494 </ div >
9595 < div className = "w-full bg-[#282c34]" >
96- < Copy className = "ml-auto py-2" size = { 30 } onClick = { handleCopy } />
96+ < Button
97+ size = "small"
98+ style = "text"
99+ onClick = { handleCopy }
100+ icon = { Copy }
101+ className = "float-right"
102+ disabled = { outputString === "" }
103+ />
97104 < CodeMirror
98105 height = "548px"
99106 theme = { createTheme ( CODE_EDITOR_THEME ) }
100107 editable = { false }
101108 value = { outputString }
102109 extensions = { editorExtensions }
103- className = "overflow-auto h-full"
110+ className = "overflow-auto h-full mt-7 "
104111 />
105112 </ div >
106113 </ div >
You can’t perform that action at this time.
0 commit comments