diff --git a/apps/remix-ide/src/app/plugins/solidity-umlgen.tsx b/apps/remix-ide/src/app/plugins/solidity-umlgen.tsx index 865fde147e..5e955d42db 100644 --- a/apps/remix-ide/src/app/plugins/solidity-umlgen.tsx +++ b/apps/remix-ide/src/app/plugins/solidity-umlgen.tsx @@ -25,16 +25,16 @@ const profile = { } const themeCollection = [ - { themeName: 'HackerOwl', backgroundColor: '--body-bg', actualHex: '#011628'}, - { themeName: 'Cerulean', backgroundColor: '--body-bg', actualHex: '#fff'}, - { themeName: 'Cyborg', backgroundColor: '--body-bg', actualHex: '#060606'}, - { themeName: 'Dark', backgroundColor: '--body-bg', actualHex: '#222336'}, - { themeName: 'Flatly', backgroundColor: '--body-bg', actualHex: '#fff'}, - { themeName: 'Black', backgroundColor: '--body-bg', actualHex: '#1a1a1a'}, - { themeName: 'Light', backgroundColor: '--body-bg', actualHex: '#eef1f6'}, - { themeName: 'Midcentuary', backgroundColor: '--body-bg', actualHex: '#DBE2E0'}, - { themeName: 'Spacelab', backgroundColor: '--body-bg', actualHex: '#fff'}, - { themeName: 'Candy', backgroundColor: '--body-bg', actualHex: '#d5efff'}, + { themeName: 'HackerOwl', backgroundColor: '--body-bg', actualHex: '#011628', dark: '#fff4fd'}, + { themeName: 'Cerulean', backgroundColor: '--body-bg', actualHex: '#fff', dark: '#343a40'}, + { themeName: 'Cyborg', backgroundColor: '--body-bg', actualHex: '#060606', dark: '#adafae'}, + { themeName: 'Dark', backgroundColor: '--body-bg', actualHex: '#222336', dark: '#222336'}, + { themeName: 'Flatly', backgroundColor: '--body-bg', actualHex: '#fff', dark: '#7b8a8b'}, + { themeName: 'Black', backgroundColor: '--body-bg', actualHex: '#1a1a1a', dark: '#1a1a1a'}, + { themeName: 'Light', backgroundColor: '--body-bg', actualHex: '#eef1f6', dark: '#f8fafe'}, + { themeName: 'Midcentuary', backgroundColor: '--body-bg', actualHex: '#DBE2E0', dark: '#01414E'}, + { themeName: 'Spacelab', backgroundColor: '--body-bg', actualHex: '#fff', dark: '#333'}, + { themeName: 'Candy', backgroundColor: '--body-bg', actualHex: '#d5efff', dark: '#645fb5'}, ] /** @@ -49,6 +49,7 @@ export class SolidityUmlGen extends ViewPlugin implements ISolidityUmlGen { updatedSvg: string currentlySelectedTheme: string themeName: string + themeDark: string loading: boolean themeCollection: ThemeSummary[] triggerGenerateUml: boolean @@ -95,8 +96,14 @@ export class SolidityUmlGen extends ViewPlugin implements ISolidityUmlGen { console.log('error', error) } }) - this.on('theme', 'themeChanged', (theme) => { + this.on('theme', 'themeChanged', async (theme) => { this.currentlySelectedTheme = theme.quality + const themeQuality: ThemeQualityType = await this.call('theme', 'currentTheme') + themeCollection.forEach((theme) => { + if (theme.themeName === themeQuality.name) { + this.themeDark = theme.dark + } + }) this.renderComponent() }) } @@ -175,6 +182,7 @@ export class SolidityUmlGen extends ViewPlugin implements ISolidityUmlGen { loading: this.loading, themeSelected: this.currentlySelectedTheme, themeName: this.themeName, + themeDark: this.themeDark, fileName: this.currentFile, themeCollection: this.themeCollection }) @@ -188,6 +196,7 @@ export class SolidityUmlGen extends ViewPlugin implements ISolidityUmlGen { themeName={state.themeName} fileName={state.fileName} themeCollection={state.themeCollection} + themeDark={state.themeDark} /> } } 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 d148c89ea2..a7839dc9b4 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 @@ -1,5 +1,6 @@ import React, { Fragment, useCallback, useEffect, useState } from 'react' import { TransformComponent, TransformWrapper } from 'react-zoom-pan-pinch' +import { GlassMagnifier, MagnifierContainer } from 'react-image-magnifiers' import { ThemeSummary } from '../types' import UmlDownload from './components/UmlDownload' import './css/solidity-uml-gen.css' @@ -9,6 +10,7 @@ export interface RemixUiSolidityUmlGenProps { loading?: boolean themeSelected?: string themeName: string + themeDark: string fileName: string themeCollection: ThemeSummary[] } @@ -22,7 +24,7 @@ interface ActionButtonsProps { } let umlCopy = '' -export function RemixUiSolidityUmlGen ({ updatedSvg, loading, fileName }: RemixUiSolidityUmlGenProps) { +export function RemixUiSolidityUmlGen ({ updatedSvg, loading, fileName, themeDark }: RemixUiSolidityUmlGenProps) { const [showViewer, setShowViewer] = useState(false) const [validSvg, setValidSvg] = useState(false) const umlDownloader = new UmlDownloadContext() @@ -99,26 +101,28 @@ export function RemixUiSolidityUmlGen ({ updatedSvg, loading, fileName }: RemixU return (