Move compose box options to their own page

signup-info-prompt
Thibaut Girka 2018-09-06 20:46:42 +02:00 committed by ThibG
parent b28cbb8b25
commit ba4521b175
2 changed files with 63 additions and 53 deletions

View File

@ -10,6 +10,7 @@ import LocalSettingsNavigationItem from './item';
const messages = defineMessages({ const messages = defineMessages({
general: { id: 'settings.general', defaultMessage: 'General' }, 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' }, content_warnings: { id: 'settings.content_warnings', defaultMessage: 'Content Warnings' },
collapsed: { id: 'settings.collapsed_statuses', defaultMessage: 'Collapsed toots' }, collapsed: { id: 'settings.collapsed_statuses', defaultMessage: 'Collapsed toots' },
media: { id: 'settings.media', defaultMessage: 'Media' }, media: { id: 'settings.media', defaultMessage: 'Media' },
@ -43,31 +44,37 @@ export default class LocalSettingsNavigation extends React.PureComponent {
active={index === 1} active={index === 1}
index={1} index={1}
onNavigate={onNavigate} onNavigate={onNavigate}
title={intl.formatMessage(messages.content_warnings)} title={intl.formatMessage(messages.compose)}
/> />
<LocalSettingsNavigationItem <LocalSettingsNavigationItem
active={index === 2} active={index === 2}
index={2} index={2}
onNavigate={onNavigate} onNavigate={onNavigate}
title={intl.formatMessage(messages.collapsed)} title={intl.formatMessage(messages.content_warnings)}
/> />
<LocalSettingsNavigationItem <LocalSettingsNavigationItem
active={index === 3} active={index === 3}
index={3} index={3}
onNavigate={onNavigate} onNavigate={onNavigate}
title={intl.formatMessage(messages.media)} title={intl.formatMessage(messages.collapsed)}
/> />
<LocalSettingsNavigationItem <LocalSettingsNavigationItem
active={index === 4} active={index === 4}
href='/settings/preferences'
index={4} index={4}
onNavigate={onNavigate}
title={intl.formatMessage(messages.media)}
/>
<LocalSettingsNavigationItem
active={index === 5}
href='/settings/preferences'
index={5}
icon='cog' icon='cog'
title={intl.formatMessage(messages.preferences)} title={intl.formatMessage(messages.preferences)}
/> />
<LocalSettingsNavigationItem <LocalSettingsNavigationItem
active={index === 5} active={index === 6}
className='close' className='close'
index={5} index={6}
onNavigate={onClose} onNavigate={onClose}
title={intl.formatMessage(messages.close)} title={intl.formatMessage(messages.close)}
/> />

View File

@ -74,53 +74,56 @@ export default class LocalSettingsPage extends React.PureComponent {
<FormattedMessage id='settings.navbar_under' defaultMessage='Navbar at the bottom (Mobile only)' /> <FormattedMessage id='settings.navbar_under' defaultMessage='Navbar at the bottom (Mobile only)' />
</LocalSettingsPageItem> </LocalSettingsPageItem>
</section> </section>
<section> </div>
<h2><FormattedMessage id='settings.compose_box_opts' defaultMessage='Compose box options' /></h2> ),
<LocalSettingsPageItem ({ intl, onChange, settings }) => (
settings={settings} <div className='glitch local-settings_page compose_box_opts'>
item={['always_show_spoilers_field']} <section>
id='mastodon-settings--always_show_spoilers_field' <h1><FormattedMessage id='settings.compose_box_opts' defaultMessage='Compose box options' /></h1>
onChange={onChange} <LocalSettingsPageItem
> settings={settings}
<FormattedMessage id='settings.always_show_spoilers_field' defaultMessage='Always enable the Content Warning field' /> item={['always_show_spoilers_field']}
</LocalSettingsPageItem> id='mastodon-settings--always_show_spoilers_field'
<LocalSettingsPageItem onChange={onChange}
settings={settings} >
item={['confirm_missing_media_description']} <FormattedMessage id='settings.always_show_spoilers_field' defaultMessage='Always enable the Content Warning field' />
id='mastodon-settings--confirm_missing_media_description' </LocalSettingsPageItem>
onChange={onChange} <LocalSettingsPageItem
> settings={settings}
<FormattedMessage id='settings.confirm_missing_media_description' defaultMessage='Show confirmation dialog before sending toots lacking media descriptions' /> item={['confirm_missing_media_description']}
</LocalSettingsPageItem> id='mastodon-settings--confirm_missing_media_description'
<LocalSettingsPageItem onChange={onChange}
settings={settings} >
item={['side_arm']} <FormattedMessage id='settings.confirm_missing_media_description' defaultMessage='Show confirmation dialog before sending toots lacking media descriptions' />
id='mastodon-settings--side_arm' </LocalSettingsPageItem>
options={[ <LocalSettingsPageItem
{ value: 'none', message: intl.formatMessage(messages.side_arm_none) }, settings={settings}
{ value: 'direct', message: intl.formatMessage({ id: 'privacy.direct.short' }) }, item={['side_arm']}
{ value: 'private', message: intl.formatMessage({ id: 'privacy.private.short' }) }, id='mastodon-settings--side_arm'
{ value: 'unlisted', message: intl.formatMessage({ id: 'privacy.unlisted.short' }) }, options={[
{ value: 'public', message: intl.formatMessage({ id: 'privacy.public.short' }) }, { value: 'none', message: intl.formatMessage(messages.side_arm_none) },
]} { value: 'direct', message: intl.formatMessage({ id: 'privacy.direct.short' }) },
onChange={onChange} { value: 'private', message: intl.formatMessage({ id: 'privacy.private.short' }) },
> { value: 'unlisted', message: intl.formatMessage({ id: 'privacy.unlisted.short' }) },
<FormattedMessage id='settings.side_arm' defaultMessage='Secondary toot button:' /> { value: 'public', message: intl.formatMessage({ id: 'privacy.public.short' }) },
</LocalSettingsPageItem> ]}
<LocalSettingsPageItem onChange={onChange}
settings={settings} >
item={['side_arm_reply_mode']} <FormattedMessage id='settings.side_arm' defaultMessage='Secondary toot button:' />
id='mastodon-settings--side_arm_reply_mode' </LocalSettingsPageItem>
options={[ <LocalSettingsPageItem
{ value: 'keep', message: intl.formatMessage(messages.side_arm_keep) }, settings={settings}
{ value: 'copy', message: intl.formatMessage(messages.side_arm_copy) }, item={['side_arm_reply_mode']}
{ value: 'restrict', message: intl.formatMessage(messages.side_arm_restrict) }, id='mastodon-settings--side_arm_reply_mode'
]} options={[
onChange={onChange} { value: 'keep', message: intl.formatMessage(messages.side_arm_keep) },
> { value: 'copy', message: intl.formatMessage(messages.side_arm_copy) },
<FormattedMessage id='settings.side_arm_reply_mode' defaultMessage='When replying to a toot:' /> { value: 'restrict', message: intl.formatMessage(messages.side_arm_restrict) },
</LocalSettingsPageItem> ]}
</section> onChange={onChange}
>
<FormattedMessage id='settings.side_arm_reply_mode' defaultMessage='When replying to a toot:' />
</LocalSettingsPageItem>
</div> </div>
), ),
({ intl, onChange, settings }) => ( ({ intl, onChange, settings }) => (