import React from 'react'; import { defineMessages, FormattedMessage, useIntl } from 'react-intl'; import { useDispatch } from 'react-redux'; import { getSettings, changeSetting } from 'soapbox/actions/settings'; import List, { ListItem } from 'soapbox/components/list'; import { Form } from 'soapbox/components/ui'; import { SelectDropdown } from 'soapbox/features/forms'; import SettingToggle from 'soapbox/features/notifications/components/setting_toggle'; import { useAppSelector } from 'soapbox/hooks'; const languages = { en: 'English', ar: 'العربية', ast: 'Asturianu', bg: 'Български', bn: 'বাংলা', ca: 'Català', co: 'Corsu', cs: 'Čeština', cy: 'Cymraeg', da: 'Dansk', de: 'Deutsch', el: 'Ελληνικά', 'en-Shaw': '𐑖𐑱𐑝𐑾𐑯', eo: 'Esperanto', es: 'Español', eu: 'Euskara', fa: 'فارسی', fi: 'Suomi', fr: 'Français', ga: 'Gaeilge', gl: 'Galego', he: 'עברית', hi: 'हिन्दी', hr: 'Hrvatski', hu: 'Magyar', hy: 'Հայերեն', id: 'Bahasa Indonesia', io: 'Ido', it: 'Italiano', ja: '日本語', ka: 'ქართული', kk: 'Қазақша', ko: '한국어', lt: 'Lietuvių', lv: 'Latviešu', ml: 'മലയാളം', ms: 'Bahasa Melayu', nl: 'Nederlands', no: 'Norsk', oc: 'Occitan', pl: 'Polski', pt: 'Português', 'pt-BR': 'Português do Brasil', ro: 'Română', ru: 'Русский', sk: 'Slovenčina', sl: 'Slovenščina', sq: 'Shqip', sr: 'Српски', 'sr-Latn': 'Srpski (latinica)', sv: 'Svenska', ta: 'தமிழ்', te: 'తెలుగు', th: 'ไทย', tr: 'Türkçe', uk: 'Українська', zh: '中文', 'zh-CN': '简体中文', 'zh-HK': '繁體中文(香港)', 'zh-TW': '繁體中文(臺灣)', }; const messages = defineMessages({ heading: { id: 'column.preferences', defaultMessage: 'Preferences' }, display_media_default: { id: 'preferences.fields.display_media.default', defaultMessage: 'Hide media marked as sensitive' }, display_media_hide_all: { id: 'preferences.fields.display_media.hide_all', defaultMessage: 'Always hide media' }, display_media_show_all: { id: 'preferences.fields.display_media.show_all', defaultMessage: 'Always show media' }, }); const Preferences = () => { const intl = useIntl(); const dispatch = useDispatch(); // const features = useAppSelector((state) => getFeatures(state.get('instance'))); const settings = useAppSelector((state) => getSettings(state)); const onSelectChange = (event: React.ChangeEvent, path: string[]) => { dispatch(changeSetting(path, event.target.value, intl)); }; // const onDefaultPrivacyChange = (e) => { // dispatch(changeSetting(['defaultPrivacy'], e.target.value)); // } // const onDefaultContentTypeChange = (event: React.ChangeEvent) => { // dispatch(changeSetting(['defaultContentType'], event.target.value)); // }; const onToggleChange = (key: string, checked: boolean) => { dispatch(changeSetting(key, checked, intl)); }; const displayMediaOptions = React.useMemo(() => ({ default: intl.formatMessage(messages.display_media_default), hide_all: intl.formatMessage(messages.display_media_hide_all), show_all: intl.formatMessage(messages.display_media_show_all), }), []); return (
}> }> {/* }> */} }> ) => onSelectChange(event, ['locale'])} /> }> ) => onSelectChange(event, ['displayMedia'])} /> {/* } onChange={this.onDefaultPrivacyChange} > } hint={} checked={settings.get('defaultPrivacy') === 'public'} value='public' /> } hint={} checked={settings.get('defaultPrivacy') === 'unlisted'} value='unlisted' /> } hint={} checked={settings.get('defaultPrivacy') === 'private'} value='private' /> */} {/* {features.richText && ( } onChange={onDefaultContentTypeChange} > } checked={settings.get('defaultContentType') === 'text/plain'} value='text/plain' /> } hint={} checked={settings.get('defaultContentType') === 'text/markdown'} value='text/markdown' /> )} */} {/* }> */} }> }> {/* } path={['missingDescriptionModal']} /> */} }> }> {/* }> */} }> }> {/* }> */} {/* }> */} {/*
} path={['dyslexicFont']} />
*/} {/* } hint={} path={['halloween']} /> */} {/* } hint={} > */}
); }; export { Preferences as default, languages };