|
|
@ -5,7 +5,7 @@
|
|
|
|
-- the settings store is not yet typed */
|
|
|
|
-- the settings store is not yet typed */
|
|
|
|
import { useCallback } from 'react';
|
|
|
|
import { useCallback } from 'react';
|
|
|
|
|
|
|
|
|
|
|
|
import { FormattedMessage } from 'react-intl';
|
|
|
|
import { FormattedMessage, defineMessages, useIntl } from 'react-intl';
|
|
|
|
|
|
|
|
|
|
|
|
import SettingText from 'flavours/glitch/components/setting_text';
|
|
|
|
import SettingText from 'flavours/glitch/components/setting_text';
|
|
|
|
import { useAppSelector, useAppDispatch } from 'flavours/glitch/store';
|
|
|
|
import { useAppSelector, useAppDispatch } from 'flavours/glitch/store';
|
|
|
@ -13,9 +13,19 @@ import { useAppSelector, useAppDispatch } from 'flavours/glitch/store';
|
|
|
|
import { changeSetting } from '../../../actions/settings';
|
|
|
|
import { changeSetting } from '../../../actions/settings';
|
|
|
|
import SettingToggle from '../../notifications/components/setting_toggle';
|
|
|
|
import SettingToggle from '../../notifications/components/setting_toggle';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const messages = defineMessages({
|
|
|
|
|
|
|
|
filter_regex: {
|
|
|
|
|
|
|
|
id: 'home.column_settings.filter_regex',
|
|
|
|
|
|
|
|
defaultMessage: 'Filter out by regular expressions',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
settings: { id: 'home.settings', defaultMessage: 'Column settings' },
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
export const ColumnSettings: React.FC = () => {
|
|
|
|
export const ColumnSettings: React.FC = () => {
|
|
|
|
const settings = useAppSelector((state) => state.settings.get('home'));
|
|
|
|
const settings = useAppSelector((state) => state.settings.get('home'));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const intl = useIntl();
|
|
|
|
|
|
|
|
|
|
|
|
const dispatch = useAppDispatch();
|
|
|
|
const dispatch = useAppDispatch();
|
|
|
|
const onChange = useCallback(
|
|
|
|
const onChange = useCallback(
|
|
|
|
(key: string, checked: boolean) => {
|
|
|
|
(key: string, checked: boolean) => {
|
|
|
@ -91,12 +101,7 @@ export const ColumnSettings: React.FC = () => {
|
|
|
|
settings={settings}
|
|
|
|
settings={settings}
|
|
|
|
settingPath={['regex', 'body']}
|
|
|
|
settingPath={['regex', 'body']}
|
|
|
|
onChange={onChange}
|
|
|
|
onChange={onChange}
|
|
|
|
label={
|
|
|
|
label={intl.formatMessage(messages.filter_regex)}
|
|
|
|
<FormattedMessage
|
|
|
|
|
|
|
|
id='home.column_settings.filter_regex'
|
|
|
|
|
|
|
|
defaultMessage='Filter out by regular expressions'
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|