fix button style to badge as per @LianaHus

pull/3363/head
Joseph Izang 2 years ago committed by Aniket
parent 6874ea8947
commit 49befc38bc
  1. 8
      apps/remix-ide/src/app/plugins/solidity-umlgen.tsx
  2. 19
      libs/remix-ui/solidity-uml-gen/src/lib/solidity-uml-gen.tsx

@ -72,7 +72,7 @@ export class SolidityUmlGen extends ViewPlugin implements ISolidityUmlGen {
const currentTheme: ThemeQualityType = await this.call('theme', 'currentTheme') const currentTheme: ThemeQualityType = await this.call('theme', 'currentTheme')
this.currentlySelectedTheme = currentTheme.quality this.currentlySelectedTheme = currentTheme.quality
this.themeName = currentTheme.name this.themeName = currentTheme.name
let result = '' let result
try { try {
if (data.sources && Object.keys(data.sources).length > 1) { // we should flatten first as there are multiple asts if (data.sources && Object.keys(data.sources).length > 1) { // we should flatten first as there are multiple asts
result = await this.flattenContract(source, this.currentFile, data) result = await this.flattenContract(source, this.currentFile, data)
@ -134,12 +134,12 @@ export class SolidityUmlGen extends ViewPlugin implements ISolidityUmlGen {
*/ */
async flattenContract (source: any, filePath: string, data: any) { async flattenContract (source: any, filePath: string, data: any) {
const hold = { data, source, filePath } const hold = { data, source, filePath }
const ast = data.sources const ast = hold.data.sources
const dependencyGraph = getDependencyGraph(ast, filePath) const dependencyGraph = getDependencyGraph(ast, hold.filePath)
const sorted = dependencyGraph.isEmpty() const sorted = dependencyGraph.isEmpty()
? [filePath] ? [filePath]
: dependencyGraph.sort().reverse() : dependencyGraph.sort().reverse()
const sources = source.sources const sources = hold.source.sources
const result = concatSourceFiles(sorted, sources) const result = concatSourceFiles(sorted, sources)
await this.call('fileManager', 'writeFile', `${filePath}_flattened.sol`, result) await this.call('fileManager', 'writeFile', `${filePath}_flattened.sol`, result)
return result return result

@ -40,19 +40,6 @@ export function RemixUiSolidityUmlGen ({ updatedSvg, loading, plugin }: RemixUiS
const final = btoa(String.fromCharCode.apply(null, data)) const final = btoa(String.fromCharCode.apply(null, data))
function ActionButtons({ actions: { zoomIn, zoomOut, resetTransform }}: ActionButtonsProps) { function ActionButtons({ actions: { zoomIn, zoomOut, resetTransform }}: ActionButtonsProps) {
const [reloadButton, setReloadButton] = useState(false)
useEffect(() => {
plugin.on('theme', 'themeChanged', (themeName) => {
console.log('theme changed', themeName)
setReloadButton(true)
})
return () => {
plugin.off('theme', 'themeChanged')
console.log('unmounted')
}
}, [])
return ( return (
<> <>
@ -69,19 +56,19 @@ export function RemixUiSolidityUmlGen ({ updatedSvg, loading, plugin }: RemixUiS
<i className="far fa-arrow-to-bottom align-item-center d-flex justify-content-center"></i> <i className="far fa-arrow-to-bottom align-item-center d-flex justify-content-center"></i>
</button> </button>
<button <button
className="btn btn-outline-info align-item-center d-flex justify-content-center rounded-circle mr-2" className="badge badge-info p-2 align-item-center d-flex justify-content-center rounded-circle mr-2"
onClick={() => zoomIn()} onClick={() => zoomIn()}
> >
<i className="far fa-plus "></i> <i className="far fa-plus "></i>
</button> </button>
<button <button
className="btn btn-outline-info rounded-circle mr-2" className="badge badge-info p-2 rounded-circle mr-2"
onClick={() => zoomOut()} onClick={() => zoomOut()}
> >
<i className="far fa-minus align-item-center d-flex justify-content-center"></i> <i className="far fa-minus align-item-center d-flex justify-content-center"></i>
</button> </button>
<button <button
className="btn btn-outline-info rounded-circle mr-2" className="badge badge-info p-2 rounded-circle mr-2"
onClick={() => resetTransform()} onClick={() => resetTransform()}
> >
<i className="far fa-undo align-item-center d-flex justify-content-center"></i> <i className="far fa-undo align-item-center d-flex justify-content-center"></i>

Loading…
Cancel
Save