diff --git a/app/soapbox/features/ui/components/navbar.tsx b/app/soapbox/features/ui/components/navbar.tsx index d01b2fd273..8b7f9286b7 100644 --- a/app/soapbox/features/ui/components/navbar.tsx +++ b/app/soapbox/features/ui/components/navbar.tsx @@ -7,7 +7,7 @@ import { Link } from 'react-router-dom'; import { Avatar, Button, Icon } from 'soapbox/components/ui'; import Search from 'soapbox/features/compose/components/search'; import ThemeToggle from 'soapbox/features/ui/components/theme_toggle'; -import { useOwnAccount, useSoapboxConfig, useSettings } from 'soapbox/hooks'; +import { useOwnAccount, useSoapboxConfig, useSettings, useFeatures } from 'soapbox/hooks'; import { openSidebar } from '../../../actions/sidebar'; @@ -19,6 +19,7 @@ const Navbar = () => { const account = useOwnAccount(); const settings = useSettings(); + const features = useFeatures(); const soapboxConfig = useSoapboxConfig(); const singleUserMode = soapboxConfig.get('singleUserMode'); @@ -68,7 +69,8 @@ const Navbar = () => {
- {settings.get('isDeveloper') && ( + {/* TODO: make this available for everyone when it's ready (possibly in a different place) */} + {(features.darkMode || settings.get('isDeveloper')) && ( )} diff --git a/app/soapbox/features/ui/components/theme_toggle.tsx b/app/soapbox/features/ui/components/theme_toggle.tsx index 5f04be8484..e8c63c60f9 100644 --- a/app/soapbox/features/ui/components/theme_toggle.tsx +++ b/app/soapbox/features/ui/components/theme_toggle.tsx @@ -37,8 +37,8 @@ function ThemeToggle({ showLabel }: IThemeToggle) { id={id} checked={themeMode === 'light'} icons={{ - checked: , - unchecked: , + checked: , + unchecked: , }} onChange={onToggle} /> diff --git a/app/soapbox/utils/features.ts b/app/soapbox/utils/features.ts index e1c5d12e0a..4680156962 100644 --- a/app/soapbox/utils/features.ts +++ b/app/soapbox/utils/features.ts @@ -134,6 +134,10 @@ const getInstanceFeatures = (instance: Instance) => { trendingTruths: v.software === TRUTHSOCIAL, trendingStatuses: v.software === MASTODON && gte(v.compatVersion, '3.5.0'), pepe: v.software === TRUTHSOCIAL, + + // FIXME: long-term this shouldn't be a feature, + // but for now we want it to be overrideable in the build + darkMode: true, }; }; diff --git a/app/styles/components/theme-toggle.scss b/app/styles/components/theme-toggle.scss index 5b59d80b19..112c149720 100644 --- a/app/styles/components/theme-toggle.scss +++ b/app/styles/components/theme-toggle.scss @@ -27,8 +27,11 @@ } } - .svg-icon { - width: 18px; - height: 18px; + .react-toggle-track { + @apply dark:bg-slate-600; + } + + .react-toggle-thumb { + @apply dark:bg-slate-900 dark:border-slate-800; } }