Merge pull request #2468 from ClearlyClaire/glitch-soc/cleanup
Clean up some more and reduce unwarranted differences with upstream furtherpull/2344/head
commit
d358a3cc61
|
@ -21,9 +21,6 @@ import { submitMarkers } from './markers';
|
||||||
import { register as registerPushNotifications } from './push_notifications';
|
import { register as registerPushNotifications } from './push_notifications';
|
||||||
import { saveSettings } from './settings';
|
import { saveSettings } from './settings';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export const NOTIFICATIONS_UPDATE = 'NOTIFICATIONS_UPDATE';
|
export const NOTIFICATIONS_UPDATE = 'NOTIFICATIONS_UPDATE';
|
||||||
export const NOTIFICATIONS_UPDATE_NOOP = 'NOTIFICATIONS_UPDATE_NOOP';
|
export const NOTIFICATIONS_UPDATE_NOOP = 'NOTIFICATIONS_UPDATE_NOOP';
|
||||||
|
|
||||||
|
|
|
@ -110,8 +110,9 @@ class ModalRoot extends PureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
_handleModalClose () {
|
_handleModalClose () {
|
||||||
|
if (this.unlistenHistory) {
|
||||||
this.unlistenHistory();
|
this.unlistenHistory();
|
||||||
|
}
|
||||||
const { state } = this.history.location;
|
const { state } = this.history.location;
|
||||||
if (state && state.mastodonModalKey === this._modalHistoryKey) {
|
if (state && state.mastodonModalKey === this._modalHistoryKey) {
|
||||||
this.history.goBack();
|
this.history.goBack();
|
||||||
|
|
|
@ -16,6 +16,8 @@ import { autoUnfoldCW } from 'flavours/glitch/utils/content_warning';
|
||||||
import { withOptionalRouter, WithOptionalRouterPropTypes } from 'flavours/glitch/utils/react_router';
|
import { withOptionalRouter, WithOptionalRouterPropTypes } from 'flavours/glitch/utils/react_router';
|
||||||
|
|
||||||
import Card from '../features/status/components/card';
|
import Card from '../features/status/components/card';
|
||||||
|
// We use the component (and not the container) since we do not want
|
||||||
|
// to use the progress bar to show download progress
|
||||||
import Bundle from '../features/ui/components/bundle';
|
import Bundle from '../features/ui/components/bundle';
|
||||||
import { MediaGallery, Video, Audio } from '../features/ui/util/async-components';
|
import { MediaGallery, Video, Audio } from '../features/ui/util/async-components';
|
||||||
import { displayMedia } from '../initial_state';
|
import { displayMedia } from '../initial_state';
|
||||||
|
|
|
@ -9,8 +9,6 @@ import { Blurhash } from 'flavours/glitch/components/blurhash';
|
||||||
import { Icon } from 'flavours/glitch/components/icon';
|
import { Icon } from 'flavours/glitch/components/icon';
|
||||||
import { autoPlayGif, displayMedia, useBlurhash } from 'flavours/glitch/initial_state';
|
import { autoPlayGif, displayMedia, useBlurhash } from 'flavours/glitch/initial_state';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export default class MediaItem extends ImmutablePureComponent {
|
export default class MediaItem extends ImmutablePureComponent {
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
|
|
|
@ -103,12 +103,12 @@ class ModifierPickerMenu extends PureComponent {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='emoji-picker-dropdown__modifiers__menu' style={{ display: active ? 'block' : 'none' }} ref={this.setRef}>
|
<div className='emoji-picker-dropdown__modifiers__menu' style={{ display: active ? 'block' : 'none' }} ref={this.setRef}>
|
||||||
<button onClick={this.handleClick} data-index={1}><Emoji emoji='fist' set='twitter' size={22} sheetSize={32} skin={1} backgroundImageFn={backgroundImageFn} native={useSystemEmojiFont} /></button>
|
<button type='button' onClick={this.handleClick} data-index={1}><Emoji emoji='fist' set='twitter' size={22} sheetSize={32} skin={1} backgroundImageFn={backgroundImageFn} native={useSystemEmojiFont} /></button>
|
||||||
<button onClick={this.handleClick} data-index={2}><Emoji emoji='fist' set='twitter' size={22} sheetSize={32} skin={2} backgroundImageFn={backgroundImageFn} native={useSystemEmojiFont} /></button>
|
<button type='button' onClick={this.handleClick} data-index={2}><Emoji emoji='fist' set='twitter' size={22} sheetSize={32} skin={2} backgroundImageFn={backgroundImageFn} native={useSystemEmojiFont} /></button>
|
||||||
<button onClick={this.handleClick} data-index={3}><Emoji emoji='fist' set='twitter' size={22} sheetSize={32} skin={3} backgroundImageFn={backgroundImageFn} native={useSystemEmojiFont} /></button>
|
<button type='button' onClick={this.handleClick} data-index={3}><Emoji emoji='fist' set='twitter' size={22} sheetSize={32} skin={3} backgroundImageFn={backgroundImageFn} native={useSystemEmojiFont} /></button>
|
||||||
<button onClick={this.handleClick} data-index={4}><Emoji emoji='fist' set='twitter' size={22} sheetSize={32} skin={4} backgroundImageFn={backgroundImageFn} native={useSystemEmojiFont} /></button>
|
<button type='button' onClick={this.handleClick} data-index={4}><Emoji emoji='fist' set='twitter' size={22} sheetSize={32} skin={4} backgroundImageFn={backgroundImageFn} native={useSystemEmojiFont} /></button>
|
||||||
<button onClick={this.handleClick} data-index={5}><Emoji emoji='fist' set='twitter' size={22} sheetSize={32} skin={5} backgroundImageFn={backgroundImageFn} native={useSystemEmojiFont} /></button>
|
<button type='button' onClick={this.handleClick} data-index={5}><Emoji emoji='fist' set='twitter' size={22} sheetSize={32} skin={5} backgroundImageFn={backgroundImageFn} native={useSystemEmojiFont} /></button>
|
||||||
<button onClick={this.handleClick} data-index={6}><Emoji emoji='fist' set='twitter' size={22} sheetSize={32} skin={6} backgroundImageFn={backgroundImageFn} native={useSystemEmojiFont} /></button>
|
<button type='button' onClick={this.handleClick} data-index={6}><Emoji emoji='fist' set='twitter' size={22} sheetSize={32} skin={6} backgroundImageFn={backgroundImageFn} native={useSystemEmojiFont} /></button>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,6 @@ class ReplyIndicator extends ImmutablePureComponent {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Rendering.
|
|
||||||
render () {
|
render () {
|
||||||
const { status, intl } = this.props;
|
const { status, intl } = this.props;
|
||||||
|
|
||||||
|
@ -40,7 +39,6 @@ class ReplyIndicator extends ImmutablePureComponent {
|
||||||
const content = status.get('content');
|
const content = status.get('content');
|
||||||
const attachments = status.get('media_attachments');
|
const attachments = status.get('media_attachments');
|
||||||
|
|
||||||
// The result.
|
|
||||||
return (
|
return (
|
||||||
<article className='reply-indicator'>
|
<article className='reply-indicator'>
|
||||||
<header className='reply-indicator__header'>
|
<header className='reply-indicator__header'>
|
||||||
|
|
|
@ -82,13 +82,9 @@ class Search extends PureComponent {
|
||||||
};
|
};
|
||||||
|
|
||||||
handleClear = e => {
|
handleClear = e => {
|
||||||
const {
|
const { value, submitted, onClear } = this.props;
|
||||||
onClear,
|
|
||||||
submitted,
|
|
||||||
value,
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
e.preventDefault(); // Prevents focus change ??
|
e.preventDefault();
|
||||||
|
|
||||||
if (value.length > 0 || submitted) {
|
if (value.length > 0 || submitted) {
|
||||||
onClear();
|
onClear();
|
||||||
|
@ -160,6 +156,7 @@ class Search extends PureComponent {
|
||||||
search.forget(e);
|
search.forget(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -342,6 +339,7 @@ class Search extends PureComponent {
|
||||||
<Icon id='search' className={hasValue ? '' : 'active'} />
|
<Icon id='search' className={hasValue ? '' : 'active'} />
|
||||||
<Icon id='times-circle' className={hasValue ? 'active' : ''} />
|
<Icon id='times-circle' className={hasValue ? 'active' : ''} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className='search__popout'>
|
<div className='search__popout'>
|
||||||
{options.length === 0 && (
|
{options.length === 0 && (
|
||||||
<>
|
<>
|
||||||
|
@ -361,6 +359,7 @@ class Search extends PureComponent {
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{options.length > 0 && (
|
{options.length > 0 && (
|
||||||
<>
|
<>
|
||||||
<h4><FormattedMessage id='search_popout.quick_actions' defaultMessage='Quick actions' /></h4>
|
<h4><FormattedMessage id='search_popout.quick_actions' defaultMessage='Quick actions' /></h4>
|
||||||
|
|
|
@ -22,13 +22,13 @@ export default class TextIconButton extends PureComponent {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
|
type='button'
|
||||||
title={title}
|
title={title}
|
||||||
aria-label={title}
|
aria-label={title}
|
||||||
className={`text-icon-button ${active ? 'active' : ''}`}
|
className={`text-icon-button ${active ? 'active' : ''}`}
|
||||||
aria-expanded={active}
|
aria-expanded={active}
|
||||||
onClick={this.props.onClick}
|
onClick={this.props.onClick}
|
||||||
aria-controls={ariaControls}
|
aria-controls={ariaControls} style={iconStyle}
|
||||||
style={iconStyle}
|
|
||||||
>
|
>
|
||||||
{label}
|
{label}
|
||||||
</button>
|
</button>
|
||||||
|
|
|
@ -138,7 +138,6 @@ const emojify = (str, customEmojis = {}) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
export default emojify;
|
export default emojify;
|
||||||
export { unicodeMapping };
|
|
||||||
|
|
||||||
export const buildCustomEmojis = (customEmojis) => {
|
export const buildCustomEmojis = (customEmojis) => {
|
||||||
const emojis = [];
|
const emojis = [];
|
||||||
|
|
|
@ -93,7 +93,7 @@ Object.keys(emojiIndex.emojis).forEach(key => {
|
||||||
let { short_names, search, unified } = emojiMartData.emojis[key];
|
let { short_names, search, unified } = emojiMartData.emojis[key];
|
||||||
|
|
||||||
if (short_names[0] !== key) {
|
if (short_names[0] !== key) {
|
||||||
throw new Error('The compresser expects the first short_code to be the ' +
|
throw new Error('The compressor expects the first short_code to be the ' +
|
||||||
'key. It may need to be rewritten if the emoji change such that this ' +
|
'key. It may need to be rewritten if the emoji change such that this ' +
|
||||||
'is no longer the case.');
|
'is no longer the case.');
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,6 @@ import { RelativeTimestamp } from 'flavours/glitch/components/relative_timestamp
|
||||||
import { ShortNumber } from 'flavours/glitch/components/short_number';
|
import { ShortNumber } from 'flavours/glitch/components/short_number';
|
||||||
import { Skeleton } from 'flavours/glitch/components/skeleton';
|
import { Skeleton } from 'flavours/glitch/components/skeleton';
|
||||||
|
|
||||||
|
|
||||||
export default class Story extends PureComponent {
|
export default class Story extends PureComponent {
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
|
|
|
@ -14,8 +14,6 @@ import { ImmutableHashtag as Hashtag } from 'flavours/glitch/components/hashtag'
|
||||||
import { LoadingIndicator } from 'flavours/glitch/components/loading_indicator';
|
import { LoadingIndicator } from 'flavours/glitch/components/loading_indicator';
|
||||||
import { WithRouterPropTypes } from 'flavours/glitch/utils/react_router';
|
import { WithRouterPropTypes } from 'flavours/glitch/utils/react_router';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const mapStateToProps = state => ({
|
const mapStateToProps = state => ({
|
||||||
hashtags: state.getIn(['trends', 'tags', 'items']),
|
hashtags: state.getIn(['trends', 'tags', 'items']),
|
||||||
isLoadingHashtags: state.getIn(['trends', 'tags', 'isLoading']),
|
isLoadingHashtags: state.getIn(['trends', 'tags', 'isLoading']),
|
||||||
|
|
|
@ -18,7 +18,6 @@ import ScrollableList from 'flavours/glitch/components/scrollable_list';
|
||||||
import AccountContainer from 'flavours/glitch/containers/account_container';
|
import AccountContainer from 'flavours/glitch/containers/account_container';
|
||||||
import Column from 'flavours/glitch/features/ui/components/column';
|
import Column from 'flavours/glitch/features/ui/components/column';
|
||||||
|
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
heading: { id: 'column.favourited_by', defaultMessage: 'Favourited by' },
|
heading: { id: 'column.favourited_by', defaultMessage: 'Favourited by' },
|
||||||
refresh: { id: 'refresh', defaultMessage: 'Refresh' },
|
refresh: { id: 'refresh', defaultMessage: 'Refresh' },
|
||||||
|
|
|
@ -69,7 +69,6 @@ class FollowRequests extends ImmutablePureComponent {
|
||||||
return (
|
return (
|
||||||
<Column bindToDocument={!multiColumn} name='follow-requests' icon='user-plus' heading={intl.formatMessage(messages.heading)}>
|
<Column bindToDocument={!multiColumn} name='follow-requests' icon='user-plus' heading={intl.formatMessage(messages.heading)}>
|
||||||
<ColumnBackButtonSlim />
|
<ColumnBackButtonSlim />
|
||||||
|
|
||||||
<ScrollableList
|
<ScrollableList
|
||||||
scrollKey='follow_requests'
|
scrollKey='follow_requests'
|
||||||
onLoadMore={this.handleLoadMore}
|
onLoadMore={this.handleLoadMore}
|
||||||
|
|
|
@ -34,7 +34,7 @@ const mapDispatchToProps = (dispatch) => ({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const PERSISTENCE_KEY = 'flavours/glitch_home';
|
const PERSISTENCE_KEY = 'mastodon_home';
|
||||||
|
|
||||||
const isValidDomain = value => {
|
const isValidDomain = value => {
|
||||||
const url = new URL('https:///path');
|
const url = new URL('https:///path');
|
||||||
|
|
|
@ -48,7 +48,7 @@ class Mutes extends ImmutablePureComponent {
|
||||||
}, 300, { leading: true });
|
}, 300, { leading: true });
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { intl, accountIds, hasMore, multiColumn, isLoading } = this.props;
|
const { intl, hasMore, accountIds, multiColumn, isLoading } = this.props;
|
||||||
|
|
||||||
if (!accountIds) {
|
if (!accountIds) {
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -5,8 +5,8 @@ import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
|
||||||
|
|
||||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||||
|
|
||||||
import SettingText from 'flavours/glitch/components/setting_text';
|
import SettingText from '../../../components/setting_text';
|
||||||
import SettingToggle from 'flavours/glitch/features/notifications/components/setting_toggle';
|
import SettingToggle from '../../notifications/components/setting_toggle';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
filter_regex: { id: 'home.column_settings.filter_regex', defaultMessage: 'Filter out by regular expressions' },
|
filter_regex: { id: 'home.column_settings.filter_regex', defaultMessage: 'Filter out by regular expressions' },
|
||||||
|
|
|
@ -44,14 +44,14 @@ const mapStateToProps = (state, { columnId }) => {
|
||||||
|
|
||||||
class PublicTimeline extends PureComponent {
|
class PublicTimeline extends PureComponent {
|
||||||
|
|
||||||
static defaultProps = {
|
|
||||||
onlyMedia: false,
|
|
||||||
};
|
|
||||||
|
|
||||||
static contextTypes = {
|
static contextTypes = {
|
||||||
identity: PropTypes.object,
|
identity: PropTypes.object,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static defaultProps = {
|
||||||
|
onlyMedia: false,
|
||||||
|
};
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
dispatch: PropTypes.func.isRequired,
|
dispatch: PropTypes.func.isRequired,
|
||||||
intl: PropTypes.object.isRequired,
|
intl: PropTypes.object.isRequired,
|
||||||
|
|
|
@ -11,7 +11,6 @@ import { Button } from 'flavours/glitch/components/button';
|
||||||
import { LoadingIndicator } from 'flavours/glitch/components/loading_indicator';
|
import { LoadingIndicator } from 'flavours/glitch/components/loading_indicator';
|
||||||
import StatusCheckBox from 'flavours/glitch/features/report/containers/status_check_box_container';
|
import StatusCheckBox from 'flavours/glitch/features/report/containers/status_check_box_container';
|
||||||
|
|
||||||
|
|
||||||
const mapStateToProps = (state, { accountId }) => ({
|
const mapStateToProps = (state, { accountId }) => ({
|
||||||
availableStatusIds: OrderedSet(state.getIn(['timelines', `account:${accountId}:with_replies`, 'items'])),
|
availableStatusIds: OrderedSet(state.getIn(['timelines', `account:${accountId}:with_replies`, 'items'])),
|
||||||
isLoading: state.getIn(['timelines', `account:${accountId}:with_replies`, 'isLoading']),
|
isLoading: state.getIn(['timelines', `account:${accountId}:with_replies`, 'isLoading']),
|
||||||
|
|
|
@ -8,13 +8,14 @@ import { withRouter } from 'react-router-dom';
|
||||||
|
|
||||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||||
|
|
||||||
import { IconButton } from 'flavours/glitch/components/icon_button';
|
|
||||||
import DropdownMenuContainer from 'flavours/glitch/containers/dropdown_menu_container';
|
|
||||||
import { me } from 'flavours/glitch/initial_state';
|
|
||||||
import { PERMISSION_MANAGE_USERS, PERMISSION_MANAGE_FEDERATION } from 'flavours/glitch/permissions';
|
import { PERMISSION_MANAGE_USERS, PERMISSION_MANAGE_FEDERATION } from 'flavours/glitch/permissions';
|
||||||
import { accountAdminLink, statusAdminLink } from 'flavours/glitch/utils/backend_links';
|
import { accountAdminLink, statusAdminLink } from 'flavours/glitch/utils/backend_links';
|
||||||
import { WithRouterPropTypes } from 'flavours/glitch/utils/react_router';
|
import { WithRouterPropTypes } from 'flavours/glitch/utils/react_router';
|
||||||
|
|
||||||
|
import { IconButton } from '../../../components/icon_button';
|
||||||
|
import DropdownMenuContainer from '../../../containers/dropdown_menu_container';
|
||||||
|
import { me } from '../../../initial_state';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
delete: { id: 'status.delete', defaultMessage: 'Delete' },
|
delete: { id: 'status.delete', defaultMessage: 'Delete' },
|
||||||
redraft: { id: 'status.redraft', defaultMessage: 'Delete & re-draft' },
|
redraft: { id: 'status.redraft', defaultMessage: 'Delete & re-draft' },
|
||||||
|
|
|
@ -7,10 +7,11 @@ import ImmutablePureComponent from 'react-immutable-pure-component';
|
||||||
|
|
||||||
import { Avatar } from 'flavours/glitch/components/avatar';
|
import { Avatar } from 'flavours/glitch/components/avatar';
|
||||||
import { DisplayName } from 'flavours/glitch/components/display_name';
|
import { DisplayName } from 'flavours/glitch/components/display_name';
|
||||||
import { IconButton } from 'flavours/glitch/components/icon_button';
|
|
||||||
import { RelativeTimestamp } from 'flavours/glitch/components/relative_timestamp';
|
import { RelativeTimestamp } from 'flavours/glitch/components/relative_timestamp';
|
||||||
import StatusContent from 'flavours/glitch/components/status_content';
|
import StatusContent from 'flavours/glitch/components/status_content';
|
||||||
|
|
||||||
|
import { IconButton } from '../../../components/icon_button';
|
||||||
|
|
||||||
export default class ActionsModal extends ImmutablePureComponent {
|
export default class ActionsModal extends ImmutablePureComponent {
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
|
|
|
@ -11,7 +11,6 @@ import SearchContainer from 'flavours/glitch/features/compose/containers/search_
|
||||||
|
|
||||||
import LinkFooter from './link_footer';
|
import LinkFooter from './link_footer';
|
||||||
|
|
||||||
|
|
||||||
class ComposePanel extends PureComponent {
|
class ComposePanel extends PureComponent {
|
||||||
|
|
||||||
static contextTypes = {
|
static contextTypes = {
|
||||||
|
|
|
@ -2,6 +2,7 @@ import { useCallback } from 'react';
|
||||||
|
|
||||||
import { FormattedMessage } from 'react-intl';
|
import { FormattedMessage } from 'react-intl';
|
||||||
|
|
||||||
|
|
||||||
import { openModal } from 'flavours/glitch/actions/modal';
|
import { openModal } from 'flavours/glitch/actions/modal';
|
||||||
import { registrationsOpen, sso_redirect } from 'flavours/glitch/initial_state';
|
import { registrationsOpen, sso_redirect } from 'flavours/glitch/initial_state';
|
||||||
import { useAppDispatch, useAppSelector } from 'flavours/glitch/store';
|
import { useAppDispatch, useAppSelector } from 'flavours/glitch/store';
|
||||||
|
|
|
@ -30,7 +30,7 @@ WrappedSwitch.propTypes = {
|
||||||
children: PropTypes.node,
|
children: PropTypes.node,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Small Wraper to extract the params from the route and pass
|
// Small Wrapper to extract the params from the route and pass
|
||||||
// them to the rendered component, together with the content to
|
// them to the rendered component, together with the content to
|
||||||
// be rendered inside (the children)
|
// be rendered inside (the children)
|
||||||
export class WrappedRoute extends Component {
|
export class WrappedRoute extends Component {
|
||||||
|
|
|
@ -68,8 +68,8 @@ const reducers = {
|
||||||
push_notifications,
|
push_notifications,
|
||||||
mutes,
|
mutes,
|
||||||
blocks,
|
blocks,
|
||||||
server,
|
|
||||||
boosts,
|
boosts,
|
||||||
|
server,
|
||||||
contexts,
|
contexts,
|
||||||
compose,
|
compose,
|
||||||
search,
|
search,
|
||||||
|
|
Loading…
Reference in New Issue