diff --git a/libs/remix-ui/solidity-uml-gen/src/lib/components/UmlDownload.tsx b/libs/remix-ui/solidity-uml-gen/src/lib/components/UmlDownload.tsx index 77649bde93..55b3b7b44a 100644 --- a/libs/remix-ui/solidity-uml-gen/src/lib/components/UmlDownload.tsx +++ b/libs/remix-ui/solidity-uml-gen/src/lib/components/UmlDownload.tsx @@ -1,7 +1,6 @@ import { CustomTooltip } from '@remix-ui/helper' import React, { Fragment, Ref } from 'react' import { Dropdown } from 'react-bootstrap' -import { FormattedMessage } from 'react-intl' const _paq = window._paq = window._paq || [] @@ -39,16 +38,12 @@ export const UmlCustomMenu = React.forwardRef( }, ) -export default function UmlDownload() { - - const downloadAsPng = () => { - // convert serialized svg to png and download - - } +interface UmlDownloadProps { + downloadAsPng: () => void + downloadAsPdf: () => void +} - const downloadAsPdf = () => { - // convert serialized svg to pdf and download - } +export default function UmlDownload(props: UmlDownloadProps) { return( @@ -60,7 +55,7 @@ export default function UmlDownload() { > - + { _paq.push(['trackEvent', 'solUmlgen', 'download', 'downloadAsPng']) + props.downloadAsPng() }} > { _paq.push(['trackEvent', 'solUmlgen', 'download', 'downloadAsPng']) + props.downloadAsPng() }} className='far fa-image pl-2' > @@ -89,7 +86,7 @@ export default function UmlDownload() { - + { _paq.push(['trackEvent', 'solUmlgen', 'download', 'downloadAsPdf']) - downloadAsPdf() + props.downloadAsPdf() }} > { _paq.push(['trackEvent', 'solUmlgen', 'download', 'downloadAsPdf']) + props.downloadAsPdf() }} className='far fa-file-pdf pl-2' > diff --git a/libs/remix-ui/solidity-uml-gen/src/lib/solidity-uml-gen.tsx b/libs/remix-ui/solidity-uml-gen/src/lib/solidity-uml-gen.tsx index 89108f32a8..1788f141b1 100644 --- a/libs/remix-ui/solidity-uml-gen/src/lib/solidity-uml-gen.tsx +++ b/libs/remix-ui/solidity-uml-gen/src/lib/solidity-uml-gen.tsx @@ -38,6 +38,15 @@ export function RemixUiSolidityUmlGen ({ updatedSvg, loading }: RemixUiSolidityU const data = encoder.encode(updatedSvg) const final = btoa(String.fromCharCode.apply(null, data)) + const downloadAsPng = () => { + // convert serialized svg to png and download + + } + + const downloadAsPdf = () => { + // convert serialized svg to pdf and download + } + function ActionButtons({ actions: { zoomIn, zoomOut, resetTransform }}: ActionButtonsProps) { return ( @@ -48,7 +57,7 @@ export function RemixUiSolidityUmlGen ({ updatedSvg, loading }: RemixUiSolidityU style={{ zIndex: 3, top: "10", right: "2em" }} >
- +