2017-07-20 11:54:02 +09:00
|
|
|
// Package imports
|
|
|
|
import PropTypes from 'prop-types';
|
2023-05-28 23:38:10 +09:00
|
|
|
import { PureComponent } from 'react';
|
|
|
|
|
2017-07-20 11:54:02 +09:00
|
|
|
import { injectIntl, defineMessages } from 'react-intl';
|
|
|
|
|
2024-01-16 19:27:26 +09:00
|
|
|
import CloseIcon from '@/material-icons/400-24px/close.svg?react';
|
|
|
|
import EditIcon from '@/material-icons/400-24px/edit.svg?react';
|
|
|
|
import ExpandLessIcon from '@/material-icons/400-24px/expand_less.svg?react';
|
|
|
|
import ImageIcon from '@/material-icons/400-24px/image.svg?react';
|
|
|
|
import ManufacturingIcon from '@/material-icons/400-24px/manufacturing.svg?react';
|
|
|
|
import SettingsIcon from '@/material-icons/400-24px/settings-fill.svg?react';
|
2022-10-11 17:41:15 +09:00
|
|
|
import { preferencesLink } from 'flavours/glitch/utils/backend_links';
|
2024-01-13 05:16:48 +09:00
|
|
|
|
2017-07-20 11:54:02 +09:00
|
|
|
|
2023-05-28 23:38:10 +09:00
|
|
|
import LocalSettingsNavigationItem from './item';
|
|
|
|
|
2017-07-20 11:54:02 +09:00
|
|
|
const messages = defineMessages({
|
|
|
|
general: { id: 'settings.general', defaultMessage: 'General' },
|
2019-02-03 08:34:52 +09:00
|
|
|
compose: { id: 'settings.compose_box_opts', defaultMessage: 'Compose box' },
|
2018-08-28 21:10:26 +09:00
|
|
|
content_warnings: { id: 'settings.content_warnings', defaultMessage: 'Content Warnings' },
|
2017-07-20 11:54:02 +09:00
|
|
|
collapsed: { id: 'settings.collapsed_statuses', defaultMessage: 'Collapsed toots' },
|
|
|
|
media: { id: 'settings.media', defaultMessage: 'Media' },
|
|
|
|
preferences: { id: 'settings.preferences', defaultMessage: 'Preferences' },
|
|
|
|
close: { id: 'settings.close', defaultMessage: 'Close' },
|
|
|
|
});
|
|
|
|
|
2023-05-28 21:18:23 +09:00
|
|
|
class LocalSettingsNavigation extends PureComponent {
|
2017-07-20 11:54:02 +09:00
|
|
|
|
|
|
|
static propTypes = {
|
|
|
|
index : PropTypes.number,
|
|
|
|
intl : PropTypes.object.isRequired,
|
|
|
|
onClose : PropTypes.func.isRequired,
|
|
|
|
onNavigate : PropTypes.func.isRequired,
|
|
|
|
};
|
|
|
|
|
|
|
|
render () {
|
|
|
|
|
|
|
|
const { index, intl, onClose, onNavigate } = this.props;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<nav className='glitch local-settings__navigation'>
|
|
|
|
<LocalSettingsNavigationItem
|
|
|
|
active={index === 0}
|
|
|
|
index={0}
|
|
|
|
onNavigate={onNavigate}
|
2018-10-02 05:09:57 +09:00
|
|
|
icon='cogs'
|
2023-10-25 02:45:08 +09:00
|
|
|
iconComponent={ManufacturingIcon}
|
2017-07-20 11:54:02 +09:00
|
|
|
title={intl.formatMessage(messages.general)}
|
|
|
|
/>
|
|
|
|
<LocalSettingsNavigationItem
|
|
|
|
active={index === 1}
|
|
|
|
index={1}
|
|
|
|
onNavigate={onNavigate}
|
2018-10-02 05:09:57 +09:00
|
|
|
icon='pencil'
|
2023-10-25 02:45:08 +09:00
|
|
|
iconComponent={EditIcon}
|
2018-09-07 03:46:42 +09:00
|
|
|
title={intl.formatMessage(messages.compose)}
|
2017-07-20 11:54:02 +09:00
|
|
|
/>
|
|
|
|
<LocalSettingsNavigationItem
|
|
|
|
active={index === 2}
|
|
|
|
index={2}
|
|
|
|
onNavigate={onNavigate}
|
2018-10-02 05:09:57 +09:00
|
|
|
textIcon='CW'
|
2018-09-07 03:46:42 +09:00
|
|
|
title={intl.formatMessage(messages.content_warnings)}
|
2017-07-20 11:54:02 +09:00
|
|
|
/>
|
|
|
|
<LocalSettingsNavigationItem
|
|
|
|
active={index === 3}
|
|
|
|
index={3}
|
2018-08-28 21:10:26 +09:00
|
|
|
onNavigate={onNavigate}
|
2019-07-13 01:27:43 +09:00
|
|
|
icon='angle-double-up'
|
2023-10-25 02:45:08 +09:00
|
|
|
iconComponent={ExpandLessIcon}
|
2019-07-13 01:27:43 +09:00
|
|
|
title={intl.formatMessage(messages.collapsed)}
|
|
|
|
/>
|
|
|
|
<LocalSettingsNavigationItem
|
2022-08-30 17:57:27 +09:00
|
|
|
active={index === 4}
|
|
|
|
index={4}
|
2019-07-13 01:27:43 +09:00
|
|
|
onNavigate={onNavigate}
|
2018-10-02 05:09:57 +09:00
|
|
|
icon='image'
|
2023-10-25 02:45:08 +09:00
|
|
|
iconComponent={ImageIcon}
|
2018-09-07 03:46:42 +09:00
|
|
|
title={intl.formatMessage(messages.media)}
|
|
|
|
/>
|
|
|
|
<LocalSettingsNavigationItem
|
2022-08-30 17:57:27 +09:00
|
|
|
active={index === 5}
|
2023-02-04 04:52:07 +09:00
|
|
|
href={preferencesLink}
|
2022-08-30 17:57:27 +09:00
|
|
|
index={5}
|
2019-06-17 04:04:09 +09:00
|
|
|
icon='cog'
|
2023-10-25 02:45:08 +09:00
|
|
|
iconComponent={SettingsIcon}
|
2017-07-20 11:54:02 +09:00
|
|
|
title={intl.formatMessage(messages.preferences)}
|
|
|
|
/>
|
|
|
|
<LocalSettingsNavigationItem
|
2022-08-30 17:57:27 +09:00
|
|
|
active={index === 6}
|
2017-07-20 11:54:02 +09:00
|
|
|
className='close'
|
2022-08-30 17:57:27 +09:00
|
|
|
index={6}
|
2017-07-20 11:54:02 +09:00
|
|
|
onNavigate={onClose}
|
2018-10-02 05:09:57 +09:00
|
|
|
icon='times'
|
2023-10-25 02:45:08 +09:00
|
|
|
iconComponent={CloseIcon}
|
2017-07-20 11:54:02 +09:00
|
|
|
title={intl.formatMessage(messages.close)}
|
|
|
|
/>
|
|
|
|
</nav>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2023-03-25 07:15:25 +09:00
|
|
|
|
|
|
|
export default injectIntl(LocalSettingsNavigation);
|