1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-08 21:42:24 +03:00

Break themes out into a separate file

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski
2019-08-12 14:24:12 +01:00
parent 916af736ad
commit 7bdac85a2a
4 changed files with 31 additions and 12 deletions

View File

@@ -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