Break themes out into a separate file
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
916af736ad
commit
7bdac85a2a
4 changed files with 31 additions and 12 deletions
|
@ -16,18 +16,13 @@ limitations under the License.
|
|||
*/
|
||||
|
||||
import SettingController from "./SettingController";
|
||||
import {_td} from "../../languageHandler";
|
||||
|
||||
export const SUPPORTED_THEMES = {
|
||||
"light": _td("Light theme"),
|
||||
"dark": _td("Dark theme"),
|
||||
};
|
||||
import {DEFAULT_THEME, THEMES} from "../../themes";
|
||||
|
||||
export default class ThemeController extends SettingController {
|
||||
getValueOverride(level, roomId, calculatedValue, calculatedAtLevel) {
|
||||
// Override in case some no longer supported theme is stored here
|
||||
if (!SUPPORTED_THEMES[calculatedValue]) {
|
||||
return "light";
|
||||
if (!THEMES[calculatedValue]) {
|
||||
return DEFAULT_THEME;
|
||||
}
|
||||
|
||||
return null; // no override
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue