Merge branch 'theme-gate' into 'develop'
Dark theme fixes See merge request soapbox-pub/soapbox-fe!1308
This commit is contained in:
commit
a9a5ab115e
4 changed files with 10 additions and 17 deletions
|
@ -9,6 +9,8 @@ import { SelectDropdown } from 'soapbox/features/forms';
|
||||||
import SettingToggle from 'soapbox/features/notifications/components/setting_toggle';
|
import SettingToggle from 'soapbox/features/notifications/components/setting_toggle';
|
||||||
import { useAppSelector } from 'soapbox/hooks';
|
import { useAppSelector } from 'soapbox/hooks';
|
||||||
|
|
||||||
|
import ThemeToggle from '../ui/components/theme-toggle';
|
||||||
|
|
||||||
const languages = {
|
const languages = {
|
||||||
en: 'English',
|
en: 'English',
|
||||||
ar: 'العربية',
|
ar: 'العربية',
|
||||||
|
@ -125,13 +127,13 @@ const Preferences = () => {
|
||||||
>
|
>
|
||||||
<SettingToggle settings={settings} settingPath={['home', 'shows', 'reply']} onChange={onToggleChange} />
|
<SettingToggle settings={settings} settingPath={['home', 'shows', 'reply']} onChange={onToggleChange} />
|
||||||
</ListItem>
|
</ListItem>
|
||||||
|
|
||||||
{/* <ListItem label={<FormattedMessage id='home.column_settings.show_direct' defaultMessage='Show direct messages' />}>
|
|
||||||
<SettingToggle settings={settings} settingPath={['home', 'shows', 'direct']} onChange={onToggleChange} />
|
|
||||||
</ListItem> */}
|
|
||||||
</List>
|
</List>
|
||||||
|
|
||||||
<List>
|
<List>
|
||||||
|
<ListItem label={<FormattedMessage id='preferences.fields.theme' defaultMessage='Theme' />}>
|
||||||
|
<ThemeToggle />
|
||||||
|
</ListItem>
|
||||||
|
|
||||||
<ListItem label={<FormattedMessage id='preferences.fields.language_label' defaultMessage='Language' />}>
|
<ListItem label={<FormattedMessage id='preferences.fields.language_label' defaultMessage='Language' />}>
|
||||||
<SelectDropdown
|
<SelectDropdown
|
||||||
items={languages}
|
items={languages}
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { Link } from 'react-router-dom';
|
||||||
import { logOut, switchAccount } from 'soapbox/actions/auth';
|
import { logOut, switchAccount } from 'soapbox/actions/auth';
|
||||||
import { fetchOwnAccounts } from 'soapbox/actions/auth';
|
import { fetchOwnAccounts } from 'soapbox/actions/auth';
|
||||||
import { Menu, MenuButton, MenuDivider, MenuItem, MenuLink, MenuList } from 'soapbox/components/ui';
|
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 { makeGetAccount } from 'soapbox/selectors';
|
||||||
|
|
||||||
import Account from '../../../components/account';
|
import Account from '../../../components/account';
|
||||||
|
@ -39,7 +39,6 @@ const getAccount = makeGetAccount();
|
||||||
const ProfileDropdown: React.FC<IProfileDropdown> = ({ account, children }) => {
|
const ProfileDropdown: React.FC<IProfileDropdown> = ({ account, children }) => {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const features = useFeatures();
|
const features = useFeatures();
|
||||||
const settings = useSettings();
|
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
|
|
||||||
const authUsers = useAppSelector((state) => state.auth.get('users'));
|
const authUsers = useAppSelector((state) => state.auth.get('users'));
|
||||||
|
@ -79,12 +78,8 @@ const ProfileDropdown: React.FC<IProfileDropdown> = ({ account, children }) => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (features.darkMode || settings.get('isDeveloper')) {
|
|
||||||
menu.push({ text: null });
|
menu.push({ text: null });
|
||||||
|
|
||||||
menu.push({ text: intl.formatMessage(messages.theme), toggle: <ThemeToggle /> });
|
menu.push({ text: intl.formatMessage(messages.theme), toggle: <ThemeToggle /> });
|
||||||
}
|
|
||||||
|
|
||||||
menu.push({ text: null });
|
menu.push({ text: null });
|
||||||
|
|
||||||
menu.push({
|
menu.push({
|
||||||
|
|
|
@ -35,7 +35,7 @@ const HomePage: React.FC = ({ children }) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Layout.Main className='divide-y divide-gray-200 divide-solid sm:divide-none'>
|
<Layout.Main className='divide-y divide-gray-200 dark:divide-slate-700 divide-solid sm:divide-none'>
|
||||||
{me && (
|
{me && (
|
||||||
<Card variant='rounded' ref={composeBlock}>
|
<Card variant='rounded' ref={composeBlock}>
|
||||||
<CardBody>
|
<CardBody>
|
||||||
|
|
|
@ -188,10 +188,6 @@ const getInstanceFeatures = (instance: Instance) => {
|
||||||
v.software === PIXELFED,
|
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.
|
* Legacy DMs timeline where messages are displayed chronologically without groupings.
|
||||||
* @see GET /api/v1/timelines/direct
|
* @see GET /api/v1/timelines/direct
|
||||||
|
|
Loading…
Reference in a new issue