1
0
mirror of https://github.com/funamitech/mastodon synced 2024-12-03 17:28:35 +09:00

Moved glitch files to their own location ;)

This commit is contained in:
kibigo! 2017-07-12 01:02:51 -07:00
parent 74eff5456c
commit 297921fce5
33 changed files with 327 additions and 275 deletions

View File

@ -1,13 +1,18 @@
// Package imports //
import React from 'react'; import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import emojify from '../../../emoji';
import escapeTextContentForBrowser from 'escape-html'; import escapeTextContentForBrowser from 'escape-html';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; 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 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({ const messages = defineMessages({
unfollow: { id: 'account.unfollow', defaultMessage: 'Unfollow' }, unfollow: { id: 'account.unfollow', defaultMessage: 'Unfollow' },

View File

@ -1,10 +1,13 @@
// Package imports //
import React from 'react'; import React from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePropTypes from 'react-immutable-proptypes';
import IconButton from '../../../components/icon_button';
import Toggle from 'react-toggle'; import Toggle from 'react-toggle';
import { injectIntl, defineMessages } from 'react-intl'; import { injectIntl, defineMessages } from 'react-intl';
// Mastodon imports //
import IconButton from '../../../mastodon/components/icon_button';
const messages = defineMessages({ const messages = defineMessages({
local_only_short: { id: 'advanced-options.local-only.short', defaultMessage: 'Local-only' }, 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' }, local_only_long: { id: 'advanced-options.local-only.long', defaultMessage: 'Do not post to other instances' },
@ -17,7 +20,7 @@ const iconStyle = {
}; };
@injectIntl @injectIntl
export default class AdvancedOptionsDropdown extends React.PureComponent { export default class ComposeAdvancedOptions extends React.PureComponent {
static propTypes = { static propTypes = {
values: ImmutablePropTypes.contains({ values: ImmutablePropTypes.contains({

View File

@ -1,13 +1,18 @@
// Package imports //
import React from 'react'; import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePropTypes from 'react-immutable-proptypes';
import StatusContainer from '../../../containers/status_container';
import AccountContainer from '../../../containers/account_container';
import { FormattedMessage } from 'react-intl'; import { FormattedMessage } from 'react-intl';
import Permalink from '../../../components/permalink';
import emojify from '../../../emoji';
import escapeTextContentForBrowser from 'escape-html'; import escapeTextContentForBrowser from 'escape-html';
import ImmutablePureComponent from 'react-immutable-pure-component'; 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 { export default class Notification extends ImmutablePureComponent {
static propTypes = { static propTypes = {

View File

@ -1,7 +1,11 @@
// Package imports //
import React from 'react'; import React from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes'; 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({ const messages = defineMessages({
layout_auto: { id: 'layout.auto', defaultMessage: 'Auto' }, layout_auto: { id: 'layout.auto', defaultMessage: 'Auto' },
@ -10,89 +14,14 @@ const messages = defineMessages({
}); });
@injectIntl @injectIntl
class SettingsItem extends React.PureComponent { export default class Settings 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) => (
<option key={opt.value} selected={currentValue === opt.value} value={opt.value} >
{intl.formatMessage(opt.message)}
</option>
));
return (
<label htmlFor={id}>
<p>{children}</p>
<p>
<select
id={id}
disabled={!enabled}
onBlur={this.handleChange}
>
{optionElems}
</select>
</p>
</label>
);
} else {
return (
<label htmlFor={id}>
<input
id={id}
type='checkbox'
checked={settings.getIn(item)}
onChange={this.handleChange}
disabled={!enabled}
/>
{children}
</label>
);
}
}
}
export default class SettingsModal extends React.PureComponent {
static propTypes = { static propTypes = {
settings: ImmutablePropTypes.map.isRequired, settings: ImmutablePropTypes.map.isRequired,
toggleSetting: PropTypes.func.isRequired, toggleSetting: PropTypes.func.isRequired,
changeSetting: PropTypes.func.isRequired, changeSetting: PropTypes.func.isRequired,
onClose: PropTypes.func.isRequired, onClose: PropTypes.func.isRequired,
intl: PropTypes.object.isRequired,
}; };
state = { state = {
@ -100,6 +29,7 @@ export default class SettingsModal extends React.PureComponent {
}; };
General = () => { General = () => {
const { intl } = this.props;
return ( return (
<div> <div>
<h1><FormattedMessage id='settings.general' defaultMessage='General' /></h1> <h1><FormattedMessage id='settings.general' defaultMessage='General' /></h1>
@ -108,9 +38,9 @@ export default class SettingsModal extends React.PureComponent {
item={['layout']} item={['layout']}
id='mastodon-settings--layout' id='mastodon-settings--layout'
options={[ options={[
{ value: 'auto', message: messages.layout_auto }, { value: 'auto', message: intl.formatMessage(messages.layout_auto) },
{ value: 'multiple', message: messages.layout_desktop }, { value: 'multiple', message: intl.formatMessage(messages.layout_desktop) },
{ value: 'single', message: messages.layout_mobile }, { value: 'single', message: intl.formatMessage(messages.layout_mobile) },
]} ]}
onChange={this.props.changeSetting} onChange={this.props.changeSetting}
> >

View File

@ -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) => (
<option key={opt.value} selected={currentValue === opt.value} value={opt.value} >
{opt.message}
</option>
));
return (
<label htmlFor={id}>
<p>{children}</p>
<p>
<select
id={id}
disabled={!enabled}
onBlur={this.handleChange}
>
{optionElems}
</select>
</p>
</label>
);
} else {
return (
<label htmlFor={id}>
<input
id={id}
type='checkbox'
checked={settings.getIn(item)}
onChange={this.handleChange}
disabled={!enabled}
/>
{children}
</label>
);
}
}
}

View File

@ -1,11 +1,14 @@
// Package imports //
import React from 'react'; import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import IconButton from './icon_button';
import DropdownMenu from './dropdown_menu';
import { defineMessages, injectIntl } from 'react-intl'; import { defineMessages, injectIntl } from 'react-intl';
import ImmutablePureComponent from 'react-immutable-pure-component'; 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({ const messages = defineMessages({
delete: { id: 'status.delete', defaultMessage: 'Delete' }, delete: { id: 'status.delete', defaultMessage: 'Delete' },

View File

@ -1,11 +1,14 @@
// Package imports //
import React from 'react'; import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePropTypes from 'react-immutable-proptypes';
import escapeTextContentForBrowser from 'escape-html'; import escapeTextContentForBrowser from 'escape-html';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import emojify from '../emoji';
import { isRtl } from '../rtl';
import { FormattedMessage } from 'react-intl'; 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 { export default class StatusContent extends React.PureComponent {

View File

@ -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 = <FormattedMessage id='status.sensitive_warning' defaultMessage='Sensitive content' />;
} else {
warning = <FormattedMessage id='status.media_hidden' defaultMessage='Media hidden' />;
}
children = (
<div role='button' tabIndex='0' className='media-spoiler' onClick={this.handleOpen}>
<span className='media-spoiler__warning'>{warning}</span>
<span className='media-spoiler__trigger'><FormattedMessage id='status.sensitive_toggle' defaultMessage='Click to view' /></span>
</div>
);
} else {
const size = media.take(4).size;
children = media.take(4).map((attachment, i) => <StatusGalleryItem key={attachment.get('id')} onClick={this.handleClick} attachment={attachment} autoPlayGif={this.props.autoPlayGif} index={i} size={size} letterbox={letterbox} />);
}
return (
<div className={`media-gallery ${fullwidth ? 'full-width' : ''}`} style={{ height: `${this.props.height}px` }}>
<div className={`spoiler-button ${this.state.visible ? 'spoiler-button--visible' : ''}`}>
<IconButton title={intl.formatMessage(messages.toggle_visible)} icon={this.state.visible ? 'eye' : 'eye-slash'} overlay onClick={this.handleOpen} />
</div>
{children}
</div>
);
}
}

View File

@ -1,15 +1,12 @@
// Package imports //
import React from 'react'; import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types'; 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({ // Mastodon imports //
toggle_visible: { id: 'media_gallery.toggle_visible', defaultMessage: 'Toggle visibility' }, import { isIOS } from '../../../../mastodon/is_mobile';
});
class Item extends React.PureComponent { export default class StatusGalleryItem extends React.PureComponent {
static propTypes = { static propTypes = {
attachment: ImmutablePropTypes.map.isRequired, 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 = <FormattedMessage id='status.sensitive_warning' defaultMessage='Sensitive content' />;
} else {
warning = <FormattedMessage id='status.media_hidden' defaultMessage='Media hidden' />;
}
children = (
<div role='button' tabIndex='0' className='media-spoiler' onClick={this.handleOpen}>
<span className='media-spoiler__warning'>{warning}</span>
<span className='media-spoiler__trigger'><FormattedMessage id='status.sensitive_toggle' defaultMessage='Click to view' /></span>
</div>
);
} else {
const size = media.take(4).size;
children = media.take(4).map((attachment, i) => <Item key={attachment.get('id')} onClick={this.handleClick} attachment={attachment} autoPlayGif={this.props.autoPlayGif} index={i} size={size} letterbox={letterbox} />);
}
return (
<div className={`media-gallery ${fullwidth ? 'full-width' : ''}`} style={{ height: `${this.props.height}px` }}>
<div className={`spoiler-button ${this.state.visible ? 'spoiler-button--visible' : ''}`}>
<IconButton title={intl.formatMessage(messages.toggle_visible)} icon={this.state.visible ? 'eye' : 'eye-slash'} overlay onClick={this.handleOpen} />
</div>
{children}
</div>
);
}
}

View File

@ -18,19 +18,17 @@ Imports:
*/ */
// Our standard React imports: // Package imports //
import React from 'react'; import React from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePropTypes from 'react-immutable-proptypes';
// We will need internationalization in this component:
import { defineMessages, injectIntl } from 'react-intl'; import { defineMessages, injectIntl } from 'react-intl';
// The various components used when constructing our header: // Mastodon imports //
import Avatar from './avatar'; import Avatar from '../../../mastodon/components/avatar';
import AvatarOverlay from './avatar_overlay'; import AvatarOverlay from '../../../mastodon/components/avatar_overlay';
import DisplayName from './display_name'; import DisplayName from '../../../mastodon/components/display_name';
import IconButton from './icon_button'; import IconButton from '../../../mastodon/components/icon_button';
/* * * * */ /* * * * */

View File

@ -31,27 +31,22 @@ Imports:
*/ */
// Our standard React imports: // Package imports //
import React from 'react'; import React from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePropTypes from 'react-immutable-proptypes';
// `ImmutablePureComponent` gives us `updateOnProps` and
// `updateOnStates`:
import ImmutablePureComponent from 'react-immutable-pure-component'; import ImmutablePureComponent from 'react-immutable-pure-component';
// These are our various media types: // Mastodon imports //
import MediaGallery from './media_gallery'; import scheduleIdleTask from '../../../mastodon/features/ui/util/schedule_idle_task';
import VideoPlayer from './video_player';
// These are our core status components: // Our imports //
import StatusPrepend from './status_prepend'; import StatusPrepend from './prepend';
import StatusHeader from './status_header'; import StatusHeader from './header';
import StatusContent from './status_content'; import StatusContent from './content';
import StatusActionBar from './status_action_bar'; import StatusActionBar from './action_bar';
import StatusGallery from './gallery';
// This is used to schedule tasks at the browser's convenience: import StatusVideoPlayer from './video_player';
import scheduleIdleTask from '../features/ui/util/schedule_idle_task';
/* * * * */ /* * * * */
@ -622,7 +617,7 @@ backgrounds for collapsed statuses are enabled.
attachments.getIn([0, 'type']) === 'video' attachments.getIn([0, 'type']) === 'video'
) { ) {
media = ( // Media type is 'video' media = ( // Media type is 'video'
<VideoPlayer <StatusVideoPlayer
media={attachments.get(0)} media={attachments.get(0)}
sensitive={status.get('sensitive')} sensitive={status.get('sensitive')}
letterbox={settings.getIn(['media', 'letterbox'])} letterbox={settings.getIn(['media', 'letterbox'])}
@ -634,7 +629,7 @@ backgrounds for collapsed statuses are enabled.
mediaIcon = 'video-camera'; mediaIcon = 'video-camera';
} else { // Media type is 'image' or 'gifv' } else { // Media type is 'image' or 'gifv'
media = ( media = (
<MediaGallery <StatusGallery
media={attachments} media={attachments}
sensitive={status.get('sensitive')} sensitive={status.get('sensitive')}
letterbox={settings.getIn(['media', 'letterbox'])} letterbox={settings.getIn(['media', 'letterbox'])}

View File

@ -18,16 +18,16 @@ Imports:
*/ */
// Our standard React imports: // Package imports //
import React from 'react'; import React from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePropTypes from 'react-immutable-proptypes';
// This helps us process our text:
import emojify from '../emoji';
import escapeTextContentForBrowser from 'escape-html'; import escapeTextContentForBrowser from 'escape-html';
import { FormattedMessage } from 'react-intl'; import { FormattedMessage } from 'react-intl';
// Mastodon imports //
import emojify from '../../../mastodon/emoji';
/* * * * */ /* * * * */
/* /*

View File

@ -1,9 +1,12 @@
// Package imports //
import React from 'react'; import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import IconButton from './icon_button';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import { isIOS } from '../is_mobile';
// Mastodon imports //
import IconButton from '../../../mastodon/components/icon_button';
import { isIOS } from '../../../mastodon/is_mobile';
const messages = defineMessages({ const messages = defineMessages({
toggle_sound: { id: 'video_player.toggle_sound', defaultMessage: 'Toggle sound' }, toggle_sound: { id: 'video_player.toggle_sound', defaultMessage: 'Toggle sound' },
@ -12,7 +15,7 @@ const messages = defineMessages({
}); });
@injectIntl @injectIntl
export default class VideoPlayer extends React.PureComponent { export default class StatusVideoPlayer extends React.PureComponent {
static propTypes = { static propTypes = {
media: ImmutablePropTypes.map.isRequired, media: ImmutablePropTypes.map.isRequired,

View File

@ -0,0 +1,22 @@
// Package imports //
import { connect } from 'react-redux';
// Mastodon imports //
import { changeComposeAdvancedOption } from '../../../mastodon/actions/compose';
// Our imports //
import ComposeAdvancedOptions from '../../components/compose/advanced_options';
const mapStateToProps = state => ({
values: state.getIn(['compose', 'advanced_options']),
});
const mapDispatchToProps = dispatch => ({
onChange (option) {
dispatch(changeComposeAdvancedOption(option));
},
});
export default connect(mapStateToProps, mapDispatchToProps)(ComposeAdvancedOptions);

View File

@ -1,6 +1,11 @@
// Package imports //
import { connect } from 'react-redux'; 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 makeMapStateToProps = () => {
const getNotification = makeGetNotification(); const getNotification = makeGetNotification();

View File

@ -1,7 +1,12 @@
// Package imports //
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { changeLocalSetting } from '../../../actions/local_settings';
import { closeModal } from '../../../actions/modal'; // Mastodon imports //
import SettingsModal from '../components/settings_modal'; import { closeModal } from '../../../mastodon/actions/modal';
// Our imports //
import { changeLocalSetting } from '../../actions/local_settings';
import Settings from '../../components/settings';
const mapStateToProps = state => ({ const mapStateToProps = state => ({
settings: state.get('local_settings'), settings: state.get('local_settings'),
@ -19,4 +24,4 @@ const mapDispatchToProps = dispatch => ({
}, },
}); });
export default connect(mapStateToProps, mapDispatchToProps)(SettingsModal); export default connect(mapStateToProps, mapDispatchToProps)(Settings);

View File

@ -18,46 +18,42 @@ Imports:
*/ */
// Our standard React/Redux imports: // Package imports //
import React from 'react'; import React from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
// Our `<Status>`:
import Status from '../components/status';
// This selector helps us get our status from the store:
import { makeGetStatus } from '../selectors';
// These are our various `<Status>`-related actions:
import {
replyCompose,
mentionCompose,
} from '../actions/compose';
import {
reblog,
favourite,
unreblog,
unfavourite,
} from '../actions/interactions';
import {
blockAccount,
muteAccount,
} from '../actions/accounts';
import {
muteStatus,
unmuteStatus,
deleteStatus,
} from '../actions/statuses';
import { initReport } from '../actions/reports';
import { openModal } from '../actions/modal';
// We will need internationalization in this component:
import { import {
defineMessages, defineMessages,
injectIntl, injectIntl,
FormattedMessage, FormattedMessage,
} from 'react-intl'; } from 'react-intl';
// Mastodon imports //
import { makeGetStatus } from '../../../mastodon/selectors';
import {
replyCompose,
mentionCompose,
} from '../../../mastodon/actions/compose';
import {
reblog,
favourite,
unreblog,
unfavourite,
} from '../../../mastodon/actions/interactions';
import {
blockAccount,
muteAccount,
} from '../../../mastodon/actions/accounts';
import {
muteStatus,
unmuteStatus,
deleteStatus,
} from '../../../mastodon/actions/statuses';
import { initReport } from '../../../mastodon/actions/reports';
import { openModal } from '../../../mastodon/actions/modal';
// Our imports //
import Status from '../../components/status';
/* * * * */ /* * * * */
/* /*

View File

@ -1,7 +1,12 @@
import { LOCAL_SETTING_CHANGE } from '../actions/local_settings'; // Package imports //
import { STORE_HYDRATE } from '../actions/store';
import Immutable from 'immutable'; 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({ const initialState = Immutable.fromJS({
layout : 'auto', layout : 'auto',
stretch : true, stretch : true,

View File

@ -2,7 +2,7 @@ import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePropTypes from 'react-immutable-proptypes';
import { ScrollContainer } from 'react-router-scroll'; import { ScrollContainer } from 'react-router-scroll';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import StatusContainer from '../containers/status_container'; import StatusContainer from '../../glitch/containers/status';
import LoadMore from './load_more'; import LoadMore from './load_more';
import ImmutablePureComponent from 'react-immutable-pure-component'; import ImmutablePureComponent from 'react-immutable-pure-component';
import IntersectionObserverWrapper from '../features/ui/util/intersection_observer_wrapper'; import IntersectionObserverWrapper from '../features/ui/util/intersection_observer_wrapper';

View File

@ -1,7 +1,7 @@
import React from 'react'; import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types'; 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 ActionBar from '../../account/components/action_bar';
import MissingIndicator from '../../../components/missing_indicator'; import MissingIndicator from '../../../components/missing_indicator';
import ImmutablePureComponent from 'react-immutable-pure-component'; import ImmutablePureComponent from 'react-immutable-pure-component';

View File

@ -11,7 +11,7 @@ import { defineMessages, injectIntl } from 'react-intl';
import Collapsable from '../../../components/collapsable'; import Collapsable from '../../../components/collapsable';
import SpoilerButtonContainer from '../containers/spoiler_button_container'; import SpoilerButtonContainer from '../containers/spoiler_button_container';
import PrivacyDropdownContainer from '../containers/privacy_dropdown_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 SensitiveButtonContainer from '../containers/sensitive_button_container';
import EmojiPickerDropdown from './emoji_picker_dropdown'; import EmojiPickerDropdown from './emoji_picker_dropdown';
import UploadFormContainer from '../containers/upload_form_container'; import UploadFormContainer from '../containers/upload_form_container';
@ -196,7 +196,7 @@ export default class ComposeForm extends ImmutablePureComponent {
<div className='compose-form__buttons'> <div className='compose-form__buttons'>
<UploadButtonContainer /> <UploadButtonContainer />
<PrivacyDropdownContainer /> <PrivacyDropdownContainer />
<AdvancedOptionsContainer /> <ComposeAdvancedOptionsContainer />
<SensitiveButtonContainer /> <SensitiveButtonContainer />
<SpoilerButtonContainer /> <SpoilerButtonContainer />
</div> </div>

View File

@ -2,7 +2,7 @@ import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePropTypes from 'react-immutable-proptypes';
import { FormattedMessage } from 'react-intl'; import { FormattedMessage } from 'react-intl';
import AccountContainer from '../../../containers/account_container'; 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 Link from 'react-router-dom/Link';
import ImmutablePureComponent from 'react-immutable-pure-component'; import ImmutablePureComponent from 'react-immutable-pure-component';

View File

@ -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);

View File

@ -5,7 +5,7 @@ import PropTypes from 'prop-types';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { mountCompose, unmountCompose } from '../../actions/compose'; import { mountCompose, unmountCompose } from '../../actions/compose';
import { openModal } from '../../actions/modal'; 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 Link from 'react-router-dom/Link';
import { injectIntl, defineMessages } from 'react-intl'; import { injectIntl, defineMessages } from 'react-intl';
import SearchContainer from './containers/search_container'; import SearchContainer from './containers/search_container';

View File

@ -6,7 +6,7 @@ import Column from '../../components/column';
import ColumnHeader from '../../components/column_header'; import ColumnHeader from '../../components/column_header';
import { expandNotifications, scrollTopNotifications } from '../../actions/notifications'; import { expandNotifications, scrollTopNotifications } from '../../actions/notifications';
import { addColumn, removeColumn, moveColumn } from '../../actions/columns'; 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 { ScrollContainer } from 'react-router-scroll';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import ColumnSettingsContainer from './containers/column_settings_container'; import ColumnSettingsContainer from './containers/column_settings_container';

View File

@ -3,9 +3,9 @@ import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePropTypes from 'react-immutable-proptypes';
import Avatar from '../../../components/avatar'; import Avatar from '../../../components/avatar';
import DisplayName from '../../../components/display_name'; import DisplayName from '../../../components/display_name';
import StatusContent from '../../../components/status_content'; import StatusContent from '../../../../glitch/components/status/content';
import MediaGallery from '../../../components/media_gallery'; import StatusGallery from '../../../../glitch/components/status/gallery';
import VideoPlayer from '../../../components/video_player'; import StatusVideoPlayer from '../../../../glitch/components/status/video_player';
import AttachmentList from '../../../components/attachment_list'; import AttachmentList from '../../../components/attachment_list';
import Link from 'react-router-dom/Link'; import Link from 'react-router-dom/Link';
import { FormattedDate, FormattedNumber } from 'react-intl'; import { FormattedDate, FormattedNumber } from 'react-intl';
@ -48,7 +48,7 @@ export default class DetailedStatus extends ImmutablePureComponent {
media = <AttachmentList media={status.get('media_attachments')} />; media = <AttachmentList media={status.get('media_attachments')} />;
} else if (status.getIn(['media_attachments', 0, 'type']) === 'video') { } else if (status.getIn(['media_attachments', 0, 'type']) === 'video') {
media = ( media = (
<VideoPlayer <StatusVideoPlayer
sensitive={status.get('sensitive')} sensitive={status.get('sensitive')}
media={status.getIn(['media_attachments', 0])} media={status.getIn(['media_attachments', 0])}
letterbox={settings.getIn(['media', 'letterbox'])} letterbox={settings.getIn(['media', 'letterbox'])}
@ -60,7 +60,7 @@ export default class DetailedStatus extends ImmutablePureComponent {
mediaIcon = 'video-camera'; mediaIcon = 'video-camera';
} else { } else {
media = ( media = (
<MediaGallery <StatusGallery
sensitive={status.get('sensitive')} sensitive={status.get('sensitive')}
media={status.get('media_attachments')} media={status.get('media_attachments')}
letterbox={settings.getIn(['media', 'letterbox'])} letterbox={settings.getIn(['media', 'letterbox'])}

View File

@ -22,7 +22,7 @@ import { initReport } from '../../actions/reports';
import { makeGetStatus } from '../../selectors'; import { makeGetStatus } from '../../selectors';
import { ScrollContainer } from 'react-router-scroll'; import { ScrollContainer } from 'react-router-scroll';
import ColumnBackButton from '../../components/column_back_button'; import ColumnBackButton from '../../components/column_back_button';
import StatusContainer from '../../containers/status_container'; import StatusContainer from '../../../glitch/containers/status';
import { openModal } from '../../actions/modal'; import { openModal } from '../../actions/modal';
import { defineMessages, injectIntl } from 'react-intl'; import { defineMessages, injectIntl } from 'react-intl';
import ImmutablePureComponent from 'react-immutable-pure-component'; import ImmutablePureComponent from 'react-immutable-pure-component';

View File

@ -3,7 +3,7 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import Button from '../../../components/button'; import Button from '../../../components/button';
import StatusContent from '../../../components/status_content'; import StatusContent from '../../../../glitch/components/status/content';
import Avatar from '../../../components/avatar'; import Avatar from '../../../components/avatar';
import RelativeTimestamp from '../../../components/relative_timestamp'; import RelativeTimestamp from '../../../components/relative_timestamp';
import DisplayName from '../../../components/display_name'; import DisplayName from '../../../components/display_name';

View File

@ -6,7 +6,7 @@ import VideoModal from './video_modal';
import BoostModal from './boost_modal'; import BoostModal from './boost_modal';
import ConfirmationModal from './confirmation_modal'; import ConfirmationModal from './confirmation_modal';
import ReportModal from './report_modal'; import ReportModal from './report_modal';
import SettingsModal from '../containers/settings_modal_container'; import SettingsContainer from '../../../../glitch/containers/settings';
import TransitionMotion from 'react-motion/lib/TransitionMotion'; import TransitionMotion from 'react-motion/lib/TransitionMotion';
import spring from 'react-motion/lib/spring'; import spring from 'react-motion/lib/spring';
@ -17,7 +17,7 @@ const MODAL_COMPONENTS = {
'BOOST': BoostModal, 'BOOST': BoostModal,
'CONFIRM': ConfirmationModal, 'CONFIRM': ConfirmationModal,
'REPORT': ReportModal, 'REPORT': ReportModal,
'SETTINGS': SettingsModal, 'SETTINGS': SettingsContainer,
}; };
export default class ModalRoot extends React.PureComponent { export default class ModalRoot extends React.PureComponent {

View File

@ -14,7 +14,7 @@ import relationships from './relationships';
import search from './search'; import search from './search';
import notifications from './notifications'; import notifications from './notifications';
import settings from './settings'; import settings from './settings';
import local_settings from './local_settings'; import local_settings from '../../glitch/reducers/local_settings';
import status_lists from './status_lists'; import status_lists from './status_lists';
import cards from './cards'; import cards from './cards';
import reports from './reports'; import reports from './reports';

View File

@ -4,7 +4,7 @@ import { delegate } from 'rails-ujs';
import emojify from '../mastodon/emoji'; import emojify from '../mastodon/emoji';
import { getLocale } from '../mastodon/locales'; import { getLocale } from '../mastodon/locales';
import loadPolyfills from '../mastodon/load_polyfills'; import loadPolyfills from '../mastodon/load_polyfills';
import { processBio } from '../mastodon/features/account/util/bio_metadata'; import { processBio } from '../glitch/util/bio_metadata';
require.context('../images/', true); require.context('../images/', true);