mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-16 11:45:19 +00:00
86 lines
2.6 KiB
JavaScript
86 lines
2.6 KiB
JavaScript
// Package imports
|
|
import React from 'react';
|
|
import PropTypes from 'prop-types';
|
|
import { injectIntl, defineMessages } from 'react-intl';
|
|
|
|
// Our imports
|
|
import LocalSettingsNavigationItem from './item';
|
|
|
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
|
|
const messages = defineMessages({
|
|
general: { id: 'settings.general', defaultMessage: 'General' },
|
|
compose: { id: 'settings.compose_box_opts', defaultMessage: 'Compose box options' },
|
|
content_warnings: { id: 'settings.content_warnings', defaultMessage: 'Content Warnings' },
|
|
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}
|
|
title={intl.formatMessage(messages.general)}
|
|
/>
|
|
<LocalSettingsNavigationItem
|
|
active={index === 1}
|
|
index={1}
|
|
onNavigate={onNavigate}
|
|
title={intl.formatMessage(messages.compose)}
|
|
/>
|
|
<LocalSettingsNavigationItem
|
|
active={index === 2}
|
|
index={2}
|
|
onNavigate={onNavigate}
|
|
title={intl.formatMessage(messages.content_warnings)}
|
|
/>
|
|
<LocalSettingsNavigationItem
|
|
active={index === 3}
|
|
index={3}
|
|
onNavigate={onNavigate}
|
|
title={intl.formatMessage(messages.collapsed)}
|
|
/>
|
|
<LocalSettingsNavigationItem
|
|
active={index === 4}
|
|
index={4}
|
|
onNavigate={onNavigate}
|
|
title={intl.formatMessage(messages.media)}
|
|
/>
|
|
<LocalSettingsNavigationItem
|
|
active={index === 5}
|
|
href='/settings/preferences'
|
|
index={5}
|
|
icon='cog'
|
|
title={intl.formatMessage(messages.preferences)}
|
|
/>
|
|
<LocalSettingsNavigationItem
|
|
active={index === 6}
|
|
className='close'
|
|
index={6}
|
|
onNavigate={onClose}
|
|
title={intl.formatMessage(messages.close)}
|
|
/>
|
|
</nav>
|
|
);
|
|
}
|
|
|
|
}
|