show uml in tab

pull/3321/head^2
Joseph Izang 2 years ago committed by Aniket
parent 1828a57936
commit 1eae2d4237
  1. 25
      libs/remix-ui/solidity-uml-gen/src/lib/solidity-uml-gen.tsx

@ -1,4 +1,5 @@
import React, { useEffect, useState } from 'react' import React, { useEffect, useState } from 'react'
import { TransformComponent, TransformWrapper } from 'react-zoom-pan-pinch'
import { ISolidityUmlGen } from '../types' import { ISolidityUmlGen } from '../types'
export interface RemixUiSolidityUmlGenProps { export interface RemixUiSolidityUmlGenProps {
plugin?: ISolidityUmlGen plugin?: ISolidityUmlGen
@ -20,7 +21,7 @@ const ActionButtons = ({ buttons }: ActionButtonsProps) => (
{buttons.map(btn => ( {buttons.map(btn => (
<button <button
key={btn.buttonText} key={btn.buttonText}
className="btn btn-primary btn-lg ml-4 mt-4" className="btn btn-primary btn-sm ml-4 mt-4"
disabled={!btn.svgValid} disabled={!btn.svgValid}
onClick={btn.action} onClick={btn.action}
> >
@ -57,16 +58,22 @@ export function RemixUiSolidityUmlGen ({ plugin, updatedSvg }: RemixUiSolidityUm
} }
] ]
const Display = () => ( const Display = () => (
<div className="d-flex flex-column"> <div className="d-flex flex-column justify-center">
<div className="d-flex justify-center align-content-center"> <div className="d-flex justify-center align-content-center">
<ActionButtons buttons={buttons}/> {/* <ActionButtons buttons={buttons}/> */}
</div> </div>
<div> <div id="umlImageHolder" className="mx-2 my-3 ml-5">
<img { validSvg && showViewer ? (
src={`data:image/svg+xml;base64,${btoa(plugin.updatedSvg ?? svgPayload)}`} <TransformWrapper>
width={800} <TransformComponent>
height={600} <img
/> src={`data:image/svg+xml;base64,${btoa(plugin.updatedSvg ?? svgPayload)}`}
width={900}
height={600}
/>
</TransformComponent>
</TransformWrapper>
) : null}
</div> </div>
</div> </div>
) )

Loading…
Cancel
Save