fix linting issues

pull/5370/head
Joseph Izang 3 years ago committed by yann300
parent 252178b4d6
commit b82df8748c
  1. 2
      apps/remix-ide/src/app/tabs/theme-module.js
  2. 8
      libs/remix-ui/theme-module/src/lib/remix-ui-theme-module.tsx

@ -105,7 +105,7 @@ export class ThemeModule extends Plugin {
throw new Error(`Theme ${themeName} doesn't exist`) throw new Error(`Theme ${themeName} doesn't exist`)
} }
const next = themeName || this.active // Name const next = themeName || this.active // Name
if (next === this.active) return if (next === this.active) return // --> exit out of this method
_paq.push(['trackEvent', 'themeModule', 'switchTo', next]) _paq.push(['trackEvent', 'themeModule', 'switchTo', next])
const nextTheme = this.themes[next] // Theme const nextTheme = this.themes[next] // Theme
if (!this.forced) this._deps.config.set('settings/theme', next) if (!this.forced) this._deps.config.set('settings/theme', next)

@ -58,13 +58,11 @@ const defaultThemes = [
]; ];
export function RemixUiThemeModule({ themeModule }: RemixUiThemeModuleProps) { export function RemixUiThemeModule({ themeModule }: RemixUiThemeModuleProps) {
const [themeName, setThemeName] = useState(''); const [themeName, setThemeName] = useState('')
const [themes, _] = useState<Theme[]>(defaultThemes);
const themeRef = useRef<any>(null);
useEffect(() => { useEffect(() => {
themeModule.switchTheme() themeModule.switchTheme()
}, [themeName, themeModule]); }, [themeName, themeModule])
return ( return (
<div className="border-top"> <div className="border-top">
@ -102,7 +100,7 @@ export function RemixUiThemeModule({ themeModule }: RemixUiThemeModuleProps) {
</div> </div>
</div> </div>
</div> </div>
); )
} }
export default RemixUiThemeModule; export default RemixUiThemeModule;

Loading…
Cancel
Save