Replace sprockets/browserify with Webpack (#2617)
* Replace browserify with webpack * Add react-intl-translations-manager * Do not minify in development, add offline-plugin for ServiceWorker background cache updates * Adjust tests and dependencies * Fix production deployments * Fix tests * More optimizations * Improve travis cache for npm stuff * Re-run travis * Add back support for custom.scss as before * Remove offline-plugin and babili * Fix issue with Immutable.List().unshift(...values) not working as expected * Make travis load schema instead of running all migrations in sequence * Fix missing React import in WarningContainer. Optimize rendering performance by using ImmutablePureComponent instead of React.PureComponent. ImmutablePureComponent uses Immutable.is() to compare props. Replace dynamic callback bindings in <UI /> * Add react definitions to places that use JSX * Add Procfile.dev for running rails, webpack and streaming API at the same time
This commit is contained in:
.babelrc.foreman.gitignore.postcssrc.yml.travis.ymlDockerfileGemfileGemfile.lockProcfile.devyarn.lock
app
assets
javascripts
application.jsapplication_public.jscomponents.js
components
features
compose
follow_requests
components
getting_started
locales
stylesheets
helpers
javascript
fonts
montserrat
roboto-mono
robotomono-regular-webfont.eotrobotomono-regular-webfont.svgrobotomono-regular-webfont.ttfrobotomono-regular-webfont.woffrobotomono-regular-webfont.woff2
roboto
roboto-bold-webfont.eotroboto-bold-webfont.svgroboto-bold-webfont.ttfroboto-bold-webfont.woffroboto-bold-webfont.woff2roboto-italic-webfont.eotroboto-italic-webfont.svgroboto-italic-webfont.ttfroboto-italic-webfont.woffroboto-italic-webfont.woff2roboto-medium-webfont.eotroboto-medium-webfont.svgroboto-medium-webfont.ttfroboto-medium-webfont.woffroboto-medium-webfont.woff2roboto-regular-webfont.eotroboto-regular-webfont.svgroboto-regular-webfont.ttfroboto-regular-webfont.woffroboto-regular-webfont.woff2
images
.keepbackground-photo.jpgboost_sprite.pngelephant-friend.pngfluffy-elephant-friend.pnglogo.pnglogo.svgmastodon-getting-started.pngmastodon-not-found.pngmastodon.jpgmastodon_small.jpgscreenshot.pngvoid.png
mastodon
.gitkeepis_mobile.jslink_header.js
actions
accounts.jsalerts.jsblocks.jscards.jscompose.jsfavourites.jsinteractions.jsmodal.jsmutes.jsnotifications.jsonboarding.jsreports.jssearch.jssettings.jsstatuses.jsstore.jstimelines.js
api.jscomponents
account.jsattachment_list.jsautosuggest_textarea.jsavatar.jsbutton.jscollapsable.jscolumn_back_button.jscolumn_back_button_slim.jscolumn_collapsable.jsdisplay_name.jsdropdown_menu.jsextended_video_player.jsicon_button.jsload_more.jsloading_indicator.jsmedia_gallery.jsmissing_indicator.jspermalink.jsrelative_timestamp.jsstatus.jsstatus_action_bar.jsstatus_content.jsstatus_list.jsvideo_player.js
containers
emoji.jsfeatures
account
components
account_timeline
blocks
community_timeline
compose
components
autosuggest_account.jscharacter_counter.jscompose_form.jsemoji_picker_dropdown.jsnavigation_bar.jsprivacy_dropdown.jsreply_indicator.jssearch.jssearch_results.jstext_icon_button.jsupload_button.jsupload_form.jsupload_progress.jswarning.js
containers
autosuggest_account_container.jsautosuggest_status_container.jscompose_form_container.jsnavigation_container.jsprivacy_dropdown_container.jsreply_indicator_container.jssearch_container.jssearch_results_container.jssensitive_button_container.jsspoiler_button_container.jsupload_button_container.jsupload_form_container.jsupload_progress_container.jswarning_container.js
index.jsfavourited_statuses
favourites
follow_requests
followers
following
generic_not_found
getting_started
hashtag_timeline
home_timeline
mutes
notifications
public_timeline
reblogs
report
status
ui
locales
ar.jsonbg.jsonde.jsondefaultMessages.jsonen.jsoneo.jsones.jsonfa.jsonfi.jsonfr.jsonhe.jsonhr.jsonhu.jsonid.jsonindex.jsio.jsonit.jsonja.jsonnl.jsonno.jsonoc.jsonpt-BR.jsonpt.jsonru.jsonuk.jsonwhitelist_ar.jsonwhitelist_bg.jsonwhitelist_de.jsonwhitelist_en.jsonwhitelist_eo.jsonwhitelist_es.jsonwhitelist_fa.jsonwhitelist_fi.jsonwhitelist_fr.jsonwhitelist_hr.jsonwhitelist_hu.jsonwhitelist_id.jsonwhitelist_io.jsonwhitelist_it.jsonwhitelist_ja.jsonwhitelist_nl.jsonwhitelist_no.jsonwhitelist_oc.jsonwhitelist_pt-BR.jsonwhitelist_pt.jsonwhitelist_ru.jsonwhitelist_uk.jsonwhitelist_zh-CN.jsonwhitelist_zh-HK.jsonzh-CN.jsonzh-HK.json
middleware
reducers
accounts.jsaccounts_counters.jsalerts.jscards.jscompose.jsindex.jsmeta.jsmodal.jsnotifications.jsrelationships.jsreports.jssearch.jssettings.jsstatus_lists.jsstatuses.jstimelines.jsuser_lists.js
rtl.jsselectors
store
stream.jsuuid.jspacks
styles
views
bin
config
docker-compose.ymlpackage.jsonspec
controllers
features
javascript
components
@ -0,0 +1,71 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
|
||||
import ColumnCollapsable from '../../../components/column_collapsable';
|
||||
import SettingToggle from './setting_toggle';
|
||||
|
||||
const messages = defineMessages({
|
||||
settings: { id: 'notifications.settings', defaultMessage: 'Column settings' }
|
||||
});
|
||||
|
||||
class ColumnSettings extends React.PureComponent {
|
||||
|
||||
render () {
|
||||
const { settings, intl, onChange, onSave } = this.props;
|
||||
|
||||
const alertStr = <FormattedMessage id='notifications.column_settings.alert' defaultMessage='Desktop notifications' />;
|
||||
const showStr = <FormattedMessage id='notifications.column_settings.show' defaultMessage='Show in column' />;
|
||||
const soundStr = <FormattedMessage id='notifications.column_settings.sound' defaultMessage='Play sound' />;
|
||||
|
||||
return (
|
||||
<ColumnCollapsable icon='sliders' title={intl.formatMessage(messages.settings)} fullHeight={616} onCollapse={onSave}>
|
||||
<div className='column-settings__outer'>
|
||||
<span className='column-settings__section'><FormattedMessage id='notifications.column_settings.follow' defaultMessage='New followers:' /></span>
|
||||
|
||||
<div className='column-settings__row'>
|
||||
<SettingToggle settings={settings} settingKey={['alerts', 'follow']} onChange={onChange} label={alertStr} />
|
||||
<SettingToggle settings={settings} settingKey={['shows', 'follow']} onChange={onChange} label={showStr} />
|
||||
<SettingToggle settings={settings} settingKey={['sounds', 'follow']} onChange={onChange} label={soundStr} />
|
||||
</div>
|
||||
|
||||
<span className='column-settings__section'><FormattedMessage id='notifications.column_settings.favourite' defaultMessage='Favourites:' /></span>
|
||||
|
||||
<div className='column-settings__row'>
|
||||
<SettingToggle settings={settings} settingKey={['alerts', 'favourite']} onChange={onChange} label={alertStr} />
|
||||
<SettingToggle settings={settings} settingKey={['shows', 'favourite']} onChange={onChange} label={showStr} />
|
||||
<SettingToggle settings={settings} settingKey={['sounds', 'favourite']} onChange={onChange} label={soundStr} />
|
||||
</div>
|
||||
|
||||
<span className='column-settings__section'><FormattedMessage id='notifications.column_settings.mention' defaultMessage='Mentions:' /></span>
|
||||
|
||||
<div className='column-settings__row'>
|
||||
<SettingToggle settings={settings} settingKey={['alerts', 'mention']} onChange={onChange} label={alertStr} />
|
||||
<SettingToggle settings={settings} settingKey={['shows', 'mention']} onChange={onChange} label={showStr} />
|
||||
<SettingToggle settings={settings} settingKey={['sounds', 'mention']} onChange={onChange} label={soundStr} />
|
||||
</div>
|
||||
|
||||
<span className='column-settings__section'><FormattedMessage id='notifications.column_settings.reblog' defaultMessage='Boosts:' /></span>
|
||||
|
||||
<div className='column-settings__row'>
|
||||
<SettingToggle settings={settings} settingKey={['alerts', 'reblog']} onChange={onChange} label={alertStr} />
|
||||
<SettingToggle settings={settings} settingKey={['shows', 'reblog']} onChange={onChange} label={showStr} />
|
||||
<SettingToggle settings={settings} settingKey={['sounds', 'reblog']} onChange={onChange} label={soundStr} />
|
||||
</div>
|
||||
</div>
|
||||
</ColumnCollapsable>
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ColumnSettings.propTypes = {
|
||||
settings: ImmutablePropTypes.map.isRequired,
|
||||
onChange: PropTypes.func.isRequired,
|
||||
onSave: PropTypes.func.isRequired,
|
||||
intl: PropTypes.shape({
|
||||
formatMessage: PropTypes.func.isRequired
|
||||
}).isRequired
|
||||
};
|
||||
|
||||
export default injectIntl(ColumnSettings);
|
Reference in New Issue
Block a user