Skip to content

Commit

Permalink
remove react and yo
Browse files Browse the repository at this point in the history
  • Loading branch information
yann300 committed Dec 21, 2021
1 parent ff1be0e commit 99521ae
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions apps/remix-ide/src/app/tabs/theme-module.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ import { Plugin } from '@remixproject/engine'
import { EventEmitter } from 'events'
import QueryParams from '../../lib/query-params'
import * as packageJson from '../../../../../package.json'
import ReactDOM from 'react-dom'
// eslint-disable-next-line no-use-before-define
import React from 'react'
import yo from 'yo-yo'
const _paq = window._paq = window._paq || []

const themes = [
Expand Down Expand Up @@ -68,7 +64,11 @@ export class ThemeModule extends Plugin {
if (this.active) {
const nextTheme = this.themes[this.active] // Theme
document.documentElement.style.setProperty('--theme', nextTheme.quality)
const theme = yo`<link rel="stylesheet" href="${nextTheme.url}" id="theme-link"/>`

const theme = document.createElement('link')
theme.setAttribute('rel', 'stylesheet')
theme.setAttribute('href', nextTheme.url)
theme.setAttribute('id', 'theme-link')
theme.addEventListener('load', () => {
if (callback) callback()
})
Expand All @@ -91,9 +91,10 @@ export class ThemeModule extends Plugin {
if (!this.forced) this._deps.config.set('settings/theme', next)
document.getElementById('theme-link').remove()
const theme = document.createElement('link')
theme.rel = 'stylesheet'
theme.id = 'theme-link'
theme.href = nextTheme.url

theme.setAttribute('rel', 'stylesheet')
theme.setAttribute('href', nextTheme.url)
theme.setAttribute('id', 'theme-link')
theme.addEventListener('load', () => {
this.emit('themeLoaded', nextTheme)
this.events.emit('themeLoaded', nextTheme)
Expand Down

0 comments on commit 99521ae

Please sign in to comment.