From d7e2b843cfcd41349851979f2283e364dba44281 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Wed, 4 May 2022 11:05:55 -0500 Subject: [PATCH 1/3] Remove theme feature gating --- .../features/ui/components/profile-dropdown.tsx | 11 +++-------- app/soapbox/utils/features.ts | 4 ---- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/app/soapbox/features/ui/components/profile-dropdown.tsx b/app/soapbox/features/ui/components/profile-dropdown.tsx index d21e491a2..e3c468b13 100644 --- a/app/soapbox/features/ui/components/profile-dropdown.tsx +++ b/app/soapbox/features/ui/components/profile-dropdown.tsx @@ -7,7 +7,7 @@ import { Link } from 'react-router-dom'; import { logOut, switchAccount } from 'soapbox/actions/auth'; import { fetchOwnAccounts } from 'soapbox/actions/auth'; import { Menu, MenuButton, MenuDivider, MenuItem, MenuLink, MenuList } from 'soapbox/components/ui'; -import { useAppSelector, useFeatures, useSettings } from 'soapbox/hooks'; +import { useAppSelector, useFeatures } from 'soapbox/hooks'; import { makeGetAccount } from 'soapbox/selectors'; import Account from '../../../components/account'; @@ -39,7 +39,6 @@ const getAccount = makeGetAccount(); const ProfileDropdown: React.FC = ({ account, children }) => { const dispatch = useDispatch(); const features = useFeatures(); - const settings = useSettings(); const intl = useIntl(); const authUsers = useAppSelector((state) => state.auth.get('users')); @@ -79,12 +78,8 @@ const ProfileDropdown: React.FC = ({ account, children }) => { } }); - if (features.darkMode || settings.get('isDeveloper')) { - menu.push({ text: null }); - - menu.push({ text: intl.formatMessage(messages.theme), toggle: }); - } - + menu.push({ text: null }); + menu.push({ text: intl.formatMessage(messages.theme), toggle: }); menu.push({ text: null }); menu.push({ diff --git a/app/soapbox/utils/features.ts b/app/soapbox/utils/features.ts index 7de80ac9c..34691da4c 100644 --- a/app/soapbox/utils/features.ts +++ b/app/soapbox/utils/features.ts @@ -188,10 +188,6 @@ const getInstanceFeatures = (instance: Instance) => { v.software === PIXELFED, ]), - // FIXME: long-term this shouldn't be a feature, - // but for now we want it to be overrideable in the build - darkMode: true, - /** * Legacy DMs timeline where messages are displayed chronologically without groupings. * @see GET /api/v1/timelines/direct From 1375c62fc14b6aabb4509165a1934015fefe8093 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Wed, 4 May 2022 11:11:47 -0500 Subject: [PATCH 2/3] Add ThemeToggle to Preferences --- app/soapbox/features/preferences/index.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/soapbox/features/preferences/index.tsx b/app/soapbox/features/preferences/index.tsx index 1fab5ca74..9f02734f7 100644 --- a/app/soapbox/features/preferences/index.tsx +++ b/app/soapbox/features/preferences/index.tsx @@ -9,6 +9,8 @@ import { SelectDropdown } from 'soapbox/features/forms'; import SettingToggle from 'soapbox/features/notifications/components/setting_toggle'; import { useAppSelector } from 'soapbox/hooks'; +import ThemeToggle from '../ui/components/theme-toggle'; + const languages = { en: 'English', ar: 'العربية', @@ -125,13 +127,13 @@ const Preferences = () => { > - - {/* }> - - */} + }> + + + }> Date: Wed, 4 May 2022 11:16:35 -0500 Subject: [PATCH 3/3] HomePage: fix dark divider below Composer --- app/soapbox/pages/home_page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/soapbox/pages/home_page.tsx b/app/soapbox/pages/home_page.tsx index baffc34da..9e81f88bf 100644 --- a/app/soapbox/pages/home_page.tsx +++ b/app/soapbox/pages/home_page.tsx @@ -35,7 +35,7 @@ const HomePage: React.FC = ({ children }) => { return ( <> - + {me && (