From 81922231ed638764083610889b7ffafc3a7467ad Mon Sep 17 00:00:00 2001 From: Jorik Schellekens Date: Thu, 28 May 2020 13:55:07 +0100 Subject: [PATCH] Move Appearance tab to ts --- src/components/structures/MatrixChat.tsx | 4 +- src/components/views/elements/Field.tsx | 2 +- ...gsTab.js => AppearanceUserSettingsTab.tsx} | 133 ++++++++++------- src/dispatcher/actions.ts | 5 + .../payloads/RecheckThemePayload.ts | 27 ++++ .../watchers/FontWatcher.ts} | 36 +++-- src/settings/watchers/ThemeWatcher.ts | 138 ++++++++++++++++++ src/settings/watchers/Watcher.ts | 20 +++ src/theme.js | 110 +------------- 9 files changed, 295 insertions(+), 180 deletions(-) rename src/components/views/settings/tabs/user/{AppearanceUserSettingsTab.js => AppearanceUserSettingsTab.tsx} (73%) create mode 100644 src/dispatcher/payloads/RecheckThemePayload.ts rename src/{FontWatcher.js => settings/watchers/FontWatcher.ts} (51%) create mode 100644 src/settings/watchers/ThemeWatcher.ts create mode 100644 src/settings/watchers/Watcher.ts diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx index 1200fcaf7a..f6848feb03 100644 --- a/src/components/structures/MatrixChat.tsx +++ b/src/components/structures/MatrixChat.tsx @@ -58,8 +58,8 @@ import ResizeNotifier from "../../utils/ResizeNotifier"; import AutoDiscoveryUtils, { ValidatedServerConfig } from "../../utils/AutoDiscoveryUtils"; import DMRoomMap from '../../utils/DMRoomMap'; import { countRoomsWithNotif } from '../../RoomNotifs'; -import { ThemeWatcher } from "../../theme"; -import { FontWatcher } from '../../FontWatcher'; +import ThemeWatcher from "../../settings/watchers/ThemeWatcher"; +import { FontWatcher } from '../../settings/watchers/FontWatcher'; import { storeRoomAliasInCache } from '../../RoomAliasCache'; import { defer, IDeferred } from "../../utils/promise"; import ToastStore from "../../stores/ToastStore"; diff --git a/src/components/views/elements/Field.tsx b/src/components/views/elements/Field.tsx index 39ed2df9f9..771d2182ea 100644 --- a/src/components/views/elements/Field.tsx +++ b/src/components/views/elements/Field.tsx @@ -34,7 +34,7 @@ interface IProps extends React.InputHTMLAttributes