Compare commits
70 Commits
a53f2cf970
...
7953261a1f
Author | SHA1 | Date |
---|---|---|
Jeremy Kescher | 7953261a1f | 1 month ago |
Jeremy Kescher | 7122d5381c | 1 month ago |
Claire | 9451997fa8 | 1 month ago |
github-actions[bot] | 8a64406d34 | 1 month ago |
Jeremy Kescher | 0353a3d759 | 2 months ago |
Claire | 3341db939c | 2 months ago |
Claire | 821fc53583 | 2 months ago |
Claire | 58a606e0ab | 2 months ago |
Claire | 49089817b0 | 2 months ago |
Claire | c0aade79b0 | 2 months ago |
Claire | 8cac5d8f78 | 2 months ago |
Claire | 8a1423a474 | 2 months ago |
Matt Jankowski | 0a33be39c1 | 2 months ago |
Claire | 3211e960ac | 2 months ago |
Claire | df777776f1 | 2 months ago |
Claire | 5e039b96c3 | 2 months ago |
Claire | 72baa1e5c3 | 2 months ago |
Claire | 100cb46608 | 2 months ago |
Claire | eb3aed9545 | 2 months ago |
Claire | d6f5702d66 | 2 months ago |
Claire | 50fd94f481 | 2 months ago |
Claire | a68dd889fe | 2 months ago |
Claire | 94f7ae192b | 2 months ago |
Claire | e36e7ea243 | 2 months ago |
Claire | a583317df6 | 2 months ago |
github-actions[bot] | 6c0b1a41a1 | 2 months ago |
renovate[bot] | 5f1380415f | 2 months ago |
Claire | d0dfcc9f3a | 2 months ago |
Claire | da2bb672ce | 2 months ago |
Claire | 8b3bd12def | 2 months ago |
Claire | 885a4c73cb | 2 months ago |
Jeong Arm | ccf2f2cb75 | 2 months ago |
Claire | d959501ef1 | 2 months ago |
Claire | 876aa35350 | 2 months ago |
Matt Jankowski | 4c84891453 | 2 months ago |
Claire | ffc5be4820 | 2 months ago |
Matt Jankowski | 62e266fbd6 | 2 months ago |
Matt Jankowski | d7ab5655ef | 2 months ago |
Claire | bc6f9befde | 2 months ago |
Claire | bd06963c16 | 2 months ago |
renovate[bot] | 42cdd0c095 | 2 months ago |
renovate[bot] | caee5e4d6a | 2 months ago |
Matt Jankowski | 6c68c3c0ce | 2 months ago |
github-actions[bot] | 4e61bce4e9 | 2 months ago |
Matt Jankowski | 72e1162eb3 | 2 months ago |
Claire | cf08a438e7 | 2 months ago |
Jeong Arm | 39839baec3 | 2 months ago |
renovate[bot] | 4ce714adea | 2 months ago |
Matt Jankowski | 6d2986017e | 2 months ago |
Claire | d5063072c3 | 2 months ago |
Matt Jankowski | b5115850bb | 2 months ago |
renovate[bot] | 58ce0002cd | 2 months ago |
renovate[bot] | 7f17162242 | 2 months ago |
renovate[bot] | 0dd1c772a8 | 2 months ago |
renovate[bot] | 6ebb971aad | 2 months ago |
Claire | 9142805ca8 | 2 months ago |
renovate[bot] | a732ef21b0 | 2 months ago |
renovate[bot] | 1164c7005e | 2 months ago |
Matt Jankowski | f279ff3bd6 | 2 months ago |
renovate[bot] | 307efe41c6 | 2 months ago |
Matt Jankowski | 92855948a0 | 2 months ago |
Matt Jankowski | ecdbf15ebe | 2 months ago |
renovate[bot] | 97a229d5f4 | 2 months ago |
renovate[bot] | a0fcac9652 | 2 months ago |
renovate[bot] | 2f653174b1 | 2 months ago |
renovate[bot] | cf7d412367 | 2 months ago |
renovate[bot] | 5d3d525d0e | 2 months ago |
github-actions[bot] | 04817e965a | 2 months ago |
Claire | 82c2af0356 | 2 months ago |
Claire | 726e7ad024 | 2 months ago |
@ -1,7 +1,9 @@
|
|||||||
[production]
|
[production]
|
||||||
defaults
|
defaults
|
||||||
not IE 11
|
> 0.2%
|
||||||
|
ios >= 15.6
|
||||||
not dead
|
not dead
|
||||||
|
not OperaMini all
|
||||||
|
|
||||||
[development]
|
[development]
|
||||||
supports es6-module
|
supports es6-module
|
||||||
|
@ -1,114 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
|
|
||||||
import { FormattedMessage } from 'react-intl';
|
|
||||||
|
|
||||||
import classNames from 'classnames';
|
|
||||||
import { withRouter } from 'react-router-dom';
|
|
||||||
|
|
||||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
||||||
import ImmutablePureComponent from 'react-immutable-pure-component';
|
|
||||||
|
|
||||||
import { HotKeys } from 'react-hotkeys';
|
|
||||||
|
|
||||||
import FlagIcon from '@/material-icons/400-24px/flag-fill.svg?react';
|
|
||||||
import { Icon } from 'flavours/glitch/components/icon';
|
|
||||||
import { Permalink } from 'flavours/glitch/components/permalink';
|
|
||||||
import { WithRouterPropTypes } from 'flavours/glitch/utils/react_router';
|
|
||||||
|
|
||||||
import NotificationOverlayContainer from '../containers/overlay_container';
|
|
||||||
|
|
||||||
import Report from './report';
|
|
||||||
|
|
||||||
class AdminReport extends ImmutablePureComponent {
|
|
||||||
|
|
||||||
static propTypes = {
|
|
||||||
hidden: PropTypes.bool,
|
|
||||||
id: PropTypes.string.isRequired,
|
|
||||||
account: ImmutablePropTypes.map.isRequired,
|
|
||||||
notification: ImmutablePropTypes.map.isRequired,
|
|
||||||
unread: PropTypes.bool,
|
|
||||||
report: ImmutablePropTypes.map.isRequired,
|
|
||||||
...WithRouterPropTypes,
|
|
||||||
};
|
|
||||||
|
|
||||||
handleMoveUp = () => {
|
|
||||||
const { notification, onMoveUp } = this.props;
|
|
||||||
onMoveUp(notification.get('id'));
|
|
||||||
};
|
|
||||||
|
|
||||||
handleMoveDown = () => {
|
|
||||||
const { notification, onMoveDown } = this.props;
|
|
||||||
onMoveDown(notification.get('id'));
|
|
||||||
};
|
|
||||||
|
|
||||||
handleOpen = () => {
|
|
||||||
this.handleOpenProfile();
|
|
||||||
};
|
|
||||||
|
|
||||||
handleOpenProfile = () => {
|
|
||||||
const { history, notification } = this.props;
|
|
||||||
history.push(`/@${notification.getIn(['account', 'acct'])}`);
|
|
||||||
};
|
|
||||||
|
|
||||||
handleMention = e => {
|
|
||||||
e.preventDefault();
|
|
||||||
|
|
||||||
const { history, notification, onMention } = this.props;
|
|
||||||
onMention(notification.get('account'), history);
|
|
||||||
};
|
|
||||||
|
|
||||||
getHandlers () {
|
|
||||||
return {
|
|
||||||
moveUp: this.handleMoveUp,
|
|
||||||
moveDown: this.handleMoveDown,
|
|
||||||
open: this.handleOpen,
|
|
||||||
openProfile: this.handleOpenProfile,
|
|
||||||
mention: this.handleMention,
|
|
||||||
reply: this.handleMention,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
render () {
|
|
||||||
const { account, notification, unread, report } = this.props;
|
|
||||||
|
|
||||||
if (!report) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Links to the display name.
|
|
||||||
const displayName = account.get('display_name_html') || account.get('username');
|
|
||||||
const link = (
|
|
||||||
<bdi><Permalink
|
|
||||||
className='notification__display-name'
|
|
||||||
href={account.get('url')}
|
|
||||||
title={account.get('acct')}
|
|
||||||
to={`/@${account.get('acct')}`}
|
|
||||||
dangerouslySetInnerHTML={{ __html: displayName }}
|
|
||||||
/></bdi>
|
|
||||||
);
|
|
||||||
|
|
||||||
const targetAccount = report.get('target_account');
|
|
||||||
const targetDisplayNameHtml = { __html: targetAccount.get('display_name_html') };
|
|
||||||
const targetLink = <bdi><Permalink className='notification__display-name' href={targetAccount.get('url')} title={targetAccount.get('acct')} to={`/@${targetAccount.get('acct')}`} dangerouslySetInnerHTML={targetDisplayNameHtml} /></bdi>;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<HotKeys handlers={this.getHandlers()}>
|
|
||||||
<div className={classNames('notification notification-admin-report focusable', { unread })} tabIndex={0}>
|
|
||||||
<div className='notification__message'>
|
|
||||||
<Icon id='flag' icon={FlagIcon} />
|
|
||||||
|
|
||||||
<span title={notification.get('created_at')}>
|
|
||||||
<FormattedMessage id='notification.admin.report' defaultMessage='{name} reported {target}' values={{ name: link, target: targetLink }} />
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<Report account={account} report={notification.get('report')} hidden={this.props.hidden} />
|
|
||||||
<NotificationOverlayContainer notification={notification} />
|
|
||||||
</div>
|
|
||||||
</HotKeys>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
export default withRouter(AdminReport);
|
|
@ -1,107 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
|
|
||||||
import { FormattedMessage } from 'react-intl';
|
|
||||||
|
|
||||||
import classNames from 'classnames';
|
|
||||||
import { withRouter } from 'react-router-dom';
|
|
||||||
|
|
||||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
||||||
import ImmutablePureComponent from 'react-immutable-pure-component';
|
|
||||||
|
|
||||||
import { HotKeys } from 'react-hotkeys';
|
|
||||||
|
|
||||||
import PersonAddIcon from '@/material-icons/400-24px/person_add-fill.svg?react';
|
|
||||||
import { Icon } from 'flavours/glitch/components/icon';
|
|
||||||
import { Permalink } from 'flavours/glitch/components/permalink';
|
|
||||||
import AccountContainer from 'flavours/glitch/containers/account_container';
|
|
||||||
import { WithRouterPropTypes } from 'flavours/glitch/utils/react_router';
|
|
||||||
|
|
||||||
import NotificationOverlayContainer from '../containers/overlay_container';
|
|
||||||
|
|
||||||
class NotificationAdminSignup extends ImmutablePureComponent {
|
|
||||||
|
|
||||||
static propTypes = {
|
|
||||||
hidden: PropTypes.bool,
|
|
||||||
id: PropTypes.string.isRequired,
|
|
||||||
account: ImmutablePropTypes.map.isRequired,
|
|
||||||
notification: ImmutablePropTypes.map.isRequired,
|
|
||||||
unread: PropTypes.bool,
|
|
||||||
...WithRouterPropTypes,
|
|
||||||
};
|
|
||||||
|
|
||||||
handleMoveUp = () => {
|
|
||||||
const { notification, onMoveUp } = this.props;
|
|
||||||
onMoveUp(notification.get('id'));
|
|
||||||
};
|
|
||||||
|
|
||||||
handleMoveDown = () => {
|
|
||||||
const { notification, onMoveDown } = this.props;
|
|
||||||
onMoveDown(notification.get('id'));
|
|
||||||
};
|
|
||||||
|
|
||||||
handleOpen = () => {
|
|
||||||
this.handleOpenProfile();
|
|
||||||
};
|
|
||||||
|
|
||||||
handleOpenProfile = () => {
|
|
||||||
const { history, notification } = this.props;
|
|
||||||
history.push(`/@${notification.getIn(['account', 'acct'])}`);
|
|
||||||
};
|
|
||||||
|
|
||||||
handleMention = e => {
|
|
||||||
e.preventDefault();
|
|
||||||
|
|
||||||
const { history, notification, onMention } = this.props;
|
|
||||||
onMention(notification.get('account'), history);
|
|
||||||
};
|
|
||||||
|
|
||||||
getHandlers () {
|
|
||||||
return {
|
|
||||||
moveUp: this.handleMoveUp,
|
|
||||||
moveDown: this.handleMoveDown,
|
|
||||||
open: this.handleOpen,
|
|
||||||
openProfile: this.handleOpenProfile,
|
|
||||||
mention: this.handleMention,
|
|
||||||
reply: this.handleMention,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
render () {
|
|
||||||
const { account, notification, hidden, unread } = this.props;
|
|
||||||
|
|
||||||
// Links to the display name.
|
|
||||||
const displayName = account.get('display_name_html') || account.get('username');
|
|
||||||
const link = (
|
|
||||||
<bdi><Permalink
|
|
||||||
className='notification__display-name'
|
|
||||||
href={account.get('url')}
|
|
||||||
title={account.get('acct')}
|
|
||||||
to={`/@${account.get('acct')}`}
|
|
||||||
dangerouslySetInnerHTML={{ __html: displayName }}
|
|
||||||
/></bdi>
|
|
||||||
);
|
|
||||||
|
|
||||||
// Renders.
|
|
||||||
return (
|
|
||||||
<HotKeys handlers={this.getHandlers()}>
|
|
||||||
<div className={classNames('notification notification-admin-sign-up focusable', { unread })} tabIndex={0}>
|
|
||||||
<div className='notification__message'>
|
|
||||||
<Icon id='user-plus' icon={PersonAddIcon} />
|
|
||||||
|
|
||||||
<FormattedMessage
|
|
||||||
id='notification.admin.sign_up'
|
|
||||||
defaultMessage='{name} signed up'
|
|
||||||
values={{ name: link }}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<AccountContainer hidden={hidden} id={account.get('id')} withNote={false} />
|
|
||||||
<NotificationOverlayContainer notification={notification} />
|
|
||||||
</div>
|
|
||||||
</HotKeys>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
export default withRouter(NotificationAdminSignup);
|
|
@ -1,107 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
|
|
||||||
import { FormattedMessage } from 'react-intl';
|
|
||||||
|
|
||||||
import classNames from 'classnames';
|
|
||||||
import { withRouter } from 'react-router-dom';
|
|
||||||
|
|
||||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
||||||
import ImmutablePureComponent from 'react-immutable-pure-component';
|
|
||||||
|
|
||||||
import { HotKeys } from 'react-hotkeys';
|
|
||||||
|
|
||||||
import PersonAddIcon from '@/material-icons/400-24px/person_add-fill.svg?react';
|
|
||||||
import { Icon } from 'flavours/glitch/components/icon';
|
|
||||||
import { Permalink } from 'flavours/glitch/components/permalink';
|
|
||||||
import AccountContainer from 'flavours/glitch/containers/account_container';
|
|
||||||
import { WithRouterPropTypes } from 'flavours/glitch/utils/react_router';
|
|
||||||
|
|
||||||
import NotificationOverlayContainer from '../containers/overlay_container';
|
|
||||||
|
|
||||||
class NotificationFollow extends ImmutablePureComponent {
|
|
||||||
|
|
||||||
static propTypes = {
|
|
||||||
hidden: PropTypes.bool,
|
|
||||||
id: PropTypes.string.isRequired,
|
|
||||||
account: ImmutablePropTypes.map.isRequired,
|
|
||||||
notification: ImmutablePropTypes.map.isRequired,
|
|
||||||
unread: PropTypes.bool,
|
|
||||||
...WithRouterPropTypes,
|
|
||||||
};
|
|
||||||
|
|
||||||
handleMoveUp = () => {
|
|
||||||
const { notification, onMoveUp } = this.props;
|
|
||||||
onMoveUp(notification.get('id'));
|
|
||||||
};
|
|
||||||
|
|
||||||
handleMoveDown = () => {
|
|
||||||
const { notification, onMoveDown } = this.props;
|
|
||||||
onMoveDown(notification.get('id'));
|
|
||||||
};
|
|
||||||
|
|
||||||
handleOpen = () => {
|
|
||||||
this.handleOpenProfile();
|
|
||||||
};
|
|
||||||
|
|
||||||
handleOpenProfile = () => {
|
|
||||||
const { history, notification } = this.props;
|
|
||||||
history.push(`/@${notification.getIn(['account', 'acct'])}`);
|
|
||||||
};
|
|
||||||
|
|
||||||
handleMention = e => {
|
|
||||||
e.preventDefault();
|
|
||||||
|
|
||||||
const { history, notification, onMention } = this.props;
|
|
||||||
onMention(notification.get('account'), history);
|
|
||||||
};
|
|
||||||
|
|
||||||
getHandlers () {
|
|
||||||
return {
|
|
||||||
moveUp: this.handleMoveUp,
|
|
||||||
moveDown: this.handleMoveDown,
|
|
||||||
open: this.handleOpen,
|
|
||||||
openProfile: this.handleOpenProfile,
|
|
||||||
mention: this.handleMention,
|
|
||||||
reply: this.handleMention,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
render () {
|
|
||||||
const { account, notification, hidden, unread } = this.props;
|
|
||||||
|
|
||||||
// Links to the display name.
|
|
||||||
const displayName = account.get('display_name_html') || account.get('username');
|
|
||||||
const link = (
|
|
||||||
<bdi><Permalink
|
|
||||||
className='notification__display-name'
|
|
||||||
href={account.get('url')}
|
|
||||||
title={account.get('acct')}
|
|
||||||
to={`/@${account.get('acct')}`}
|
|
||||||
dangerouslySetInnerHTML={{ __html: displayName }}
|
|
||||||
/></bdi>
|
|
||||||
);
|
|
||||||
|
|
||||||
// Renders.
|
|
||||||
return (
|
|
||||||
<HotKeys handlers={this.getHandlers()}>
|
|
||||||
<div className={classNames('notification notification-follow focusable', { unread })} tabIndex={0}>
|
|
||||||
<div className='notification__message'>
|
|
||||||
<Icon id='user-plus' icon={PersonAddIcon} />
|
|
||||||
|
|
||||||
<FormattedMessage
|
|
||||||
id='notification.follow'
|
|
||||||
defaultMessage='{name} followed you'
|
|
||||||
values={{ name: link }}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<AccountContainer hidden={hidden} id={account.get('id')} withNote={false} />
|
|
||||||
<NotificationOverlayContainer notification={notification} />
|
|
||||||
</div>
|
|
||||||
</HotKeys>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
export default withRouter(NotificationFollow);
|
|
@ -1,258 +1,437 @@
|
|||||||
// Package imports.
|
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
|
import { injectIntl, FormattedMessage, defineMessages } from 'react-intl';
|
||||||
|
|
||||||
|
import classNames from 'classnames';
|
||||||
|
import { withRouter } from 'react-router-dom';
|
||||||
|
|
||||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||||
import ImmutablePureComponent from 'react-immutable-pure-component';
|
import ImmutablePureComponent from 'react-immutable-pure-component';
|
||||||
|
|
||||||
// Our imports,
|
import { HotKeys } from 'react-hotkeys';
|
||||||
|
|
||||||
|
import FlagIcon from '@/material-icons/400-24px/flag-fill.svg?react';
|
||||||
|
import PersonIcon from '@/material-icons/400-24px/person-fill.svg?react';
|
||||||
|
import PersonAddIcon from '@/material-icons/400-24px/person_add-fill.svg?react';
|
||||||
|
import { Icon } from 'flavours/glitch/components/icon';
|
||||||
|
import { Permalink } from 'flavours/glitch/components/permalink';
|
||||||
|
import AccountContainer from 'flavours/glitch/containers/account_container';
|
||||||
import StatusContainer from 'flavours/glitch/containers/status_container';
|
import StatusContainer from 'flavours/glitch/containers/status_container';
|
||||||
|
import { WithRouterPropTypes } from 'flavours/glitch/utils/react_router';
|
||||||
|
|
||||||
|
import FollowRequestContainer from '../containers/follow_request_container';
|
||||||
|
import NotificationOverlayContainer from '../containers/overlay_container';
|
||||||
|
|
||||||
|
import Report from './report';
|
||||||
|
|
||||||
|
const messages = defineMessages({
|
||||||
|
follow: { id: 'notification.follow', defaultMessage: '{name} followed you' },
|
||||||
|
adminSignUp: { id: 'notification.admin.sign_up', defaultMessage: '{name} signed up' },
|
||||||
|
adminReport: { id: 'notification.admin.report', defaultMessage: '{name} reported {target}' },
|
||||||
|
});
|
||||||
|
|
||||||
import NotificationAdminReportContainer from '../containers/admin_report_container';
|
const notificationForScreenReader = (intl, message, timestamp) => {
|
||||||
import NotificationFollowRequestContainer from '../containers/follow_request_container';
|
const output = [message];
|
||||||
|
|
||||||
import NotificationAdminSignup from './admin_signup';
|
output.push(intl.formatDate(timestamp, { hour: '2-digit', minute: '2-digit', month: 'short', day: 'numeric' }));
|
||||||
import NotificationFollow from './follow';
|
|
||||||
|
|
||||||
export default class Notification extends ImmutablePureComponent {
|
return output.join(', ');
|
||||||
|
};
|
||||||
|
|
||||||
|
class Notification extends ImmutablePureComponent {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
notification: ImmutablePropTypes.map.isRequired,
|
notification: ImmutablePropTypes.map.isRequired,
|
||||||
hidden: PropTypes.bool,
|
hidden: PropTypes.bool,
|
||||||
onMoveUp: PropTypes.func.isRequired,
|
onMoveUp: PropTypes.func.isRequired,
|
||||||
onMoveDown: PropTypes.func.isRequired,
|
onMoveDown: PropTypes.func.isRequired,
|
||||||
onMention: PropTypes.func.isRequired,
|
onMention: PropTypes.func.isRequired,
|
||||||
|
onFavourite: PropTypes.func.isRequired,
|
||||||
|
onReblog: PropTypes.func.isRequired,
|
||||||
|
onToggleHidden: PropTypes.func.isRequired,
|
||||||
|
status: ImmutablePropTypes.map,
|
||||||
|
intl: PropTypes.object.isRequired,
|
||||||
getScrollPosition: PropTypes.func,
|
getScrollPosition: PropTypes.func,
|
||||||
updateScrollBottom: PropTypes.func,
|
updateScrollBottom: PropTypes.func,
|
||||||
cacheMediaWidth: PropTypes.func,
|
cacheMediaWidth: PropTypes.func,
|
||||||
cachedMediaWidth: PropTypes.number,
|
cachedMediaWidth: PropTypes.number,
|
||||||
onUnmount: PropTypes.func,
|
onUnmount: PropTypes.func,
|
||||||
unread: PropTypes.bool,
|
unread: PropTypes.bool,
|
||||||
|
...WithRouterPropTypes,
|
||||||
|
};
|
||||||
|
|
||||||
|
handleMoveUp = () => {
|
||||||
|
const { notification, onMoveUp } = this.props;
|
||||||
|
onMoveUp(notification.get('id'));
|
||||||
|
};
|
||||||
|
|
||||||
|
handleMoveDown = () => {
|
||||||
|
const { notification, onMoveDown } = this.props;
|
||||||
|
onMoveDown(notification.get('id'));
|
||||||
|
};
|
||||||
|
|
||||||
|
handleOpen = () => {
|
||||||
|
const { notification } = this.props;
|
||||||
|
|
||||||
|
if (notification.get('status')) {
|
||||||
|
this.props.history.push(`/@${notification.getIn(['status', 'account', 'acct'])}/${notification.get('status')}`);
|
||||||
|
} else {
|
||||||
|
this.handleOpenProfile();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
handleOpenProfile = () => {
|
||||||
|
const { notification } = this.props;
|
||||||
|
this.props.history.push(`/@${notification.getIn(['account', 'acct'])}`);
|
||||||
|
};
|
||||||
|
|
||||||
|
handleMention = e => {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
const { notification, onMention } = this.props;
|
||||||
|
onMention(notification.get('account'), this.props.history);
|
||||||
|
};
|
||||||
|
|
||||||
|
handleHotkeyFavourite = () => {
|
||||||
|
const { status } = this.props;
|
||||||
|
if (status) this.props.onFavourite(status);
|
||||||
|
};
|
||||||
|
|
||||||
|
handleHotkeyBoost = e => {
|
||||||
|
const { status } = this.props;
|
||||||
|
if (status) this.props.onReblog(status, e);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
getHandlers () {
|
||||||
|
return {
|
||||||
|
reply: this.handleMention,
|
||||||
|
favourite: this.handleHotkeyFavourite,
|
||||||
|
boost: this.handleHotkeyBoost,
|
||||||
|
mention: this.handleMention,
|
||||||
|
open: this.handleOpen,
|
||||||
|
openProfile: this.handleOpenProfile,
|
||||||
|
moveUp: this.handleMoveUp,
|
||||||
|
moveDown: this.handleMoveDown,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
renderFollow (notification, account, link) {
|
||||||
|
const { intl, unread } = this.props;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<HotKeys handlers={this.getHandlers()}>
|
||||||
|
<div className={classNames('notification notification-follow focusable', { unread })} tabIndex={0} aria-label={notificationForScreenReader(intl, intl.formatMessage(messages.follow, { name: account.get('acct') }), notification.get('created_at'))}>
|
||||||
|
<div className='notification__message'>
|
||||||
|
<Icon id='user-plus' icon={PersonAddIcon} />
|
||||||
|
|
||||||
|
<span title={notification.get('created_at')}>
|
||||||
|
<FormattedMessage id='notification.follow' defaultMessage='{name} followed you' values={{ name: link }} />
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<AccountContainer id={account.get('id')} hidden={this.props.hidden} />
|
||||||
|
<NotificationOverlayContainer notification={notification} />
|
||||||
|
</div>
|
||||||
|
</HotKeys>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
renderFollowRequest (notification, account, link) {
|
||||||
|
const { intl, unread } = this.props;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<HotKeys handlers={this.getHandlers()}>
|
||||||
|
<div className={classNames('notification notification-follow-request focusable', { unread })} tabIndex={0} aria-label={notificationForScreenReader(intl, intl.formatMessage({ id: 'notification.follow_request', defaultMessage: '{name} has requested to follow you' }, { name: account.get('acct') }), notification.get('created_at'))}>
|
||||||
|
<div className='notification__message'>
|
||||||
|
<Icon id='user' icon={PersonIcon} />
|
||||||
|
|
||||||
|
<span title={notification.get('created_at')}>
|
||||||
|
<FormattedMessage id='notification.follow_request' defaultMessage='{name} has requested to follow you' values={{ name: link }} />
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<FollowRequestContainer id={account.get('id')} withNote={false} hidden={this.props.hidden} />
|
||||||
|
<NotificationOverlayContainer notification={notification} />
|
||||||
|
</div>
|
||||||
|
</HotKeys>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
renderMention (notification) {
|
||||||
|
return (
|
||||||
|
<StatusContainer
|
||||||
|
id={notification.get('status')}
|
||||||
|
containerId={notification.get('id')}
|
||||||
|
withDismiss
|
||||||
|
hidden={this.props.hidden}
|
||||||
|
onMoveDown={this.handleMoveDown}
|
||||||
|
onMoveUp={this.handleMoveUp}
|
||||||
|
onMention={this.props.onMention}
|
||||||
|
contextType='notifications'
|
||||||
|
getScrollPosition={this.props.getScrollPosition}
|
||||||
|
updateScrollBottom={this.props.updateScrollBottom}
|
||||||
|
notification={notification}
|
||||||
|
cachedMediaWidth={this.props.cachedMediaWidth}
|
||||||
|
cacheMediaWidth={this.props.cacheMediaWidth}
|
||||||
|
unread={this.props.unread}
|
||||||
|
onUnmount={this.props.onUnmount}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
renderFavourite (notification) {
|
||||||
|
return (
|
||||||
|
<StatusContainer
|
||||||
|
containerId={notification.get('id')}
|
||||||
|
hidden={!!this.props.hidden}
|
||||||
|
id={notification.get('status')}
|
||||||
|
account={notification.get('account')}
|
||||||
|
prepend='favourite'
|
||||||
|
muted
|
||||||
|
withDismiss
|
||||||
|
notification={notification}
|
||||||
|
onMoveDown={this.handleMoveDown}
|
||||||
|
onMoveUp={this.handleMoveUp}
|
||||||
|
onMention={this.props.onMention}
|
||||||
|
contextType='notifications'
|
||||||
|
getScrollPosition={this.props.getScrollPosition}
|
||||||
|
updateScrollBottom={this.props.updateScrollBottom}
|
||||||
|
cachedMediaWidth={this.props.cachedMediaWidth}
|
||||||
|
cacheMediaWidth={this.props.cacheMediaWidth}
|
||||||
|
onUnmount={this.props.onUnmount}
|
||||||
|
unread={this.props.unread}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
renderReaction (notification) {
|
||||||
|
return (
|
||||||
|
<StatusContainer
|
||||||
|
containerId={notification.get('id')}
|
||||||
|
hidden={!!this.props.hidden}
|
||||||
|
id={notification.get('status')}
|
||||||
|
account={notification.get('account')}
|
||||||
|
prepend='reaction'
|
||||||
|
muted
|
||||||
|
withDismiss
|
||||||
|
notification={notification}
|
||||||
|
onMoveDown={this.handleMoveDown}
|
||||||
|
onMoveUp={this.handleMoveUp}
|
||||||
|
onMention={this.props.onMention}
|
||||||
|
contextType='notifications'
|
||||||
|
getScrollPosition={this.props.getScrollPosition}
|
||||||
|
updateScrollBottom={this.props.updateScrollBottom}
|
||||||
|
cachedMediaWidth={this.props.cachedMediaWidth}
|
||||||
|
cacheMediaWidth={this.props.cacheMediaWidth}
|
||||||
|
onUnmount={this.props.onUnmount}
|
||||||
|
unread={this.props.unread}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
renderReblog (notification) {
|
||||||
|
return (
|
||||||
|
<StatusContainer
|
||||||
|
containerId={notification.get('id')}
|
||||||
|
hidden={!!this.props.hidden}
|
||||||
|
id={notification.get('status')}
|
||||||
|
account={notification.get('account')}
|
||||||
|
prepend='reblog'
|
||||||
|
muted
|
||||||
|
notification={notification}
|
||||||
|
onMoveDown={this.handleMoveDown}
|
||||||
|
onMoveUp={this.handleMoveUp}
|
||||||
|
onMention={this.props.onMention}
|
||||||
|
contextType='notifications'
|
||||||
|
getScrollPosition={this.props.getScrollPosition}
|
||||||
|
updateScrollBottom={this.props.updateScrollBottom}
|
||||||
|
cachedMediaWidth={this.props.cachedMediaWidth}
|
||||||
|
cacheMediaWidth={this.props.cacheMediaWidth}
|
||||||
|
onUnmount={this.props.onUnmount}
|
||||||
|
withDismiss
|
||||||
|
unread={this.props.unread}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
renderStatus (notification) {
|
||||||
|
return (
|
||||||
|
<StatusContainer
|
||||||
|
containerId={notification.get('id')}
|
||||||
|
hidden={!!this.props.hidden}
|
||||||
|
id={notification.get('status')}
|
||||||
|
account={notification.get('account')}
|
||||||
|
prepend='status'
|
||||||
|
muted
|
||||||
|
notification={notification}
|
||||||
|
onMoveDown={this.handleMoveDown}
|
||||||
|
onMoveUp={this.handleMoveUp}
|
||||||
|
onMention={this.props.onMention}
|
||||||
|
contextType='notifications'
|
||||||
|
getScrollPosition={this.props.getScrollPosition}
|
||||||
|
updateScrollBottom={this.props.updateScrollBottom}
|
||||||
|
cachedMediaWidth={this.props.cachedMediaWidth}
|
||||||
|
cacheMediaWidth={this.props.cacheMediaWidth}
|
||||||
|
onUnmount={this.props.onUnmount}
|
||||||
|
withDismiss
|
||||||
|
unread={this.props.unread}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
renderUpdate (notification) {
|
||||||
|
return (
|
||||||
|
<StatusContainer
|
||||||
|
containerId={notification.get('id')}
|
||||||
|
hidden={!!this.props.hidden}
|
||||||
|
id={notification.get('status')}
|
||||||
|
account={notification.get('account')}
|
||||||
|
prepend='update'
|
||||||
|
muted
|
||||||
|
notification={notification}
|
||||||
|
onMoveDown={this.handleMoveDown}
|
||||||
|
onMoveUp={this.handleMoveUp}
|
||||||
|
onMention={this.props.onMention}
|
||||||
|
contextType='notifications'
|
||||||
|
getScrollPosition={this.props.getScrollPosition}
|
||||||
|
updateScrollBottom={this.props.updateScrollBottom}
|
||||||
|
cachedMediaWidth={this.props.cachedMediaWidth}
|
||||||
|
cacheMediaWidth={this.props.cacheMediaWidth}
|
||||||
|
onUnmount={this.props.onUnmount}
|
||||||
|
withDismiss
|
||||||
|
unread={this.props.unread}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
renderPoll (notification) {
|
||||||
|
return (
|
||||||
|
<StatusContainer
|
||||||
|
containerId={notification.get('id')}
|
||||||
|
hidden={!!this.props.hidden}
|
||||||
|
id={notification.get('status')}
|
||||||
|
account={notification.get('account')}
|
||||||
|
prepend='poll'
|
||||||
|
muted
|
||||||
|
notification={notification}
|
||||||
|
onMoveDown={this.handleMoveDown}
|
||||||
|
onMoveUp={this.handleMoveUp}
|
||||||
|
onMention={this.props.onMention}
|
||||||
|
contextType='notifications'
|
||||||
|
getScrollPosition={this.props.getScrollPosition}
|
||||||
|
updateScrollBottom={this.props.updateScrollBottom}
|
||||||
|
cachedMediaWidth={this.props.cachedMediaWidth}
|
||||||
|
cacheMediaWidth={this.props.cacheMediaWidth}
|
||||||
|
onUnmount={this.props.onUnmount}
|
||||||
|
withDismiss
|
||||||
|
unread={this.props.unread}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
renderAdminSignUp (notification, account, link) {
|
||||||
|
const { intl, unread } = this.props;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<HotKeys handlers={this.getHandlers()}>
|
||||||
|
<div className={classNames('notification notification-admin-sign-up focusable', { unread })} tabIndex={0} aria-label={notificationForScreenReader(intl, intl.formatMessage(messages.adminSignUp, { name: account.get('acct') }), notification.get('created_at'))}>
|
||||||
|
<div className='notification__message'>
|
||||||
|
<Icon id='user-plus' icon={PersonAddIcon} />
|
||||||
|
|
||||||
|
<span title={notification.get('created_at')}>
|
||||||
|
<FormattedMessage id='notification.admin.sign_up' defaultMessage='{name} signed up' values={{ name: link }} />
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<AccountContainer id={account.get('id')} hidden={this.props.hidden} />
|
||||||
|
<NotificationOverlayContainer notification={notification} />
|
||||||
|
</div>
|
||||||
|
</HotKeys>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
renderAdminReport (notification, account, link) {
|
||||||
|
const { intl, unread, report } = this.props;
|
||||||
|
|
||||||
|
if (!report) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
const targetAccount = report.get('target_account');
|
||||||
|
const targetDisplayNameHtml = { __html: targetAccount.get('display_name_html') };
|
||||||
|
const targetLink = (
|
||||||
|
<bdi>
|
||||||
|
<Permalink
|
||||||
|
className='notification__display-name'
|
||||||
|
href={account.get('url')}
|
||||||
|
title={targetAccount.get('acct')}
|
||||||
|
to={`/@${targetAccount.get('acct')}`}
|
||||||
|
dangerouslySetInnerHTML={targetDisplayNameHtml}
|
||||||
|
/>
|
||||||
|
</bdi>
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<HotKeys handlers={this.getHandlers()}>
|
||||||
|
<div className={classNames('notification notification-admin-report focusable', { unread })} tabIndex={0} aria-label={notificationForScreenReader(intl, intl.formatMessage(messages.adminReport, { name: account.get('acct'), target: notification.getIn(['report', 'target_account', 'acct']) }), notification.get('created_at'))}>
|
||||||
|
<div className='notification__message'>
|
||||||
|
<Icon id='flag' icon={FlagIcon} />
|
||||||
|
|
||||||
|
<span title={notification.get('created_at')}>
|
||||||
|
<FormattedMessage id='notification.admin.report' defaultMessage='{name} reported {target}' values={{ name: link, target: targetLink }} />
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<Report account={account} report={notification.get('report')} hidden={this.props.hidden} />
|
||||||
|
<NotificationOverlayContainer notification={notification} />
|
||||||
|
</div>
|
||||||
|
</HotKeys>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const {
|
const { notification } = this.props;
|
||||||
hidden,
|
const account = notification.get('account');
|
||||||
notification,
|
const displayNameHtml = { __html: account.get('display_name_html') };
|
||||||
onMoveDown,
|
const link = (
|
||||||
onMoveUp,
|
<bdi>
|
||||||
onMention,
|
<Permalink
|
||||||
getScrollPosition,
|
className='notification__display-name'
|
||||||
updateScrollBottom,
|
href={`/@${account.get('acct')}`}
|
||||||
} = this.props;
|
title={account.get('acct')}
|
||||||
|
to={`/@${account.get('acct')}`}
|
||||||
|
dangerouslySetInnerHTML={displayNameHtml}
|
||||||
|
/>
|
||||||
|
</bdi>
|
||||||
|
);
|
||||||
|
|
||||||
switch(notification.get('type')) {
|
switch(notification.get('type')) {
|
||||||
case 'follow':
|
case 'follow':
|
||||||
return (
|
return this.renderFollow(notification, account, link);
|
||||||
<NotificationFollow
|
|
||||||
hidden={hidden}
|
|
||||||
id={notification.get('id')}
|
|
||||||
account={notification.get('account')}
|
|
||||||
notification={notification}
|
|
||||||
onMoveDown={onMoveDown}
|
|
||||||
onMoveUp={onMoveUp}
|
|
||||||
onMention={onMention}
|
|
||||||
unread={this.props.unread}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
case 'follow_request':
|
case 'follow_request':
|
||||||
return (
|
return this.renderFollowRequest(notification, account, link);
|
||||||
<NotificationFollowRequestContainer
|
|
||||||
hidden={hidden}
|
|
||||||
id={notification.get('id')}
|
|
||||||
account={notification.get('account')}
|
|
||||||
notification={notification}
|
|
||||||
onMoveDown={onMoveDown}
|
|
||||||
onMoveUp={onMoveUp}
|
|
||||||
onMention={onMention}
|
|
||||||
unread={this.props.unread}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
case 'admin.sign_up':
|
|
||||||
return (
|
|
||||||
<NotificationAdminSignup
|
|
||||||
hidden={hidden}
|
|
||||||
id={notification.get('id')}
|
|
||||||
account={notification.get('account')}
|
|
||||||
notification={notification}
|
|
||||||
onMoveDown={onMoveDown}
|
|
||||||
onMoveUp={onMoveUp}
|
|
||||||
onMention={onMention}
|
|
||||||
unread={this.props.unread}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
case 'admin.report':
|
|
||||||
return (
|
|
||||||
<NotificationAdminReportContainer
|
|
||||||
hidden={hidden}
|
|
||||||
id={notification.get('id')}
|
|
||||||
account={notification.get('account')}
|
|
||||||
notification={notification}
|
|
||||||
onMoveDown={onMoveDown}
|
|
||||||
onMoveUp={onMoveUp}
|
|
||||||
onMention={onMention}
|
|
||||||
unread={this.props.unread}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
case 'mention':
|
case 'mention':
|
||||||
return (
|
return this.renderMention(notification);
|
||||||
<StatusContainer
|
|
||||||
containerId={notification.get('id')}
|
|
||||||
hidden={hidden}
|
|
||||||
id={notification.get('status')}
|
|
||||||
notification={notification}
|
|
||||||
onMoveDown={onMoveDown}
|
|
||||||
onMoveUp={onMoveUp}
|
|
||||||
onMention={onMention}
|
|
||||||
contextType='notifications'
|
|
||||||
getScrollPosition={getScrollPosition}
|
|
||||||
updateScrollBottom={updateScrollBottom}
|
|
||||||
cachedMediaWidth={this.props.cachedMediaWidth}
|
|
||||||
cacheMediaWidth={this.props.cacheMediaWidth}
|
|
||||||
onUnmount={this.props.onUnmount}
|
|
||||||
withDismiss
|
|
||||||
unread={this.props.unread}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
case 'status':
|
|
||||||
return (
|
|
||||||
<StatusContainer
|
|
||||||
containerId={notification.get('id')}
|
|
||||||
hidden={hidden}
|
|
||||||
id={notification.get('status')}
|
|
||||||
account={notification.get('account')}
|
|
||||||
prepend='status'
|
|
||||||
muted
|
|
||||||
notification={notification}
|
|
||||||
onMoveDown={onMoveDown}
|
|
||||||
onMoveUp={onMoveUp}
|
|
||||||
onMention={onMention}
|
|
||||||
contextType='notifications'
|
|
||||||
getScrollPosition={getScrollPosition}
|
|
||||||
updateScrollBottom={updateScrollBottom}
|
|
||||||
cachedMediaWidth={this.props.cachedMediaWidth}
|
|
||||||
cacheMediaWidth={this.props.cacheMediaWidth}
|
|
||||||
onUnmount={this.props.onUnmount}
|
|
||||||
withDismiss
|
|
||||||
unread={this.props.unread}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
case 'favourite':
|
case 'favourite':
|
||||||
return (
|
return this.renderFavourite(notification);
|
||||||
<StatusContainer
|
|
||||||
containerId={notification.get('id')}
|
|
||||||
hidden={hidden}
|
|
||||||
id={notification.get('status')}
|
|
||||||
account={notification.get('account')}
|
|
||||||
prepend='favourite'
|
|
||||||
muted
|
|
||||||
notification={notification}
|
|
||||||
onMoveDown={onMoveDown}
|
|
||||||
onMoveUp={onMoveUp}
|
|
||||||
onMention={onMention}
|
|
||||||
contextType='notifications'
|
|
||||||
getScrollPosition={getScrollPosition}
|
|
||||||
updateScrollBottom={updateScrollBottom}
|
|
||||||
cachedMediaWidth={this.props.cachedMediaWidth}
|
|
||||||
cacheMediaWidth={this.props.cacheMediaWidth}
|
|
||||||
onUnmount={this.props.onUnmount}
|
|
||||||
withDismiss
|
|
||||||
unread={this.props.unread}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
case 'reaction':
|
case 'reaction':
|
||||||
return (
|
return this.renderReaction(notification);
|
||||||
<StatusContainer
|
|
||||||
containerId={notification.get('id')}
|
|
||||||
hidden={hidden}
|
|
||||||
id={notification.get('status')}
|
|
||||||
account={notification.get('account')}
|
|
||||||
prepend='reaction'
|
|
||||||
muted
|
|
||||||
notification={notification}
|
|
||||||
onMoveDown={onMoveDown}
|
|
||||||
onMoveUp={onMoveUp}
|
|
||||||
onMention={onMention}
|
|
||||||
getScrollPosition={getScrollPosition}
|
|
||||||
updateScrollBottom={updateScrollBottom}
|
|
||||||
cachedMediaWidth={this.props.cachedMediaWidth}
|
|
||||||
cacheMediaWidth={this.props.cacheMediaWidth}
|
|
||||||
onUnmount={this.props.onUnmount}
|
|
||||||
withDismiss
|
|
||||||
unread={this.props.unread}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
case 'reblog':
|
case 'reblog':
|
||||||
return (
|
return this.renderReblog(notification);
|
||||||
<StatusContainer
|
case 'status':
|
||||||
containerId={notification.get('id')}
|
return this.renderStatus(notification);
|
||||||
hidden={hidden}
|
|
||||||
id={notification.get('status')}
|
|
||||||
account={notification.get('account')}
|
|
||||||
prepend='reblog'
|
|
||||||
muted
|
|
||||||
notification={notification}
|
|
||||||
onMoveDown={onMoveDown}
|
|
||||||
onMoveUp={onMoveUp}
|
|
||||||
onMention={onMention}
|
|
||||||
contextType='notifications'
|
|
||||||
getScrollPosition={getScrollPosition}
|
|
||||||
updateScrollBottom={updateScrollBottom}
|
|
||||||
cachedMediaWidth={this.props.cachedMediaWidth}
|
|
||||||
cacheMediaWidth={this.props.cacheMediaWidth}
|
|
||||||
onUnmount={this.props.onUnmount}
|
|
||||||
withDismiss
|
|
||||||
unread={this.props.unread}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
case 'poll':
|
|
||||||
return (
|
|
||||||
<StatusContainer
|
|
||||||
containerId={notification.get('id')}
|
|
||||||
hidden={hidden}
|
|
||||||
id={notification.get('status')}
|
|
||||||
account={notification.get('account')}
|
|
||||||
prepend='poll'
|
|
||||||
muted
|
|
||||||
notification={notification}
|
|
||||||
onMoveDown={onMoveDown}
|
|
||||||
onMoveUp={onMoveUp}
|
|
||||||
onMention={onMention}
|
|
||||||
contextType='notifications'
|
|
||||||
getScrollPosition={getScrollPosition}
|
|
||||||
updateScrollBottom={updateScrollBottom}
|
|
||||||
cachedMediaWidth={this.props.cachedMediaWidth}
|
|
||||||
cacheMediaWidth={this.props.cacheMediaWidth}
|
|
||||||
onUnmount={this.props.onUnmount}
|
|
||||||
withDismiss
|
|
||||||
unread={this.props.unread}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
case 'update':
|
case 'update':
|
||||||
return (
|
return this.renderUpdate(notification);
|
||||||
<StatusContainer
|
case 'poll':
|
||||||
containerId={notification.get('id')}
|
return this.renderPoll(notification);
|
||||||
hidden={hidden}
|
case 'admin.sign_up':
|
||||||
id={notification.get('status')}
|
return this.renderAdminSignUp(notification, account, link);
|
||||||
account={notification.get('account')}
|
case 'admin.report':
|
||||||
prepend='update'
|
return this.renderAdminReport(notification, account, link);
|
||||||
muted
|
|
||||||
notification={notification}
|
|
||||||
onMoveDown={onMoveDown}
|
|
||||||
onMoveUp={onMoveUp}
|
|
||||||
onMention={onMention}
|
|
||||||
contextType='notifications'
|
|
||||||
getScrollPosition={getScrollPosition}
|
|
||||||
updateScrollBottom={updateScrollBottom}
|
|
||||||
cachedMediaWidth={this.props.cachedMediaWidth}
|
|
||||||
cacheMediaWidth={this.props.cacheMediaWidth}
|
|
||||||
onUnmount={this.props.onUnmount}
|
|
||||||
withDismiss
|
|
||||||
unread={this.props.unread}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
default:
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default withRouter(injectIntl(Notification));
|
||||||
|
@ -1,15 +0,0 @@
|
|||||||
import { connect } from 'react-redux';
|
|
||||||
|
|
||||||
import { makeGetReport } from 'flavours/glitch/selectors';
|
|
||||||
|
|
||||||
import AdminReport from '../components/admin_report';
|
|
||||||
|
|
||||||
const mapStateToProps = (state, { notification }) => {
|
|
||||||
const getReport = makeGetReport();
|
|
||||||
|
|
||||||
return {
|
|
||||||
report: notification.get('report') ? getReport(state, notification.get('report'), notification.getIn(['report', 'target_account', 'id'])) : null,
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
export default connect(mapStateToProps)(AdminReport);
|
|
@ -0,0 +1,4 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor">
|
||||||
|
<path fill-rule="evenodd" clip-rule="evenodd"
|
||||||
|
d="M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z" />
|
||||||
|
</svg>
|
After Width: | Height: | Size: 293 B |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue