From 0e08cb1b367c8e14ee37c9de8144c20cf12bf1f2 Mon Sep 17 00:00:00 2001 From: kibigo! Date: Wed, 12 Jul 2017 01:02:51 -0700 Subject: [PATCH] Moved glitch files to their own location ;) --- .../actions/local_settings.js | 0 .../components/account}/header.js | 13 ++- .../components/compose/advanced_options.js} | 7 +- .../components/notification/index.js} | 13 ++- .../components/settings/index.js} | 92 +++---------------- .../glitch/components/settings/item.js | 79 ++++++++++++++++ .../components/status/action_bar.js} | 9 +- .../components/status/content.js} | 9 +- .../glitch/components/status/gallery/index.js | 79 ++++++++++++++++ .../components/status/gallery/item.js} | 75 +-------------- .../components/status/header.js} | 14 ++- .../components/status/index.js} | 29 +++--- .../components/status/prepend.js} | 8 +- .../components/status}/video_player.js | 9 +- .../containers/compose/advanced_options.js | 22 +++++ .../containers/notification/index.js} | 9 +- .../containers/settings/index.js} | 13 ++- .../containers/status/index.js} | 36 ++++---- .../reducers/local_settings.js | 9 +- .../account => glitch}/util/bio_metadata.js | 0 .../mastodon/components/status_list.js | 2 +- .../account_timeline/components/header.js | 2 +- .../compose/components/compose_form.js | 4 +- .../compose/components/search_results.js | 2 +- .../containers/advanced_options_container.js | 17 ---- .../mastodon/features/compose/index.js | 2 +- .../mastodon/features/notifications/index.js | 2 +- .../status/components/detailed_status.js | 10 +- .../mastodon/features/status/index.js | 2 +- .../features/ui/components/boost_modal.js | 2 +- .../features/ui/components/modal_root.js | 4 +- app/javascript/mastodon/reducers/index.js | 2 +- app/javascript/packs/public.js | 2 +- 33 files changed, 315 insertions(+), 263 deletions(-) rename app/javascript/{mastodon => glitch}/actions/local_settings.js (100%) rename app/javascript/{mastodon/features/account/components => glitch/components/account}/header.js (92%) rename app/javascript/{mastodon/features/compose/components/advanced_options_dropdown.js => glitch/components/compose/advanced_options.js} (94%) rename app/javascript/{mastodon/features/notifications/components/notification.js => glitch/components/notification/index.js} (88%) rename app/javascript/{mastodon/features/ui/components/settings_modal.js => glitch/components/settings/index.js} (78%) create mode 100644 app/javascript/glitch/components/settings/item.js rename app/javascript/{mastodon/components/status_action_bar.js => glitch/components/status/action_bar.js} (95%) rename app/javascript/{mastodon/components/status_content.js => glitch/components/status/content.js} (96%) create mode 100644 app/javascript/glitch/components/status/gallery/index.js rename app/javascript/{mastodon/components/media_gallery.js => glitch/components/status/gallery/item.js} (57%) rename app/javascript/{mastodon/components/status_header.js => glitch/components/status/header.js} (94%) rename app/javascript/{mastodon/components/status.js => glitch/components/status/index.js} (96%) rename app/javascript/{mastodon/components/status_prepend.js => glitch/components/status/prepend.js} (97%) rename app/javascript/{mastodon/components => glitch/components/status}/video_player.js (96%) create mode 100644 app/javascript/glitch/containers/compose/advanced_options.js rename app/javascript/{mastodon/features/notifications/containers/notification_container.js => glitch/containers/notification/index.js} (66%) rename app/javascript/{mastodon/features/ui/containers/settings_modal_container.js => glitch/containers/settings/index.js} (64%) rename app/javascript/{mastodon/containers/status_container.js => glitch/containers/status/index.js} (91%) rename app/javascript/{mastodon => glitch}/reducers/local_settings.js (87%) rename app/javascript/{mastodon/features/account => glitch}/util/bio_metadata.js (100%) delete mode 100644 app/javascript/mastodon/features/compose/containers/advanced_options_container.js diff --git a/app/javascript/mastodon/actions/local_settings.js b/app/javascript/glitch/actions/local_settings.js similarity index 100% rename from app/javascript/mastodon/actions/local_settings.js rename to app/javascript/glitch/actions/local_settings.js diff --git a/app/javascript/mastodon/features/account/components/header.js b/app/javascript/glitch/components/account/header.js similarity index 92% rename from app/javascript/mastodon/features/account/components/header.js rename to app/javascript/glitch/components/account/header.js index 32424400f2..875ee3c54a 100644 --- a/app/javascript/mastodon/features/account/components/header.js +++ b/app/javascript/glitch/components/account/header.js @@ -1,13 +1,18 @@ +// Package imports // import React from 'react'; import ImmutablePropTypes from 'react-immutable-proptypes'; import PropTypes from 'prop-types'; -import emojify from '../../../emoji'; import escapeTextContentForBrowser from 'escape-html'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; -import IconButton from '../../../components/icon_button'; -import Avatar from '../../../components/avatar'; import ImmutablePureComponent from 'react-immutable-pure-component'; -import { processBio } from '../util/bio_metadata'; + +// Mastodon imports // +import emojify from '../../../mastodon/emoji'; +import IconButton from '../../../mastodon/components/icon_button'; +import Avatar from '../../../mastodon/components/avatar'; + +// Our imports // +import { processBio } from '../../util/bio_metadata'; const messages = defineMessages({ unfollow: { id: 'account.unfollow', defaultMessage: 'Unfollow' }, diff --git a/app/javascript/mastodon/features/compose/components/advanced_options_dropdown.js b/app/javascript/glitch/components/compose/advanced_options.js similarity index 94% rename from app/javascript/mastodon/features/compose/components/advanced_options_dropdown.js rename to app/javascript/glitch/components/compose/advanced_options.js index aea810b669..0e72bd053d 100644 --- a/app/javascript/mastodon/features/compose/components/advanced_options_dropdown.js +++ b/app/javascript/glitch/components/compose/advanced_options.js @@ -1,10 +1,13 @@ +// Package imports // import React from 'react'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; -import IconButton from '../../../components/icon_button'; import Toggle from 'react-toggle'; import { injectIntl, defineMessages } from 'react-intl'; +// Mastodon imports // +import IconButton from '../../../mastodon/components/icon_button'; + const messages = defineMessages({ local_only_short: { id: 'advanced-options.local-only.short', defaultMessage: 'Local-only' }, local_only_long: { id: 'advanced-options.local-only.long', defaultMessage: 'Do not post to other instances' }, @@ -17,7 +20,7 @@ const iconStyle = { }; @injectIntl -export default class AdvancedOptionsDropdown extends React.PureComponent { +export default class ComposeAdvancedOptions extends React.PureComponent { static propTypes = { values: ImmutablePropTypes.contains({ diff --git a/app/javascript/mastodon/features/notifications/components/notification.js b/app/javascript/glitch/components/notification/index.js similarity index 88% rename from app/javascript/mastodon/features/notifications/components/notification.js rename to app/javascript/glitch/components/notification/index.js index 2b2171f8bd..3f424d85d1 100644 --- a/app/javascript/mastodon/features/notifications/components/notification.js +++ b/app/javascript/glitch/components/notification/index.js @@ -1,13 +1,18 @@ +// Package imports // import React from 'react'; import ImmutablePropTypes from 'react-immutable-proptypes'; -import StatusContainer from '../../../containers/status_container'; -import AccountContainer from '../../../containers/account_container'; import { FormattedMessage } from 'react-intl'; -import Permalink from '../../../components/permalink'; -import emojify from '../../../emoji'; import escapeTextContentForBrowser from 'escape-html'; import ImmutablePureComponent from 'react-immutable-pure-component'; +// Mastodon imports // +import AccountContainer from '../../../mastodon/containers/account_container'; +import Permalink from '../../../mastodon/components/permalink'; +import emojify from '../../../mastodon/emoji'; + +// Our imports // +import StatusContainer from '../../containers/status'; + export default class Notification extends ImmutablePureComponent { static propTypes = { diff --git a/app/javascript/mastodon/features/ui/components/settings_modal.js b/app/javascript/glitch/components/settings/index.js similarity index 78% rename from app/javascript/mastodon/features/ui/components/settings_modal.js rename to app/javascript/glitch/components/settings/index.js index 9ed2acbc7d..afe7e9a871 100644 --- a/app/javascript/mastodon/features/ui/components/settings_modal.js +++ b/app/javascript/glitch/components/settings/index.js @@ -1,7 +1,11 @@ +// Package imports // import React from 'react'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; -import { FormattedMessage, injectIntl, defineMessages } from 'react-intl'; +import { injectIntl, defineMessages, FormattedMessage } from 'react-intl'; + +// Our imports // +import SettingsItem from './item'; const messages = defineMessages({ layout_auto: { id: 'layout.auto', defaultMessage: 'Auto' }, @@ -10,89 +14,14 @@ const messages = defineMessages({ }); @injectIntl -class SettingsItem extends React.PureComponent { - - static propTypes = { - settings: ImmutablePropTypes.map.isRequired, - item: PropTypes.array.isRequired, - id: PropTypes.string.isRequired, - options: PropTypes.arrayOf(PropTypes.shape({ - value: PropTypes.string.isRequired, - message: PropTypes.object.isRequired, - })), - dependsOn: PropTypes.array, - dependsOnNot: PropTypes.array, - children: PropTypes.element.isRequired, - onChange: PropTypes.func.isRequired, - intl: PropTypes.object.isRequired, - }; - - handleChange = (e) => { - const { item, onChange } = this.props; - onChange(item, e); - } - - render () { - const { settings, item, id, options, children, dependsOn, dependsOnNot, intl } = this.props; - let enabled = true; - - if (dependsOn) { - for (let i = 0; i < dependsOn.length; i++) { - enabled = enabled && settings.getIn(dependsOn[i]); - } - } - if (dependsOnNot) { - for (let i = 0; i < dependsOnNot.length; i++) { - enabled = enabled && !settings.getIn(dependsOnNot[i]); - } - } - - if (options && options.length > 0) { - const currentValue = settings.getIn(item); - const optionElems = options && options.length > 0 && options.map((opt) => ( - - )); - return ( - - ); - } else { - return ( - - ); - } - } - -} - -export default class SettingsModal extends React.PureComponent { +export default class Settings extends React.PureComponent { static propTypes = { settings: ImmutablePropTypes.map.isRequired, toggleSetting: PropTypes.func.isRequired, changeSetting: PropTypes.func.isRequired, onClose: PropTypes.func.isRequired, + intl: PropTypes.object.isRequired, }; state = { @@ -100,6 +29,7 @@ export default class SettingsModal extends React.PureComponent { }; General = () => { + const { intl } = this.props; return (

