File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,9 @@ import { Tooltip } from "../lib";
44
55const CopiableExample : React . FC = ( ) => (
66 < >
7- < Copiable copiableContent = "Copied text" > Copiable text</ Copiable >
7+ < Copiable copiableContent = "Copied text" iconPlacement = "left" >
8+ Copiable text
9+ </ Copiable >
810 < Copiable
911 copiableContent = "0xbe8d95497E53aB41d5A45CC8def90d0e59b49f99"
1012 info = "Copy Address"
Original file line number Diff line number Diff line change @@ -7,13 +7,16 @@ import Copied from "../../assets/svgs/copiable/copied.svg";
77interface CopiableBaseProps {
88 copiableContent : string ;
99 info ?: string ;
10+ iconPlacement ?: "left" | "right" ;
1011}
1112
12- const Wrapper = styled . div `
13+ const Wrapper = styled . div < { iconPlacement : string } > `
1314 position: relative;
1415 display: inline-flex;
1516 align-items: center;
1617 gap: 8px;
18+ flex-direction: ${ ( { iconPlacement } ) =>
19+ iconPlacement === "left" ? "row-reverse" : "row" } ;
1720` ;
1821
1922const StyledTooltip = styled ( Tooltip ) `
@@ -46,6 +49,7 @@ const Copiable: React.FC<CopiableProps> = ({
4649 info,
4750 children,
4851 tooltipProps,
52+ iconPlacement = "right" ,
4953 ...props
5054} ) => {
5155 const [ isCopied , setIsCopied ] = useState ( false ) ;
@@ -61,7 +65,7 @@ const Copiable: React.FC<CopiableProps> = ({
6165 } ;
6266
6367 return (
64- < Wrapper { ...props } >
68+ < Wrapper { ...props } iconPlacement = { iconPlacement } >
6569 { children }
6670 < StyledTooltip
6771 text = { isCopied ? "Copied!" : `${ info ?? "Copy" } ` }
You can’t perform that action at this time.
0 commit comments