added theme switcher

This commit is contained in:
Daniel Shleifman
2021-06-26 21:47:33 +03:00
parent 72ff729ee8
commit ca4f78120c
3 changed files with 20 additions and 13 deletions

View File

@@ -3,6 +3,7 @@ import { useState, memo, useRef, useEffect, useContext } from 'react'
import { useTranslation } from 'react-i18next'
import isEqual from 'lodash/isEqual'
import { DarkModeContext } from 'components/App'
import { THEME_MODES } from 'style/materialUISetup'
import { useCreateCacheMap } from '../customHooks'
import getShortCacheMap from './getShortCacheMap'
@@ -18,7 +19,7 @@ const TorrentCache = ({ cache, isMini }) => {
const cacheMap = useCreateCacheMap(cache)
const settingsTarget = isMini ? 'mini' : 'default'
const { isDarkMode } = useContext(DarkModeContext)
const theme = isDarkMode ? 'dark' : 'light'
const theme = isDarkMode ? THEME_MODES.DARK : THEME_MODES.LIGHT
const {
readerColor,