[build] upgrade eslint to 9.37.0 (#88)

Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Reviewed-on: https://codeberg.org/superseriousbusiness/masto-fe-standalone/pulls/88
Co-authored-by: Zoë Bijl <moiety@noreply.codeberg.org>
Co-committed-by: Zoë Bijl <moiety@noreply.codeberg.org>
This commit is contained in:
Zoë Bijl
2025-10-12 13:42:02 +02:00
committed by tobi
parent 75d7a62693
commit 1ff70886a1
975 changed files with 22196 additions and 21964 deletions
@@ -1,23 +1,23 @@
// Package imports.
import PropTypes from 'prop-types';
import PropTypes from "prop-types";
import { FormattedMessage } from 'react-intl';
import { FormattedMessage } from "react-intl";
import classNames from 'classnames';
import classNames from "classnames";
import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component';
import ImmutablePropTypes from "react-immutable-proptypes";
import ImmutablePureComponent from "react-immutable-pure-component";
import { HotKeys } from 'react-hotkeys';
import { HotKeys } from "react-hotkeys";
// Our imports.
import { Icon } from 'flavours/glitch/components/icon';
import Permalink from 'flavours/glitch/components/permalink';
import { Icon } from "flavours/glitch/components/icon";
import Permalink from "flavours/glitch/components/permalink";
import NotificationOverlayContainer from '../containers/overlay_container';
import NotificationOverlayContainer from "../containers/overlay_container";
import Report from './report';
import Report from "./report";
export default class AdminReport extends ImmutablePureComponent {
@@ -32,12 +32,12 @@ export default class AdminReport extends ImmutablePureComponent {
handleMoveUp = () => {
const { notification, onMoveUp } = this.props;
onMoveUp(notification.get('id'));
onMoveUp(notification.get("id"));
};
handleMoveDown = () => {
const { notification, onMoveDown } = this.props;
onMoveDown(notification.get('id'));
onMoveDown(notification.get("id"));
};
handleOpen = () => {
@@ -46,14 +46,14 @@ export default class AdminReport extends ImmutablePureComponent {
handleOpenProfile = () => {
const { notification } = this.props;
this.context.router.history.push(`/@${notification.getIn(['account', 'acct'])}`);
this.context.router.history.push(`/@${notification.getIn(["account", "acct"])}`);
};
handleMention = e => {
e.preventDefault();
const { notification, onMention } = this.props;
onMention(notification.get('account'), this.context.router.history);
onMention(notification.get("account"), this.context.router.history);
};
getHandlers () {
@@ -75,35 +75,35 @@ export default class AdminReport extends ImmutablePureComponent {
}
// Links to the display name.
const displayName = account.get('display_name_html') || account.get('username');
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')}`}
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>;
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={classNames("notification notification-admin-report focusable", { unread })} tabIndex={0}>
<div className='notification__message'>
<div className='notification__favourite-icon-wrapper'>
<Icon id='flag' fixedWidth />
</div>
<span title={notification.get('created_at')}>
<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} />
<Report account={account} report={notification.get("report")} hidden={this.props.hidden} />
<NotificationOverlayContainer notification={notification} />
</div>
</HotKeys>
@@ -1,22 +1,22 @@
// Package imports.
import PropTypes from 'prop-types';
import PropTypes from "prop-types";
import { FormattedMessage } from 'react-intl';
import { FormattedMessage } from "react-intl";
import classNames from 'classnames';
import classNames from "classnames";
import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component';
import ImmutablePropTypes from "react-immutable-proptypes";
import ImmutablePureComponent from "react-immutable-pure-component";
import { HotKeys } from 'react-hotkeys';
import { HotKeys } from "react-hotkeys";
// Our imports.
import { Icon } from 'flavours/glitch/components/icon';
import Permalink from 'flavours/glitch/components/permalink';
import AccountContainer from 'flavours/glitch/containers/account_container';
import { Icon } from "flavours/glitch/components/icon";
import Permalink from "flavours/glitch/components/permalink";
import AccountContainer from "flavours/glitch/containers/account_container";
import NotificationOverlayContainer from '../containers/overlay_container';
import NotificationOverlayContainer from "../containers/overlay_container";
export default class NotificationFollow extends ImmutablePureComponent {
@@ -30,12 +30,12 @@ export default class NotificationFollow extends ImmutablePureComponent {
handleMoveUp = () => {
const { notification, onMoveUp } = this.props;
onMoveUp(notification.get('id'));
onMoveUp(notification.get("id"));
};
handleMoveDown = () => {
const { notification, onMoveDown } = this.props;
onMoveDown(notification.get('id'));
onMoveDown(notification.get("id"));
};
handleOpen = () => {
@@ -44,14 +44,14 @@ export default class NotificationFollow extends ImmutablePureComponent {
handleOpenProfile = () => {
const { notification } = this.props;
this.context.router.history.push(`/@${notification.getIn(['account', 'acct'])}`);
this.context.router.history.push(`/@${notification.getIn(["account", "acct"])}`);
};
handleMention = e => {
e.preventDefault();
const { notification, onMention } = this.props;
onMention(notification.get('account'), this.context.router.history);
onMention(notification.get("account"), this.context.router.history);
};
getHandlers () {
@@ -69,13 +69,13 @@ export default class NotificationFollow extends ImmutablePureComponent {
const { account, notification, hidden, unread } = this.props;
// Links to the display name.
const displayName = account.get('display_name_html') || account.get('username');
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')}`}
href={account.get("url")}
title={account.get("acct")}
to={`/@${account.get("acct")}`}
dangerouslySetInnerHTML={{ __html: displayName }}
/></bdi>
);
@@ -83,7 +83,7 @@ export default class NotificationFollow extends ImmutablePureComponent {
// Renders.
return (
<HotKeys handlers={this.getHandlers()}>
<div className={classNames('notification notification-admin-sign-up focusable', { unread })} tabIndex={0}>
<div className={classNames("notification notification-admin-sign-up focusable", { unread })} tabIndex={0}>
<div className='notification__message'>
<div className='notification__favourite-icon-wrapper'>
<Icon fixedWidth id='user-plus' />
@@ -96,7 +96,7 @@ export default class NotificationFollow extends ImmutablePureComponent {
/>
</div>
<AccountContainer hidden={hidden} id={account.get('id')} withNote={false} />
<AccountContainer hidden={hidden} id={account.get("id")} withNote={false} />
<NotificationOverlayContainer notification={notification} />
</div>
</HotKeys>
@@ -1,9 +1,9 @@
import PropTypes from 'prop-types';
import { Component } from 'react';
import PropTypes from "prop-types";
import { Component } from "react";
import { FormattedMessage } from 'react-intl';
import { FormattedMessage } from "react-intl";
import { Icon } from 'flavours/glitch/components/icon';
import { Icon } from "flavours/glitch/components/icon";
export default class ClearColumnButton extends Component {
@@ -1,16 +1,16 @@
import PropTypes from 'prop-types';
import { PureComponent } from 'react';
import PropTypes from "prop-types";
import { PureComponent } from "react";
import { FormattedMessage } from 'react-intl';
import { FormattedMessage } from "react-intl";
import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePropTypes from "react-immutable-proptypes";
import { PERMISSION_MANAGE_USERS, PERMISSION_MANAGE_REPORTS } from 'flavours/glitch/permissions';
import { PERMISSION_MANAGE_USERS, PERMISSION_MANAGE_REPORTS } from "flavours/glitch/permissions";
import ClearColumnButton from './clear_column_button';
import GrantPermissionButton from './grant_permission_button';
import PillBarButton from './pill_bar_button';
import SettingToggle from './setting_toggle';
import ClearColumnButton from "./clear_column_button";
import GrantPermissionButton from "./grant_permission_button";
import PillBarButton from "./pill_bar_button";
import SettingToggle from "./setting_toggle";
export default class ColumnSettings extends PureComponent {
@@ -30,7 +30,7 @@ export default class ColumnSettings extends PureComponent {
};
onPushChange = (path, checked) => {
this.props.onChange(['push', ...path], checked);
this.props.onChange(["push", ...path], checked);
};
render () {
@@ -43,18 +43,18 @@ export default class ColumnSettings extends PureComponent {
const showStr = <FormattedMessage id='notifications.column_settings.show' defaultMessage='Show in column' />;
const soundStr = <FormattedMessage id='notifications.column_settings.sound' defaultMessage='Play sound' />;
const showPushSettings = pushSettings.get('browserSupport') && pushSettings.get('isSubscribed');
const showPushSettings = pushSettings.get("browserSupport") && pushSettings.get("isSubscribed");
const pushStr = showPushSettings && <FormattedMessage id='notifications.column_settings.push' defaultMessage='Push notifications' />;
return (
<div>
{alertsEnabled && browserSupport && browserPermission === 'denied' && (
{alertsEnabled && browserSupport && browserPermission === "denied" && (
<div className='column-settings__row column-settings__row--with-margin'>
<span className='warning-hint'><FormattedMessage id='notifications.permission_denied' defaultMessage='Desktop notifications are unavailable due to previously denied browser permissions request' /></span>
</div>
)}
{alertsEnabled && browserSupport && browserPermission === 'default' && (
{alertsEnabled && browserSupport && browserPermission === "default" && (
<div className='column-settings__row column-settings__row--with-margin'>
<span className='warning-hint'>
<FormattedMessage id='notifications.permission_required' defaultMessage='Desktop notifications are unavailable because the required permission has not been granted.' /> <GrantPermissionButton onClick={onRequestNotificationPermission} />
@@ -72,7 +72,7 @@ export default class ColumnSettings extends PureComponent {
</span>
<div className='column-settings__row'>
<SettingToggle id='unread-notification-markers' prefix='notifications' settings={settings} settingPath={['showUnread']} onChange={onChange} label={unreadMarkersShowStr} />
<SettingToggle id='unread-notification-markers' prefix='notifications' settings={settings} settingPath={["showUnread"]} onChange={onChange} label={unreadMarkersShowStr} />
</div>
</div>
@@ -82,8 +82,8 @@ export default class ColumnSettings extends PureComponent {
</span>
<div className='column-settings__row'>
<SettingToggle id='show-filter-bar' prefix='notifications' settings={settings} settingPath={['quickFilter', 'show']} onChange={onChange} label={filterBarShowStr} />
<SettingToggle id='show-filter-bar' prefix='notifications' settings={settings} settingPath={['quickFilter', 'advanced']} onChange={onChange} label={filterAdvancedStr} />
<SettingToggle id='show-filter-bar' prefix='notifications' settings={settings} settingPath={["quickFilter", "show"]} onChange={onChange} label={filterBarShowStr} />
<SettingToggle id='show-filter-bar' prefix='notifications' settings={settings} settingPath={["quickFilter", "advanced"]} onChange={onChange} label={filterAdvancedStr} />
</div>
</div>
@@ -91,10 +91,10 @@ export default class ColumnSettings extends PureComponent {
<span id='notifications-follow' className='column-settings__section'><FormattedMessage id='notifications.column_settings.follow' defaultMessage='New followers:' /></span>
<div className='column-settings__pillbar'>
<PillBarButton disabled={browserPermission === 'denied'} prefix='notifications_desktop' settings={settings} settingPath={['alerts', 'follow']} onChange={onChange} label={alertStr} />
{showPushSettings && <PillBarButton prefix='notifications_push' settings={pushSettings} settingPath={['alerts', 'follow']} onChange={this.onPushChange} label={pushStr} />}
<PillBarButton prefix='notifications' settings={settings} settingPath={['shows', 'follow']} onChange={onChange} label={showStr} />
<PillBarButton prefix='notifications' settings={settings} settingPath={['sounds', 'follow']} onChange={onChange} label={soundStr} />
<PillBarButton disabled={browserPermission === "denied"} prefix='notifications_desktop' settings={settings} settingPath={["alerts", "follow"]} onChange={onChange} label={alertStr} />
{showPushSettings && <PillBarButton prefix='notifications_push' settings={pushSettings} settingPath={["alerts", "follow"]} onChange={this.onPushChange} label={pushStr} />}
<PillBarButton prefix='notifications' settings={settings} settingPath={["shows", "follow"]} onChange={onChange} label={showStr} />
<PillBarButton prefix='notifications' settings={settings} settingPath={["sounds", "follow"]} onChange={onChange} label={soundStr} />
</div>
</div>
@@ -102,10 +102,10 @@ export default class ColumnSettings extends PureComponent {
<span id='notifications-follow-request' className='column-settings__section'><FormattedMessage id='notifications.column_settings.follow_request' defaultMessage='New follow requests:' /></span>
<div className='column-settings__pillbar'>
<PillBarButton disabled={browserPermission === 'denied'} prefix='notifications_desktop' settings={settings} settingPath={['alerts', 'follow_request']} onChange={onChange} label={alertStr} />
{showPushSettings && <PillBarButton prefix='notifications_push' settings={pushSettings} settingPath={['alerts', 'follow_request']} onChange={this.onPushChange} label={pushStr} />}
<PillBarButton prefix='notifications' settings={settings} settingPath={['shows', 'follow_request']} onChange={onChange} label={showStr} />
<PillBarButton prefix='notifications' settings={settings} settingPath={['sounds', 'follow_request']} onChange={onChange} label={soundStr} />
<PillBarButton disabled={browserPermission === "denied"} prefix='notifications_desktop' settings={settings} settingPath={["alerts", "follow_request"]} onChange={onChange} label={alertStr} />
{showPushSettings && <PillBarButton prefix='notifications_push' settings={pushSettings} settingPath={["alerts", "follow_request"]} onChange={this.onPushChange} label={pushStr} />}
<PillBarButton prefix='notifications' settings={settings} settingPath={["shows", "follow_request"]} onChange={onChange} label={showStr} />
<PillBarButton prefix='notifications' settings={settings} settingPath={["sounds", "follow_request"]} onChange={onChange} label={soundStr} />
</div>
</div>
@@ -113,10 +113,10 @@ export default class ColumnSettings extends PureComponent {
<span id='notifications-favourite' className='column-settings__section'><FormattedMessage id='notifications.column_settings.favourite' defaultMessage='Favorites:' /></span>
<div className='column-settings__pillbar'>
<PillBarButton disabled={browserPermission === 'denied'} prefix='notifications_desktop' settings={settings} settingPath={['alerts', 'favourite']} onChange={onChange} label={alertStr} />
{showPushSettings && <PillBarButton prefix='notifications_push' settings={pushSettings} settingPath={['alerts', 'favourite']} onChange={this.onPushChange} label={pushStr} />}
<PillBarButton prefix='notifications' settings={settings} settingPath={['shows', 'favourite']} onChange={onChange} label={showStr} />
<PillBarButton prefix='notifications' settings={settings} settingPath={['sounds', 'favourite']} onChange={onChange} label={soundStr} />
<PillBarButton disabled={browserPermission === "denied"} prefix='notifications_desktop' settings={settings} settingPath={["alerts", "favourite"]} onChange={onChange} label={alertStr} />
{showPushSettings && <PillBarButton prefix='notifications_push' settings={pushSettings} settingPath={["alerts", "favourite"]} onChange={this.onPushChange} label={pushStr} />}
<PillBarButton prefix='notifications' settings={settings} settingPath={["shows", "favourite"]} onChange={onChange} label={showStr} />
<PillBarButton prefix='notifications' settings={settings} settingPath={["sounds", "favourite"]} onChange={onChange} label={soundStr} />
</div>
</div>
@@ -124,10 +124,10 @@ export default class ColumnSettings extends PureComponent {
<span id='notifications-mention' className='column-settings__section'><FormattedMessage id='notifications.column_settings.mention' defaultMessage='Mentions:' /></span>
<div className='column-settings__pillbar'>
<PillBarButton disabled={browserPermission === 'denied'} prefix='notifications_desktop' settings={settings} settingPath={['alerts', 'mention']} onChange={onChange} label={alertStr} />
{showPushSettings && <PillBarButton prefix='notifications_push' settings={pushSettings} settingPath={['alerts', 'mention']} onChange={this.onPushChange} label={pushStr} />}
<PillBarButton prefix='notifications' settings={settings} settingPath={['shows', 'mention']} onChange={onChange} label={showStr} />
<PillBarButton prefix='notifications' settings={settings} settingPath={['sounds', 'mention']} onChange={onChange} label={soundStr} />
<PillBarButton disabled={browserPermission === "denied"} prefix='notifications_desktop' settings={settings} settingPath={["alerts", "mention"]} onChange={onChange} label={alertStr} />
{showPushSettings && <PillBarButton prefix='notifications_push' settings={pushSettings} settingPath={["alerts", "mention"]} onChange={this.onPushChange} label={pushStr} />}
<PillBarButton prefix='notifications' settings={settings} settingPath={["shows", "mention"]} onChange={onChange} label={showStr} />
<PillBarButton prefix='notifications' settings={settings} settingPath={["sounds", "mention"]} onChange={onChange} label={soundStr} />
</div>
</div>
@@ -135,10 +135,10 @@ export default class ColumnSettings extends PureComponent {
<span id='notifications-reblog' className='column-settings__section'><FormattedMessage id='notifications.column_settings.reblog' defaultMessage='Boosts:' /></span>
<div className='column-settings__pillbar'>
<PillBarButton disabled={browserPermission === 'denied'} prefix='notifications_desktop' settings={settings} settingPath={['alerts', 'reblog']} onChange={onChange} label={alertStr} />
{showPushSettings && <PillBarButton prefix='notifications_push' settings={pushSettings} settingPath={['alerts', 'reblog']} onChange={this.onPushChange} label={pushStr} />}
<PillBarButton prefix='notifications' settings={settings} settingPath={['shows', 'reblog']} onChange={onChange} label={showStr} />
<PillBarButton prefix='notifications' settings={settings} settingPath={['sounds', 'reblog']} onChange={onChange} label={soundStr} />
<PillBarButton disabled={browserPermission === "denied"} prefix='notifications_desktop' settings={settings} settingPath={["alerts", "reblog"]} onChange={onChange} label={alertStr} />
{showPushSettings && <PillBarButton prefix='notifications_push' settings={pushSettings} settingPath={["alerts", "reblog"]} onChange={this.onPushChange} label={pushStr} />}
<PillBarButton prefix='notifications' settings={settings} settingPath={["shows", "reblog"]} onChange={onChange} label={showStr} />
<PillBarButton prefix='notifications' settings={settings} settingPath={["sounds", "reblog"]} onChange={onChange} label={soundStr} />
</div>
</div>
@@ -146,10 +146,10 @@ export default class ColumnSettings extends PureComponent {
<span id='notifications-poll' className='column-settings__section'><FormattedMessage id='notifications.column_settings.poll' defaultMessage='Poll results:' /></span>
<div className='column-settings__pillbar'>
<PillBarButton disabled={browserPermission === 'denied'} prefix='notifications_desktop' settings={settings} settingPath={['alerts', 'poll']} onChange={onChange} label={alertStr} />
{showPushSettings && <PillBarButton prefix='notifications_push' settings={pushSettings} settingPath={['alerts', 'poll']} onChange={this.onPushChange} label={pushStr} />}
<PillBarButton prefix='notifications' settings={settings} settingPath={['shows', 'poll']} onChange={onChange} label={showStr} />
<PillBarButton prefix='notifications' settings={settings} settingPath={['sounds', 'poll']} onChange={onChange} label={soundStr} />
<PillBarButton disabled={browserPermission === "denied"} prefix='notifications_desktop' settings={settings} settingPath={["alerts", "poll"]} onChange={onChange} label={alertStr} />
{showPushSettings && <PillBarButton prefix='notifications_push' settings={pushSettings} settingPath={["alerts", "poll"]} onChange={this.onPushChange} label={pushStr} />}
<PillBarButton prefix='notifications' settings={settings} settingPath={["shows", "poll"]} onChange={onChange} label={showStr} />
<PillBarButton prefix='notifications' settings={settings} settingPath={["sounds", "poll"]} onChange={onChange} label={soundStr} />
</div>
</div>
@@ -157,10 +157,10 @@ export default class ColumnSettings extends PureComponent {
<span id='notifications-status' className='column-settings__section'><FormattedMessage id='notifications.column_settings.status' defaultMessage='New posts:' /></span>
<div className='column-settings__pillbar'>
<PillBarButton disabled={browserPermission === 'denied'} prefix='notifications_desktop' settings={settings} settingPath={['alerts', 'status']} onChange={onChange} label={alertStr} />
{showPushSettings && <PillBarButton prefix='notifications_push' settings={pushSettings} settingPath={['alerts', 'status']} onChange={this.onPushChange} label={pushStr} />}
<PillBarButton prefix='notifications' settings={settings} settingPath={['shows', 'status']} onChange={onChange} label={showStr} />
<PillBarButton prefix='notifications' settings={settings} settingPath={['sounds', 'status']} onChange={onChange} label={soundStr} />
<PillBarButton disabled={browserPermission === "denied"} prefix='notifications_desktop' settings={settings} settingPath={["alerts", "status"]} onChange={onChange} label={alertStr} />
{showPushSettings && <PillBarButton prefix='notifications_push' settings={pushSettings} settingPath={["alerts", "status"]} onChange={this.onPushChange} label={pushStr} />}
<PillBarButton prefix='notifications' settings={settings} settingPath={["shows", "status"]} onChange={onChange} label={showStr} />
<PillBarButton prefix='notifications' settings={settings} settingPath={["sounds", "status"]} onChange={onChange} label={soundStr} />
</div>
</div>
@@ -168,10 +168,10 @@ export default class ColumnSettings extends PureComponent {
<span id='notifications-update' className='column-settings__section'><FormattedMessage id='notifications.column_settings.update' defaultMessage='Edits:' /></span>
<div className='column-settings__pillbar'>
<PillBarButton disabled={browserPermission === 'denied'} prefix='notifications_desktop' settings={settings} settingPath={['alerts', 'update']} onChange={onChange} label={alertStr} />
{showPushSettings && <PillBarButton prefix='notifications_push' settings={pushSettings} settingPath={['alerts', 'update']} onChange={this.onPushChange} label={pushStr} />}
<PillBarButton prefix='notifications' settings={settings} settingPath={['shows', 'update']} onChange={onChange} label={showStr} />
<PillBarButton prefix='notifications' settings={settings} settingPath={['sounds', 'update']} onChange={onChange} label={soundStr} />
<PillBarButton disabled={browserPermission === "denied"} prefix='notifications_desktop' settings={settings} settingPath={["alerts", "update"]} onChange={onChange} label={alertStr} />
{showPushSettings && <PillBarButton prefix='notifications_push' settings={pushSettings} settingPath={["alerts", "update"]} onChange={this.onPushChange} label={pushStr} />}
<PillBarButton prefix='notifications' settings={settings} settingPath={["shows", "update"]} onChange={onChange} label={showStr} />
<PillBarButton prefix='notifications' settings={settings} settingPath={["sounds", "update"]} onChange={onChange} label={soundStr} />
</div>
</div>
@@ -180,10 +180,10 @@ export default class ColumnSettings extends PureComponent {
<span id='notifications-status' className='column-settings__section'><FormattedMessage id='notifications.column_settings.admin.sign_up' defaultMessage='New sign-ups:' /></span>
<div className='column-settings__pillbar'>
<PillBarButton disabled={browserPermission === 'denied'} prefix='notifications_desktop' settings={settings} settingPath={['alerts', 'admin.sign_up']} onChange={onChange} label={alertStr} />
{showPushSettings && <PillBarButton prefix='notifications_push' settings={pushSettings} settingPath={['alerts', 'admin.sign_up']} onChange={this.onPushChange} label={pushStr} />}
<PillBarButton prefix='notifications' settings={settings} settingPath={['shows', 'admin.sign_up']} onChange={onChange} label={showStr} />
<PillBarButton prefix='notifications' settings={settings} settingPath={['sounds', 'admin.sign_up']} onChange={onChange} label={soundStr} />
<PillBarButton disabled={browserPermission === "denied"} prefix='notifications_desktop' settings={settings} settingPath={["alerts", "admin.sign_up"]} onChange={onChange} label={alertStr} />
{showPushSettings && <PillBarButton prefix='notifications_push' settings={pushSettings} settingPath={["alerts", "admin.sign_up"]} onChange={this.onPushChange} label={pushStr} />}
<PillBarButton prefix='notifications' settings={settings} settingPath={["shows", "admin.sign_up"]} onChange={onChange} label={showStr} />
<PillBarButton prefix='notifications' settings={settings} settingPath={["sounds", "admin.sign_up"]} onChange={onChange} label={soundStr} />
</div>
</div>
)}
@@ -193,10 +193,10 @@ export default class ColumnSettings extends PureComponent {
<span id='notifications-status' className='column-settings__section'><FormattedMessage id='notifications.column_settings.admin.report' defaultMessage='New reports:' /></span>
<div className='column-settings__pillbar'>
<PillBarButton disabled={browserPermission === 'denied'} prefix='notifications_desktop' settings={settings} settingPath={['alerts', 'admin.report']} onChange={onChange} label={alertStr} />
{showPushSettings && <PillBarButton prefix='notifications_push' settings={pushSettings} settingPath={['alerts', 'admin.report']} onChange={this.onPushChange} label={pushStr} />}
<PillBarButton prefix='notifications' settings={settings} settingPath={['shows', 'admin.report']} onChange={onChange} label={showStr} />
<PillBarButton prefix='notifications' settings={settings} settingPath={['sounds', 'admin.report']} onChange={onChange} label={soundStr} />
<PillBarButton disabled={browserPermission === "denied"} prefix='notifications_desktop' settings={settings} settingPath={["alerts", "admin.report"]} onChange={onChange} label={alertStr} />
{showPushSettings && <PillBarButton prefix='notifications_push' settings={pushSettings} settingPath={["alerts", "admin.report"]} onChange={this.onPushChange} label={pushStr} />}
<PillBarButton prefix='notifications' settings={settings} settingPath={["shows", "admin.report"]} onChange={onChange} label={showStr} />
<PillBarButton prefix='notifications' settings={settings} settingPath={["sounds", "admin.report"]} onChange={onChange} label={soundStr} />
</div>
</div>
)}
@@ -1,17 +1,17 @@
import PropTypes from 'prop-types';
import { PureComponent } from 'react';
import PropTypes from "prop-types";
import { PureComponent } from "react";
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import { defineMessages, injectIntl, FormattedMessage } from "react-intl";
import { Icon } from 'flavours/glitch/components/icon';
import { Icon } from "flavours/glitch/components/icon";
const tooltips = defineMessages({
mentions: { id: 'notifications.filter.mentions', defaultMessage: 'Mentions' },
favourites: { id: 'notifications.filter.favourites', defaultMessage: 'Favorites' },
boosts: { id: 'notifications.filter.boosts', defaultMessage: 'Boosts' },
polls: { id: 'notifications.filter.polls', defaultMessage: 'Poll results' },
follows: { id: 'notifications.filter.follows', defaultMessage: 'Follows' },
statuses: { id: 'notifications.filter.statuses', defaultMessage: 'Updates from people you follow' },
mentions: { id: "notifications.filter.mentions", defaultMessage: "Mentions" },
favourites: { id: "notifications.filter.favourites", defaultMessage: "Favorites" },
boosts: { id: "notifications.filter.boosts", defaultMessage: "Boosts" },
polls: { id: "notifications.filter.polls", defaultMessage: "Poll results" },
follows: { id: "notifications.filter.follows", defaultMessage: "Follows" },
statuses: { id: "notifications.filter.statuses", defaultMessage: "Updates from people you follow" },
});
class FilterBar extends PureComponent {
@@ -32,8 +32,8 @@ class FilterBar extends PureComponent {
const renderedElement = !advancedMode ? (
<div className='notification__filter-bar'>
<button
className={selectedFilter === 'all' ? 'active' : ''}
onClick={this.onClick('all')}
className={selectedFilter === "all" ? "active" : ""}
onClick={this.onClick("all")}
>
<FormattedMessage
id='notifications.filter.all'
@@ -41,8 +41,8 @@ class FilterBar extends PureComponent {
/>
</button>
<button
className={selectedFilter === 'mention' ? 'active' : ''}
onClick={this.onClick('mention')}
className={selectedFilter === "mention" ? "active" : ""}
onClick={this.onClick("mention")}
>
<FormattedMessage
id='notifications.filter.mentions'
@@ -53,8 +53,8 @@ class FilterBar extends PureComponent {
) : (
<div className='notification__filter-bar'>
<button
className={selectedFilter === 'all' ? 'active' : ''}
onClick={this.onClick('all')}
className={selectedFilter === "all" ? "active" : ""}
onClick={this.onClick("all")}
>
<FormattedMessage
id='notifications.filter.all'
@@ -62,43 +62,43 @@ class FilterBar extends PureComponent {
/>
</button>
<button
className={selectedFilter === 'mention' ? 'active' : ''}
onClick={this.onClick('mention')}
className={selectedFilter === "mention" ? "active" : ""}
onClick={this.onClick("mention")}
title={intl.formatMessage(tooltips.mentions)}
>
<Icon id='reply-all' fixedWidth />
</button>
<button
className={selectedFilter === 'favourite' ? 'active' : ''}
onClick={this.onClick('favourite')}
className={selectedFilter === "favourite" ? "active" : ""}
onClick={this.onClick("favourite")}
title={intl.formatMessage(tooltips.favourites)}
>
<Icon id='star' fixedWidth />
</button>
<button
className={selectedFilter === 'reblog' ? 'active' : ''}
onClick={this.onClick('reblog')}
className={selectedFilter === "reblog" ? "active" : ""}
onClick={this.onClick("reblog")}
title={intl.formatMessage(tooltips.boosts)}
>
<Icon id='retweet' fixedWidth />
</button>
<button
className={selectedFilter === 'poll' ? 'active' : ''}
onClick={this.onClick('poll')}
className={selectedFilter === "poll" ? "active" : ""}
onClick={this.onClick("poll")}
title={intl.formatMessage(tooltips.polls)}
>
<Icon id='tasks' fixedWidth />
</button>
<button
className={selectedFilter === 'status' ? 'active' : ''}
onClick={this.onClick('status')}
className={selectedFilter === "status" ? "active" : ""}
onClick={this.onClick("status")}
title={intl.formatMessage(tooltips.statuses)}
>
<Icon id='home' fixedWidth />
</button>
<button
className={selectedFilter === 'follow' ? 'active' : ''}
onClick={this.onClick('follow')}
className={selectedFilter === "follow" ? "active" : ""}
onClick={this.onClick("follow")}
title={intl.formatMessage(tooltips.follows)}
>
<Icon id='user-plus' fixedWidth />
@@ -1,22 +1,22 @@
// Package imports.
import PropTypes from 'prop-types';
import PropTypes from "prop-types";
import { FormattedMessage } from 'react-intl';
import { FormattedMessage } from "react-intl";
import classNames from 'classnames';
import classNames from "classnames";
import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component';
import ImmutablePropTypes from "react-immutable-proptypes";
import ImmutablePureComponent from "react-immutable-pure-component";
import { HotKeys } from 'react-hotkeys';
import { HotKeys } from "react-hotkeys";
// Our imports.
import { Icon } from 'flavours/glitch/components/icon';
import Permalink from 'flavours/glitch/components/permalink';
import AccountContainer from 'flavours/glitch/containers/account_container';
import { Icon } from "flavours/glitch/components/icon";
import Permalink from "flavours/glitch/components/permalink";
import AccountContainer from "flavours/glitch/containers/account_container";
import NotificationOverlayContainer from '../containers/overlay_container';
import NotificationOverlayContainer from "../containers/overlay_container";
export default class NotificationFollow extends ImmutablePureComponent {
@@ -30,12 +30,12 @@ export default class NotificationFollow extends ImmutablePureComponent {
handleMoveUp = () => {
const { notification, onMoveUp } = this.props;
onMoveUp(notification.get('id'));
onMoveUp(notification.get("id"));
};
handleMoveDown = () => {
const { notification, onMoveDown } = this.props;
onMoveDown(notification.get('id'));
onMoveDown(notification.get("id"));
};
handleOpen = () => {
@@ -44,14 +44,14 @@ export default class NotificationFollow extends ImmutablePureComponent {
handleOpenProfile = () => {
const { notification } = this.props;
this.context.router.history.push(`/@${notification.getIn(['account', 'acct'])}`);
this.context.router.history.push(`/@${notification.getIn(["account", "acct"])}`);
};
handleMention = e => {
e.preventDefault();
const { notification, onMention } = this.props;
onMention(notification.get('account'), this.context.router.history);
onMention(notification.get("account"), this.context.router.history);
};
getHandlers () {
@@ -69,13 +69,13 @@ export default class NotificationFollow extends ImmutablePureComponent {
const { account, notification, hidden, unread } = this.props;
// Links to the display name.
const displayName = account.get('display_name_html') || account.get('username');
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')}`}
href={account.get("url")}
title={account.get("acct")}
to={`/@${account.get("acct")}`}
dangerouslySetInnerHTML={{ __html: displayName }}
/></bdi>
);
@@ -83,7 +83,7 @@ export default class NotificationFollow extends ImmutablePureComponent {
// Renders.
return (
<HotKeys handlers={this.getHandlers()}>
<div className={classNames('notification notification-follow focusable', { unread })} tabIndex={0}>
<div className={classNames("notification notification-follow focusable", { unread })} tabIndex={0}>
<div className='notification__message'>
<div className='notification__favourite-icon-wrapper'>
<Icon fixedWidth id='user-plus' />
@@ -96,7 +96,7 @@ export default class NotificationFollow extends ImmutablePureComponent {
/>
</div>
<AccountContainer hidden={hidden} id={account.get('id')} withNote={false} />
<AccountContainer hidden={hidden} id={account.get("id")} withNote={false} />
<NotificationOverlayContainer notification={notification} />
</div>
</HotKeys>
@@ -1,25 +1,25 @@
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 classNames from 'classnames';
import classNames from "classnames";
import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component';
import ImmutablePropTypes from "react-immutable-proptypes";
import ImmutablePureComponent from "react-immutable-pure-component";
import { HotKeys } from 'react-hotkeys';
import { HotKeys } from "react-hotkeys";
import { Avatar } from 'flavours/glitch/components/avatar';
import { DisplayName } from 'flavours/glitch/components/display_name';
import { Icon } from 'flavours/glitch/components/icon';
import { IconButton } from 'flavours/glitch/components/icon_button';
import Permalink from 'flavours/glitch/components/permalink';
import { Avatar } from "flavours/glitch/components/avatar";
import { DisplayName } from "flavours/glitch/components/display_name";
import { Icon } from "flavours/glitch/components/icon";
import { IconButton } from "flavours/glitch/components/icon_button";
import Permalink from "flavours/glitch/components/permalink";
import NotificationOverlayContainer from '../containers/overlay_container';
import NotificationOverlayContainer from "../containers/overlay_container";
const messages = defineMessages({
authorize: { id: 'follow_request.authorize', defaultMessage: 'Authorize' },
reject: { id: 'follow_request.reject', defaultMessage: 'Reject' },
authorize: { id: "follow_request.authorize", defaultMessage: "Authorize" },
reject: { id: "follow_request.reject", defaultMessage: "Reject" },
});
class FollowRequest extends ImmutablePureComponent {
@@ -35,12 +35,12 @@ class FollowRequest extends ImmutablePureComponent {
handleMoveUp = () => {
const { notification, onMoveUp } = this.props;
onMoveUp(notification.get('id'));
onMoveUp(notification.get("id"));
};
handleMoveDown = () => {
const { notification, onMoveDown } = this.props;
onMoveDown(notification.get('id'));
onMoveDown(notification.get("id"));
};
handleOpen = () => {
@@ -49,14 +49,14 @@ class FollowRequest extends ImmutablePureComponent {
handleOpenProfile = () => {
const { notification } = this.props;
this.context.router.history.push(`/@${notification.getIn(['account', 'acct'])}`);
this.context.router.history.push(`/@${notification.getIn(["account", "acct"])}`);
};
handleMention = e => {
e.preventDefault();
const { notification, onMention } = this.props;
onMention(notification.get('account'), this.context.router.history);
onMention(notification.get("account"), this.context.router.history);
};
getHandlers () {
@@ -80,27 +80,27 @@ class FollowRequest extends ImmutablePureComponent {
if (hidden) {
return (
<>
{account.get('display_name')}
{account.get('username')}
{account.get("display_name")}
{account.get("username")}
</>
);
}
// Links to the display name.
const displayName = account.get('display_name_html') || account.get('username');
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')}`}
href={account.get("url")}
title={account.get("acct")}
to={`/@${account.get("acct")}`}
dangerouslySetInnerHTML={{ __html: displayName }}
/></bdi>
);
return (
<HotKeys handlers={this.getHandlers()}>
<div className={classNames('notification notification-follow-request focusable', { unread })} tabIndex={0}>
<div className={classNames("notification notification-follow-request focusable", { unread })} tabIndex={0}>
<div className='notification__message'>
<div className='notification__favourite-icon-wrapper'>
<Icon id='user' fixedWidth />
@@ -115,7 +115,7 @@ class FollowRequest extends ImmutablePureComponent {
<div className='account'>
<div className='account__wrapper'>
<Permalink key={account.get('id')} className='account__display-name' title={account.get('acct')} href={account.get('url')} to={`/@${account.get('acct')}`}>
<Permalink key={account.get("id")} className='account__display-name' title={account.get("acct")} href={account.get("url")} to={`/@${account.get("acct")}`}>
<div className='account__avatar-wrapper'><Avatar account={account} size={36} /></div>
<DisplayName account={account} />
</Permalink>
@@ -1,7 +1,7 @@
import PropTypes from 'prop-types';
import { PureComponent } from 'react';
import PropTypes from "prop-types";
import { PureComponent } from "react";
import { FormattedMessage } from 'react-intl';
import { FormattedMessage } from "react-intl";
export default class GrantPermissionButton extends PureComponent {
@@ -1,17 +1,17 @@
// Package imports.
import PropTypes from 'prop-types';
import PropTypes from "prop-types";
import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component';
import ImmutablePropTypes from "react-immutable-proptypes";
import ImmutablePureComponent from "react-immutable-pure-component";
// Our imports,
import StatusContainer from 'flavours/glitch/containers/status_container';
import StatusContainer from "flavours/glitch/containers/status_container";
import NotificationAdminReportContainer from '../containers/admin_report_container';
import NotificationFollowRequestContainer from '../containers/follow_request_container';
import NotificationAdminReportContainer from "../containers/admin_report_container";
import NotificationFollowRequestContainer from "../containers/follow_request_container";
import NotificationAdminSignup from './admin_signup';
import NotificationFollow from './follow';
import NotificationAdminSignup from "./admin_signup";
import NotificationFollow from "./follow";
export default class Notification extends ImmutablePureComponent {
@@ -40,196 +40,196 @@ export default class Notification extends ImmutablePureComponent {
updateScrollBottom,
} = this.props;
switch(notification.get('type')) {
case 'follow':
return (
<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':
return (
<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':
return (
<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':
return (
<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 'reblog':
return (
<StatusContainer
containerId={notification.get('id')}
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':
return (
<StatusContainer
containerId={notification.get('id')}
hidden={hidden}
id={notification.get('status')}
account={notification.get('account')}
prepend='update'
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;
switch(notification.get("type")) {
case "follow":
return (
<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":
return (
<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":
return (
<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":
return (
<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 "reblog":
return (
<StatusContainer
containerId={notification.get("id")}
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":
return (
<StatusContainer
containerId={notification.get("id")}
hidden={hidden}
id={notification.get("status")}
account={notification.get("account")}
prepend='update'
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;
}
}
@@ -1,20 +1,20 @@
import PropTypes from 'prop-types';
import { PureComponent } from 'react';
import PropTypes from "prop-types";
import { PureComponent } from "react";
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import { defineMessages, injectIntl, FormattedMessage } from "react-intl";
import { connect } from 'react-redux';
import { connect } from "react-redux";
import { requestBrowserPermission } from 'flavours/glitch/actions/notifications';
import { changeSetting } from 'flavours/glitch/actions/settings';
import Button from 'flavours/glitch/components/button';
import { Icon } from 'flavours/glitch/components/icon';
import { IconButton } from 'flavours/glitch/components/icon_button';
import { requestBrowserPermission } from "flavours/glitch/actions/notifications";
import { changeSetting } from "flavours/glitch/actions/settings";
import Button from "flavours/glitch/components/button";
import { Icon } from "flavours/glitch/components/icon";
import { IconButton } from "flavours/glitch/components/icon_button";
const messages = defineMessages({
close: { id: 'lightbox.close', defaultMessage: 'Close' },
close: { id: "lightbox.close", defaultMessage: "Close" },
});
class NotificationsPermissionBanner extends PureComponent {
@@ -29,7 +29,7 @@ class NotificationsPermissionBanner extends PureComponent {
};
handleClose = () => {
this.props.dispatch(changeSetting(['notifications', 'dismissPermissionBanner'], true));
this.props.dispatch(changeSetting(["notifications", "dismissPermissionBanner"], true));
};
render () {
@@ -4,17 +4,17 @@
// Package imports.
import PropTypes from 'prop-types';
import PropTypes from "prop-types";
import { defineMessages, injectIntl } from 'react-intl';
import { defineMessages, injectIntl } from "react-intl";
import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component';
import ImmutablePropTypes from "react-immutable-proptypes";
import ImmutablePureComponent from "react-immutable-pure-component";
import { Icon } from 'flavours/glitch/components/icon';
import { Icon } from "flavours/glitch/components/icon";
const messages = defineMessages({
markForDeletion: { id: 'notification.markForDeletion', defaultMessage: 'Mark for deletion' },
markForDeletion: { id: "notification.markForDeletion", defaultMessage: "Mark for deletion" },
});
class NotificationOverlay extends ImmutablePureComponent {
@@ -27,15 +27,15 @@ class NotificationOverlay extends ImmutablePureComponent {
};
onToggleMark = () => {
const mark = !this.props.notification.get('markedForDelete');
const id = this.props.notification.get('id');
const mark = !this.props.notification.get("markedForDelete");
const id = this.props.notification.get("id");
this.props.onMarkForDelete(id, mark);
};
render () {
const { notification, show, intl } = this.props;
const active = notification.get('markedForDelete');
const active = notification.get("markedForDelete");
const label = intl.formatMessage(messages.markForDeletion);
return show ? (
@@ -44,12 +44,12 @@ class NotificationOverlay extends ImmutablePureComponent {
role='checkbox'
aria-checked={active}
tabIndex={0}
className={`notification__dismiss-overlay ${active ? 'active' : ''}`}
className={`notification__dismiss-overlay ${active ? "active" : ""}`}
onClick={this.onToggleMark}
>
<div className='wrappy'>
<div className='ckbox' aria-hidden='true' title={label}>
{active ? (<Icon id='check' />) : ''}
{active ? (<Icon id='check' />) : ""}
</div>
</div>
</div>
@@ -1,9 +1,9 @@
import PropTypes from 'prop-types';
import { PureComponent } from 'react';
import PropTypes from "prop-types";
import { PureComponent } from "react";
import classNames from 'classnames';
import classNames from "classnames";
import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePropTypes from "react-immutable-proptypes";
export default class PillBarButton extends PureComponent {
@@ -23,14 +23,14 @@ export default class PillBarButton extends PureComponent {
render () {
const { prefix, settings, settingPath, label, disabled } = this.props;
const id = ['setting-pillbar-button', prefix, ...settingPath].filter(Boolean).join('-');
const id = ["setting-pillbar-button", prefix, ...settingPath].filter(Boolean).join("-");
const active = settings.getIn(settingPath);
return (
<button
key={id}
id={id}
className={classNames('pillbar-button', { active })}
className={classNames("pillbar-button", { active })}
disabled={disabled}
onClick={this.onChange}
aria-pressed={active}
@@ -1,20 +1,20 @@
import PropTypes from 'prop-types';
import PropTypes from "prop-types";
import { defineMessages, FormattedMessage, injectIntl } from 'react-intl';
import { defineMessages, FormattedMessage, injectIntl } from "react-intl";
import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component';
import ImmutablePropTypes from "react-immutable-proptypes";
import ImmutablePureComponent from "react-immutable-pure-component";
import AvatarOverlay from 'flavours/glitch/components/avatar_overlay';
import { RelativeTimestamp } from 'flavours/glitch/components/relative_timestamp';
import AvatarOverlay from "flavours/glitch/components/avatar_overlay";
import { RelativeTimestamp } from "flavours/glitch/components/relative_timestamp";
// This needs to be kept in sync with app/models/report.rb
const messages = defineMessages({
openReport: { id: 'report_notification.open', defaultMessage: 'Open report' },
other: { id: 'report_notification.categories.other', defaultMessage: 'Other' },
spam: { id: 'report_notification.categories.spam', defaultMessage: 'Spam' },
legal: { id: 'report_notification.categories.legal', defaultMessage: 'Legal' },
violation: { id: 'report_notification.categories.violation', defaultMessage: 'Rule violation' },
openReport: { id: "report_notification.open", defaultMessage: "Open report" },
other: { id: "report_notification.categories.other", defaultMessage: "Other" },
spam: { id: "report_notification.categories.spam", defaultMessage: "Spam" },
legal: { id: "report_notification.categories.legal", defaultMessage: "Legal" },
violation: { id: "report_notification.categories.violation", defaultMessage: "Rule violation" },
});
class Report extends ImmutablePureComponent {
@@ -36,7 +36,7 @@ class Report extends ImmutablePureComponent {
if (hidden) {
return (
<>
{report.get('id')}
{report.get("id")}
</>
);
}
@@ -44,18 +44,18 @@ class Report extends ImmutablePureComponent {
return (
<div className='notification__report'>
<div className='notification__report__avatar'>
<AvatarOverlay account={report.get('target_account')} friend={account} />
<AvatarOverlay account={report.get("target_account")} friend={account} />
</div>
<div className='notification__report__details'>
<div>
<RelativeTimestamp timestamp={report.get('created_at')} short={false} /> · <FormattedMessage id='report_notification.attached_statuses' defaultMessage='{count, plural, one {# post} other {# posts}} attached' values={{ count: report.get('status_ids').size }} />
<RelativeTimestamp timestamp={report.get("created_at")} short={false} /> · <FormattedMessage id='report_notification.attached_statuses' defaultMessage='{count, plural, one {# post} other {# posts}} attached' values={{ count: report.get("status_ids").size }} />
<br />
<strong>{intl.formatMessage(messages[report.get('category')])}</strong>
<strong>{intl.formatMessage(messages[report.get("category")])}</strong>
</div>
<div className='notification__report__actions'>
<a href={`/admin/reports/${report.get('id')}`} className='button' target='_blank' rel='noopener noreferrer'>{intl.formatMessage(messages.openReport)}</a>
<a href={`/admin/reports/${report.get("id")}`} className='button' target='_blank' rel='noopener noreferrer'>{intl.formatMessage(messages.openReport)}</a>
</div>
</div>
</div>
@@ -1,9 +1,9 @@
import PropTypes from 'prop-types';
import { PureComponent } from 'react';
import PropTypes from "prop-types";
import { PureComponent } from "react";
import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePropTypes from "react-immutable-proptypes";
import Toggle from 'react-toggle';
import Toggle from "react-toggle";
export default class SettingToggle extends PureComponent {
@@ -24,7 +24,7 @@ export default class SettingToggle extends PureComponent {
render () {
const { prefix, settings, settingPath, label, meta, defaultValue, disabled } = this.props;
const id = ['setting-toggle', prefix, ...settingPath].filter(Boolean).join('-');
const id = ["setting-toggle", prefix, ...settingPath].filter(Boolean).join("-");
return (
<div className='setting-toggle'>