fix multiple onClick handlers

pull/3395/head
Joseph Izang 2 years ago
parent 9861d4c96c
commit 639e5604db
  1. 21
      libs/remix-ui/solidity-uml-gen/src/lib/components/UmlDownload.tsx

@ -55,7 +55,12 @@ export default function UmlDownload(props: UmlDownloadProps) {
> >
</Dropdown.Toggle> </Dropdown.Toggle>
<Dropdown.Menu as={UmlCustomMenu} className="custom-dropdown-items"> <Dropdown.Menu as={UmlCustomMenu} className="custom-dropdown-items">
<Dropdown.Item onClick={() => props.download('png')}> <Dropdown.Item
onClick={() => {
_paq.push(['trackEvent', 'solidityumlgen', 'download', 'downloadAsPng'])
props.download('png')
}}
>
<CustomTooltip <CustomTooltip
placement="left-start" placement="left-start"
tooltipId="solUmlgenDownloadAsPngTooltip" tooltipId="solUmlgenDownloadAsPngTooltip"
@ -64,10 +69,6 @@ export default function UmlDownload(props: UmlDownloadProps) {
> >
<div <div
data-id='umlPngDownload' data-id='umlPngDownload'
onClick={() => {
_paq.push(['trackEvent', 'solidityumlgen', 'download', 'downloadAsPng'])
props.download('png')
}}
> >
<span <span
id='umlPngDownloadBtn' id='umlPngDownloadBtn'
@ -82,7 +83,11 @@ export default function UmlDownload(props: UmlDownloadProps) {
</CustomTooltip> </CustomTooltip>
</Dropdown.Item> </Dropdown.Item>
<Dropdown.Divider /> <Dropdown.Divider />
<Dropdown.Item onClick={() => props.download('pdf')}> <Dropdown.Item onClick={() => {
_paq.push(['trackEvent', 'solUmlgen', 'download', 'downloadAsPdf'])
props.download('pdf')
}}
>
<CustomTooltip <CustomTooltip
placement="left-start" placement="left-start"
tooltipId="solUmlgenDownloadAsPdfTooltip" tooltipId="solUmlgenDownloadAsPdfTooltip"
@ -91,10 +96,6 @@ export default function UmlDownload(props: UmlDownloadProps) {
> >
<div <div
data-id='umlPdfDownload' data-id='umlPdfDownload'
onClick={() => {
_paq.push(['trackEvent', 'solUmlgen', 'download', 'downloadAsPdf'])
props.download('pdf')
}}
> >
<span <span
id='umlPdfDownloadBtn' id='umlPdfDownloadBtn'

Loading…
Cancel
Save