2017-07-19 19:54:02 -07:00
|
|
|
// Package imports
|
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import { injectIntl, defineMessages } from 'react-intl';
|
|
|
|
|
|
|
|
// Our imports
|
|
|
|
import LocalSettingsNavigationItem from './item';
|
2018-09-25 05:46:14 -07:00
|
|
|
import { preferencesLink } from 'flavours/glitch/util/backend_links';
|
2017-07-19 19:54:02 -07:00
|
|
|
|
|
|
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
|
|
|
|
|
|
const messages = defineMessages({
|
|
|
|
general: { id: 'settings.general', defaultMessage: 'General' },
|
2019-02-02 15:34:52 -08:00
|
|
|
compose: { id: 'settings.compose_box_opts', defaultMessage: 'Compose box' },
|
2018-08-28 05:10:26 -07:00
|
|
|
content_warnings: { id: 'settings.content_warnings', defaultMessage: 'Content Warnings' },
|
2019-07-12 09:27:43 -07:00
|
|
|
filters: { id: 'settings.filters', defaultMessage: 'Filters' },
|
2017-07-19 19:54:02 -07: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' },
|
|
|
|
});
|
|
|
|
|
|
|
|
@injectIntl
|
|
|
|
export default class LocalSettingsNavigation extends React.PureComponent {
|
|
|
|
|
|
|
|
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-01 13:09:57 -07:00
|
|
|
icon='cogs'
|
2017-07-19 19:54:02 -07:00
|
|
|
title={intl.formatMessage(messages.general)}
|
|
|
|
/>
|
|
|
|
<LocalSettingsNavigationItem
|
|
|
|
active={index === 1}
|
|
|
|
index={1}
|
|
|
|
onNavigate={onNavigate}
|
2018-10-01 13:09:57 -07:00
|
|
|
icon='pencil'
|
2018-09-06 11:46:42 -07:00
|
|
|
title={intl.formatMessage(messages.compose)}
|
2017-07-19 19:54:02 -07:00
|
|
|
/>
|
|
|
|
<LocalSettingsNavigationItem
|
|
|
|
active={index === 2}
|
|
|
|
index={2}
|
|
|
|
onNavigate={onNavigate}
|
2018-10-01 13:09:57 -07:00
|
|
|
textIcon='CW'
|
2018-09-06 11:46:42 -07:00
|
|
|
title={intl.formatMessage(messages.content_warnings)}
|
2017-07-19 19:54:02 -07:00
|
|
|
/>
|
|
|
|
<LocalSettingsNavigationItem
|
|
|
|
active={index === 3}
|
|
|
|
index={3}
|
2018-08-28 05:10:26 -07:00
|
|
|
onNavigate={onNavigate}
|
2019-07-12 09:27:43 -07:00
|
|
|
icon='filter'
|
|
|
|
title={intl.formatMessage(messages.filters)}
|
2018-08-28 05:10:26 -07:00
|
|
|
/>
|
|
|
|
<LocalSettingsNavigationItem
|
|
|
|
active={index === 4}
|
|
|
|
index={4}
|
2018-09-06 11:46:42 -07:00
|
|
|
onNavigate={onNavigate}
|
2019-07-12 09:27:43 -07:00
|
|
|
icon='angle-double-up'
|
|
|
|
title={intl.formatMessage(messages.collapsed)}
|
|
|
|
/>
|
|
|
|
<LocalSettingsNavigationItem
|
|
|
|
active={index === 5}
|
|
|
|
index={5}
|
|
|
|
onNavigate={onNavigate}
|
2018-10-01 13:09:57 -07:00
|
|
|
icon='image'
|
2018-09-06 11:46:42 -07:00
|
|
|
title={intl.formatMessage(messages.media)}
|
|
|
|
/>
|
|
|
|
<LocalSettingsNavigationItem
|
2019-07-12 09:27:43 -07:00
|
|
|
active={index === 6}
|
2018-09-25 05:46:14 -07:00
|
|
|
href={ preferencesLink }
|
2019-07-12 09:27:43 -07:00
|
|
|
index={6}
|
2019-06-16 12:04:09 -07:00
|
|
|
icon='cog'
|
2017-07-19 19:54:02 -07:00
|
|
|
title={intl.formatMessage(messages.preferences)}
|
|
|
|
/>
|
|
|
|
<LocalSettingsNavigationItem
|
2019-07-12 09:27:43 -07:00
|
|
|
active={index === 7}
|
2017-07-19 19:54:02 -07:00
|
|
|
className='close'
|
2019-07-12 09:27:43 -07:00
|
|
|
index={7}
|
2017-07-19 19:54:02 -07:00
|
|
|
onNavigate={onClose}
|
2018-10-01 13:09:57 -07:00
|
|
|
icon='times'
|
2017-07-19 19:54:02 -07:00
|
|
|
title={intl.formatMessage(messages.close)}
|
|
|
|
/>
|
|
|
|
</nav>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|