add react viewer to solidityumlgen react lib

pull/3321/head^2
Joseph Izang 2 years ago committed by Aniket
parent 20773a8342
commit ea6532967a
  1. 19
      libs/remix-ui/solidity-uml-gen/src/lib/solidity-uml-gen.tsx

@ -1,13 +1,28 @@
import React from 'react'
import React, { useState } from 'react'
import Viewer from 'react-viewer'
export interface RemixUiSolidityUmlGenProps {
plugin: any
}
export function RemixUiSolidityUmlGen ({ plugin }: RemixUiSolidityUmlGenProps) {
const [showViewer, setShowViewer] = useState(false)
const [svgPayload, setSVGPayload] = useState('')
return (
<div>
<h1>Solidity 2 UML Generator View!</h1>
<Viewer
visible={showViewer}
rotatable={false}
loop={false}
noClose={false}
onClose={() => setShowViewer(false)}
noFooter={true}
showTotal={false}
changeable={false}
zoomSpeed={0.2}
minScale={1}
images={[{src: `data:image/svg+xml;base64,${btoa(svgPayload)}`}]}
/>
</div>
)
}

Loading…
Cancel
Save