@@ -108,9 +38,9 @@ export default class SettingsModal extends React.PureComponent { item={['layout']} id='mastodon-settings--layout' options={[ - { value: 'auto', message: messages.layout_auto }, - { value: 'multiple', message: messages.layout_desktop }, - { value: 'single', message: messages.layout_mobile }, + { value: 'auto', message: intl.formatMessage(messages.layout_auto) }, + { value: 'multiple', message: intl.formatMessage(messages.layout_desktop) }, + { value: 'single', message: intl.formatMessage(messages.layout_mobile) }, ]} onChange={this.props.changeSetting} > diff --git a/app/javascript/glitch/components/settings/item.js b/app/javascript/glitch/components/settings/item.js new file mode 100644 index 0000000000..4c67cc2acf --- /dev/null +++ b/app/javascript/glitch/components/settings/item.js @@ -0,0 +1,79 @@ +// Package imports // +import React from 'react'; +import PropTypes from 'prop-types'; +import ImmutablePropTypes from 'react-immutable-proptypes'; + +export default class SettingsItem extends React.PureComponent { + + static propTypes = { + settings: ImmutablePropTypes.map.isRequired, + item: PropTypes.array.isRequired, + id: PropTypes.string.isRequired, + options: PropTypes.arrayOf(PropTypes.shape({ + value: PropTypes.string.isRequired, + message: PropTypes.object.isRequired, + })), + dependsOn: PropTypes.array, + dependsOnNot: PropTypes.array, + children: PropTypes.element.isRequired, + onChange: PropTypes.func.isRequired, + }; + + handleChange = (e) => { + const { item, onChange } = this.props; + onChange(item, e); + } + + render () { + const { settings, item, id, options, children, dependsOn, dependsOnNot } = this.props; + let enabled = true; + + if (dependsOn) { + for (let i = 0; i < dependsOn.length; i++) { + enabled = enabled && settings.getIn(dependsOn[i]); + } + } + if (dependsOnNot) { + for (let i = 0; i < dependsOnNot.length; i++) { + enabled = enabled && !settings.getIn(dependsOnNot[i]); + } + } + + if (options && options.length > 0) { + const currentValue = settings.getIn(item); + const optionElems = options && options.length > 0 && options.map((opt) => ( + + )); + return ( + + ); + } else { + return ( + + ); + } + } + +} diff --git a/app/javascript/mastodon/components/status_action_bar.js b/app/javascript/glitch/components/status/action_bar.js similarity index 95% rename from app/javascript/mastodon/components/status_action_bar.js rename to app/javascript/glitch/components/status/action_bar.js index c26261d1a4..f298dcaa8b 100644 --- a/app/javascript/mastodon/components/status_action_bar.js +++ b/app/javascript/glitch/components/status/action_bar.js @@ -1,11 +1,14 @@ +// Package imports // import React from 'react'; import ImmutablePropTypes from 'react-immutable-proptypes'; import PropTypes from 'prop-types'; -import IconButton from './icon_button'; -import DropdownMenu from './dropdown_menu'; import { defineMessages, injectIntl } from 'react-intl'; import ImmutablePureComponent from 'react-immutable-pure-component'; -import RelativeTimestamp from './relative_timestamp'; + +// Mastodon imports // +import RelativeTimestamp from '../../../mastodon/components/relative_timestamp'; +import IconButton from '../../../mastodon/components/icon_button'; +import DropdownMenu from '../../../mastodon/components/dropdown_menu'; const messages = defineMessages({ delete: { id: 'status.delete', defaultMessage: 'Delete' }, diff --git a/app/javascript/mastodon/components/status_content.js b/app/javascript/glitch/components/status/content.js similarity index 96% rename from app/javascript/mastodon/components/status_content.js rename to app/javascript/glitch/components/status/content.js index 26103e1a32..76f5b765af 100644 --- a/app/javascript/mastodon/components/status_content.js +++ b/app/javascript/glitch/components/status/content.js @@ -1,11 +1,14 @@ +// Package imports // import React from 'react'; import ImmutablePropTypes from 'react-immutable-proptypes'; import escapeTextContentForBrowser from 'escape-html'; import PropTypes from 'prop-types'; -import emojify from '../emoji'; -import { isRtl } from '../rtl'; import { FormattedMessage } from 'react-intl'; -import Permalink from './permalink'; + +// Mastodon imports // +import emojify from '../../../mastodon/emoji'; +import { isRtl } from '../../../mastodon/rtl'; +import Permalink from '../../../mastodon/components/permalink'; export default class StatusContent extends React.PureComponent { diff --git a/app/javascript/glitch/components/status/gallery/index.js b/app/javascript/glitch/components/status/gallery/index.js new file mode 100644 index 0000000000..ae03dc08d7 --- /dev/null +++ b/app/javascript/glitch/components/status/gallery/index.js @@ -0,0 +1,79 @@ +// Package imports // +import React from 'react'; +import ImmutablePropTypes from 'react-immutable-proptypes'; +import PropTypes from 'prop-types'; +import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; + +// Mastodon imports // +import IconButton from '../../../../mastodon/components/icon_button'; + +// Our imports // +import StatusGalleryItem from './item'; + +const messages = defineMessages({ + toggle_visible: { id: 'media_gallery.toggle_visible', defaultMessage: 'Toggle visibility' }, +}); + +@injectIntl +export default class StatusGallery extends React.PureComponent { + + static propTypes = { + sensitive: PropTypes.bool, + media: ImmutablePropTypes.list.isRequired, + letterbox: PropTypes.bool, + fullwidth: PropTypes.bool, + height: PropTypes.number.isRequired, + onOpenMedia: PropTypes.func.isRequired, + intl: PropTypes.object.isRequired, + autoPlayGif: PropTypes.bool.isRequired, + }; + + state = { + visible: !this.props.sensitive, + }; + + handleOpen = () => { + this.setState({ visible: !this.state.visible }); + } + + handleClick = (index) => { + this.props.onOpenMedia(this.props.media, index); + } + + render () { + const { media, intl, sensitive, letterbox, fullwidth } = this.props; + + let children; + + if (!this.state.visible) { + let warning; + + if (sensitive) { + warning = ; + } else { + warning = ; + } + + children = ( +
+ {warning} + +
+ ); + } else { + const size = media.take(4).size; + children = media.take(4).map((attachment, i) => ); + } + + return ( +
+
+ +
+ + {children} +
+ ); + } + +} diff --git a/app/javascript/mastodon/components/media_gallery.js b/app/javascript/glitch/components/status/gallery/item.js similarity index 57% rename from app/javascript/mastodon/components/media_gallery.js rename to app/javascript/glitch/components/status/gallery/item.js index a71c94ef2a..d646825a37 100644 --- a/app/javascript/mastodon/components/media_gallery.js +++ b/app/javascript/glitch/components/status/gallery/item.js @@ -1,15 +1,12 @@ +// Package imports // import React from 'react'; import ImmutablePropTypes from 'react-immutable-proptypes'; import PropTypes from 'prop-types'; -import IconButton from './icon_button'; -import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; -import { isIOS } from '../is_mobile'; -const messages = defineMessages({ - toggle_visible: { id: 'media_gallery.toggle_visible', defaultMessage: 'Toggle visibility' }, -}); +// Mastodon imports // +import { isIOS } from '../../../../mastodon/is_mobile'; -class Item extends React.PureComponent { +export default class StatusGalleryItem extends React.PureComponent { static propTypes = { attachment: ImmutablePropTypes.map.isRequired, @@ -133,67 +130,3 @@ class Item extends React.PureComponent { } } - -@injectIntl -export default class MediaGallery extends React.PureComponent { - - static propTypes = { - sensitive: PropTypes.bool, - media: ImmutablePropTypes.list.isRequired, - letterbox: PropTypes.bool, - fullwidth: PropTypes.bool, - height: PropTypes.number.isRequired, - onOpenMedia: PropTypes.func.isRequired, - intl: PropTypes.object.isRequired, - autoPlayGif: PropTypes.bool.isRequired, - }; - - state = { - visible: !this.props.sensitive, - }; - - handleOpen = () => { - this.setState({ visible: !this.state.visible }); - } - - handleClick = (index) => { - this.props.onOpenMedia(this.props.media, index); - } - - render () { - const { media, intl, sensitive, letterbox, fullwidth } = this.props; - - let children; - - if (!this.state.visible) { - let warning; - - if (sensitive) { - warning = ; - } else { - warning = ; - } - - children = ( -
- {warning} - -
- ); - } else { - const size = media.take(4).size; - children = media.take(4).map((attachment, i) => ); - } - - return ( -
-
- -
- - {children} -
- ); - } - -} diff --git a/app/javascript/mastodon/components/status_header.js b/app/javascript/glitch/components/status/header.js similarity index 94% rename from app/javascript/mastodon/components/status_header.js rename to app/javascript/glitch/components/status/header.js index ce7f942b13..78aef1ed5b 100644 --- a/app/javascript/mastodon/components/status_header.js +++ b/app/javascript/glitch/components/status/header.js @@ -18,19 +18,17 @@ Imports: */ -// Our standard React imports: +// Package imports // import React from 'react'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; - -// We will need internationalization in this component: import { defineMessages, injectIntl } from 'react-intl'; -// The various components used when constructing our header: -import Avatar from './avatar'; -import AvatarOverlay from './avatar_overlay'; -import DisplayName from './display_name'; -import IconButton from './icon_button'; +// Mastodon imports // +import Avatar from '../../../mastodon/components/avatar'; +import AvatarOverlay from '../../../mastodon/components/avatar_overlay'; +import DisplayName from '../../../mastodon/components/display_name'; +import IconButton from '../../../mastodon/components/icon_button'; /* * * * */ diff --git a/app/javascript/mastodon/components/status.js b/app/javascript/glitch/components/status/index.js similarity index 96% rename from app/javascript/mastodon/components/status.js rename to app/javascript/glitch/components/status/index.js index e19f194b8c..a11cc0b6e9 100644 --- a/app/javascript/mastodon/components/status.js +++ b/app/javascript/glitch/components/status/index.js @@ -31,27 +31,22 @@ Imports: */ -// Our standard React imports: +// Package imports // import React from 'react'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; - -// `ImmutablePureComponent` gives us `updateOnProps` and -// `updateOnStates`: import ImmutablePureComponent from 'react-immutable-pure-component'; -// These are our various media types: -import MediaGallery from './media_gallery'; -import VideoPlayer from './video_player'; - -// These are our core status components: -import StatusPrepend from './status_prepend'; -import StatusHeader from './status_header'; -import StatusContent from './status_content'; -import StatusActionBar from './status_action_bar'; +// Mastodon imports // +import scheduleIdleTask from '../../../mastodon/features/ui/util/schedule_idle_task'; -// This is used to schedule tasks at the browser's convenience: -import scheduleIdleTask from '../features/ui/util/schedule_idle_task'; +// Our imports // +import StatusPrepend from './prepend'; +import StatusHeader from './header'; +import StatusContent from './content'; +import StatusActionBar from './action_bar'; +import StatusGallery from './gallery'; +import StatusVideoPlayer from './video_player'; /* * * * */ @@ -622,7 +617,7 @@ backgrounds for collapsed statuses are enabled. attachments.getIn([0, 'type']) === 'video' ) { media = ( // Media type is 'video' - ({ + values: state.getIn(['compose', 'advanced_options']), +}); + +const mapDispatchToProps = dispatch => ({ + + onChange (option) { + dispatch(changeComposeAdvancedOption(option)); + }, + +}); + +export default connect(mapStateToProps, mapDispatchToProps)(ComposeAdvancedOptions); diff --git a/app/javascript/mastodon/features/notifications/containers/notification_container.js b/app/javascript/glitch/containers/notification/index.js similarity index 66% rename from app/javascript/mastodon/features/notifications/containers/notification_container.js rename to app/javascript/glitch/containers/notification/index.js index 66baf98a16..783c838ae5 100644 --- a/app/javascript/mastodon/features/notifications/containers/notification_container.js +++ b/app/javascript/glitch/containers/notification/index.js @@ -1,6 +1,11 @@ +// Package imports // import { connect } from 'react-redux'; -import { makeGetNotification } from '../../../selectors'; -import Notification from '../components/notification'; + +// Mastodon imports // +import { makeGetNotification } from '../../../mastodon/selectors'; + +// Our imports // +import Notification from '../../components/notification'; const makeMapStateToProps = () => { const getNotification = makeGetNotification(); diff --git a/app/javascript/mastodon/features/ui/containers/settings_modal_container.js b/app/javascript/glitch/containers/settings/index.js similarity index 64% rename from app/javascript/mastodon/features/ui/containers/settings_modal_container.js rename to app/javascript/glitch/containers/settings/index.js index 571f028ed3..6034935ebd 100644 --- a/app/javascript/mastodon/features/ui/containers/settings_modal_container.js +++ b/app/javascript/glitch/containers/settings/index.js @@ -1,7 +1,12 @@ +// Package imports // import { connect } from 'react-redux'; -import { changeLocalSetting } from '../../../actions/local_settings'; -import { closeModal } from '../../../actions/modal'; -import SettingsModal from '../components/settings_modal'; + +// Mastodon imports // +import { closeModal } from '../../../mastodon/actions/modal'; + +// Our imports // +import { changeLocalSetting } from '../../actions/local_settings'; +import Settings from '../../components/settings'; const mapStateToProps = state => ({ settings: state.get('local_settings'), @@ -19,4 +24,4 @@ const mapDispatchToProps = dispatch => ({ }, }); -export default connect(mapStateToProps, mapDispatchToProps)(SettingsModal); +export default connect(mapStateToProps, mapDispatchToProps)(Settings); diff --git a/app/javascript/mastodon/containers/status_container.js b/app/javascript/glitch/containers/status/index.js similarity index 91% rename from app/javascript/mastodon/containers/status_container.js rename to app/javascript/glitch/containers/status/index.js index 4c0829fd07..baf898e977 100644 --- a/app/javascript/mastodon/containers/status_container.js +++ b/app/javascript/glitch/containers/status/index.js @@ -18,45 +18,41 @@ Imports: */ -// Our standard React/Redux imports: +// Package imports // import React from 'react'; import { connect } from 'react-redux'; +import { + defineMessages, + injectIntl, + FormattedMessage, +} from 'react-intl'; -// Our ``: -import Status from '../components/status'; - -// This selector helps us get our status from the store: -import { makeGetStatus } from '../selectors'; - -// These are our various ``-related actions: +// Mastodon imports // +import { makeGetStatus } from '../../../mastodon/selectors'; import { replyCompose, mentionCompose, -} from '../actions/compose'; +} from '../../../mastodon/actions/compose'; import { reblog, favourite, unreblog, unfavourite, -} from '../actions/interactions'; +} from '../../../mastodon/actions/interactions'; import { blockAccount, muteAccount, -} from '../actions/accounts'; +} from '../../../mastodon/actions/accounts'; import { muteStatus, unmuteStatus, deleteStatus, -} from '../actions/statuses'; -import { initReport } from '../actions/reports'; -import { openModal } from '../actions/modal'; +} from '../../../mastodon/actions/statuses'; +import { initReport } from '../../../mastodon/actions/reports'; +import { openModal } from '../../../mastodon/actions/modal'; -// We will need internationalization in this component: -import { - defineMessages, - injectIntl, - FormattedMessage, -} from 'react-intl'; +// Our imports // +import Status from '../../components/status'; /* * * * */ diff --git a/app/javascript/mastodon/reducers/local_settings.js b/app/javascript/glitch/reducers/local_settings.js similarity index 87% rename from app/javascript/mastodon/reducers/local_settings.js rename to app/javascript/glitch/reducers/local_settings.js index 0b53547974..db99f2c462 100644 --- a/app/javascript/mastodon/reducers/local_settings.js +++ b/app/javascript/glitch/reducers/local_settings.js @@ -1,7 +1,12 @@ -import { LOCAL_SETTING_CHANGE } from '../actions/local_settings'; -import { STORE_HYDRATE } from '../actions/store'; +// Package imports // import Immutable from 'immutable'; +// Mastodon imports // +import { STORE_HYDRATE } from '../../mastodon/actions/store'; + +// Our imports // +import { LOCAL_SETTING_CHANGE } from '../actions/local_settings'; + const initialState = Immutable.fromJS({ layout : 'auto', stretch : true, diff --git a/app/javascript/mastodon/features/account/util/bio_metadata.js b/app/javascript/glitch/util/bio_metadata.js similarity index 100% rename from app/javascript/mastodon/features/account/util/bio_metadata.js rename to app/javascript/glitch/util/bio_metadata.js diff --git a/app/javascript/mastodon/components/status_list.js b/app/javascript/mastodon/components/status_list.js index 5bc46e8eeb..b5c6c2053c 100644 --- a/app/javascript/mastodon/components/status_list.js +++ b/app/javascript/mastodon/components/status_list.js @@ -2,7 +2,7 @@ import React from 'react'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { ScrollContainer } from 'react-router-scroll'; import PropTypes from 'prop-types'; -import StatusContainer from '../containers/status_container'; +import StatusContainer from '../../glitch/containers/status'; import LoadMore from './load_more'; import ImmutablePureComponent from 'react-immutable-pure-component'; import IntersectionObserverWrapper from '../features/ui/util/intersection_observer_wrapper'; diff --git a/app/javascript/mastodon/features/account_timeline/components/header.js b/app/javascript/mastodon/features/account_timeline/components/header.js index 167a2097e5..09883d7d65 100644 --- a/app/javascript/mastodon/features/account_timeline/components/header.js +++ b/app/javascript/mastodon/features/account_timeline/components/header.js @@ -1,7 +1,7 @@ import React from 'react'; import ImmutablePropTypes from 'react-immutable-proptypes'; import PropTypes from 'prop-types'; -import InnerHeader from '../../account/components/header'; +import InnerHeader from '../../../../glitch/components/account/header'; import ActionBar from '../../account/components/action_bar'; import MissingIndicator from '../../../components/missing_indicator'; import ImmutablePureComponent from 'react-immutable-pure-component'; diff --git a/app/javascript/mastodon/features/compose/components/compose_form.js b/app/javascript/mastodon/features/compose/components/compose_form.js index 3559e4c82b..3136354431 100644 --- a/app/javascript/mastodon/features/compose/components/compose_form.js +++ b/app/javascript/mastodon/features/compose/components/compose_form.js @@ -11,7 +11,7 @@ import { defineMessages, injectIntl } from 'react-intl'; import Collapsable from '../../../components/collapsable'; import SpoilerButtonContainer from '../containers/spoiler_button_container'; import PrivacyDropdownContainer from '../containers/privacy_dropdown_container'; -import AdvancedOptionsContainer from '../containers/advanced_options_container'; +import ComposeAdvancedOptionsContainer from '../../../../glitch/containers/compose/advanced_options'; import SensitiveButtonContainer from '../containers/sensitive_button_container'; import EmojiPickerDropdown from './emoji_picker_dropdown'; import UploadFormContainer from '../containers/upload_form_container'; @@ -196,7 +196,7 @@ export default class ComposeForm extends ImmutablePureComponent {
- +
diff --git a/app/javascript/mastodon/features/compose/components/search_results.js b/app/javascript/mastodon/features/compose/components/search_results.js index ae4d1e86ae..3d1c3ca5ec 100644 --- a/app/javascript/mastodon/features/compose/components/search_results.js +++ b/app/javascript/mastodon/features/compose/components/search_results.js @@ -2,7 +2,7 @@ import React from 'react'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { FormattedMessage } from 'react-intl'; import AccountContainer from '../../../containers/account_container'; -import StatusContainer from '../../../containers/status_container'; +import StatusContainer from '../../../../glitch/containers/status'; import Link from 'react-router-dom/Link'; import ImmutablePureComponent from 'react-immutable-pure-component'; diff --git a/app/javascript/mastodon/features/compose/containers/advanced_options_container.js b/app/javascript/mastodon/features/compose/containers/advanced_options_container.js deleted file mode 100644 index 01a9c9a72e..0000000000 --- a/app/javascript/mastodon/features/compose/containers/advanced_options_container.js +++ /dev/null @@ -1,17 +0,0 @@ -import { connect } from 'react-redux'; -import AdvancedOptionsDropdown from '../components/advanced_options_dropdown'; -import { changeComposeAdvancedOption } from '../../../actions/compose'; - -const mapStateToProps = state => ({ - values: state.getIn(['compose', 'advanced_options']), -}); - -const mapDispatchToProps = dispatch => ({ - - onChange (option) { - dispatch(changeComposeAdvancedOption(option)); - }, - -}); - -export default connect(mapStateToProps, mapDispatchToProps)(AdvancedOptionsDropdown); \ No newline at end of file diff --git a/app/javascript/mastodon/features/compose/index.js b/app/javascript/mastodon/features/compose/index.js index 537e425d97..3ec205f2c2 100644 --- a/app/javascript/mastodon/features/compose/index.js +++ b/app/javascript/mastodon/features/compose/index.js @@ -5,7 +5,7 @@ import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { mountCompose, unmountCompose } from '../../actions/compose'; import { openModal } from '../../actions/modal'; -import { changeLocalSetting } from '../../actions/local_settings'; +import { changeLocalSetting } from '../../../glitch/actions/local_settings'; import Link from 'react-router-dom/Link'; import { injectIntl, defineMessages } from 'react-intl'; import SearchContainer from './containers/search_container'; diff --git a/app/javascript/mastodon/features/notifications/index.js b/app/javascript/mastodon/features/notifications/index.js index ed4b3ad982..d4e1555b2b 100644 --- a/app/javascript/mastodon/features/notifications/index.js +++ b/app/javascript/mastodon/features/notifications/index.js @@ -6,7 +6,7 @@ import Column from '../../components/column'; import ColumnHeader from '../../components/column_header'; import { expandNotifications, scrollTopNotifications } from '../../actions/notifications'; import { addColumn, removeColumn, moveColumn } from '../../actions/columns'; -import NotificationContainer from './containers/notification_container'; +import NotificationContainer from '../../../glitch/containers/notification'; import { ScrollContainer } from 'react-router-scroll'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import ColumnSettingsContainer from './containers/column_settings_container'; diff --git a/app/javascript/mastodon/features/status/components/detailed_status.js b/app/javascript/mastodon/features/status/components/detailed_status.js index 277b798108..db0181f233 100644 --- a/app/javascript/mastodon/features/status/components/detailed_status.js +++ b/app/javascript/mastodon/features/status/components/detailed_status.js @@ -3,9 +3,9 @@ import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import Avatar from '../../../components/avatar'; import DisplayName from '../../../components/display_name'; -import StatusContent from '../../../components/status_content'; -import MediaGallery from '../../../components/media_gallery'; -import VideoPlayer from '../../../components/video_player'; +import StatusContent from '../../../../glitch/components/status/content'; +import StatusGallery from '../../../../glitch/components/status/gallery'; +import StatusVideoPlayer from '../../../../glitch/components/status/video_player'; import AttachmentList from '../../../components/attachment_list'; import Link from 'react-router-dom/Link'; import { FormattedDate, FormattedNumber } from 'react-intl'; @@ -48,7 +48,7 @@ export default class DetailedStatus extends ImmutablePureComponent { media = ; } else if (status.getIn(['media_attachments', 0, 'type']) === 'video') { media = ( -