Browse Source

Satisfy eslint.

closed-social-glitch-2
Surinna Curtis 7 years ago
parent
commit
2ea9b164d3
4 changed files with 26 additions and 27 deletions
  1. +1
    -4
      app/javascript/glitch/components/status/container.js
  2. +0
    -1
      app/javascript/mastodon/features/account_timeline/containers/header_container.js
  3. +6
    -3
      app/javascript/mastodon/features/ui/components/mute_modal.js
  4. +19
    -19
      app/javascript/mastodon/reducers/mutes.js

+ 1
- 4
app/javascript/glitch/components/status/container.js View File

@ -39,10 +39,7 @@ import {
unreblog,
unfavourite,
} from '../../../mastodon/actions/interactions';
import {
blockAccount,
muteAccount,
} from '../../../mastodon/actions/accounts';
import { blockAccount } from '../../../mastodon/actions/accounts';
import { initMuteModal } from '../../../mastodon/actions/mutes';
import {
muteStatus,

+ 0
- 1
app/javascript/mastodon/features/account_timeline/containers/header_container.js View File

@ -7,7 +7,6 @@ import {
unfollowAccount,
blockAccount,
unblockAccount,
muteAccount,
unmuteAccount,
} from '../../../actions/accounts';
import { mentionCompose } from '../../../actions/compose';

+ 6
- 3
app/javascript/mastodon/features/ui/components/mute_modal.js View File

@ -19,7 +19,7 @@ const mapStateToProps = state => {
const mapDispatchToProps = dispatch => {
return {
onConfirm(account, notifications) {
dispatch(muteAccount(account.get('id'), notifications))
dispatch(muteAccount(account.get('id'), notifications));
},
onClose() {
@ -35,6 +35,7 @@ const mapDispatchToProps = dispatch => {
@connect(mapStateToProps, mapDispatchToProps)
@injectIntl
export default class MuteModal extends React.PureComponent {
static propTypes = {
isSubmitting: PropTypes.bool.isRequired,
account: PropTypes.object.isRequired,
@ -73,14 +74,15 @@ export default class MuteModal extends React.PureComponent {
<div className='modal-root__modal mute-modal'>
<div className='mute-modal__container'>
<p>
<FormattedMessage id='confirmations.mute.message'
<FormattedMessage
id='confirmations.mute.message'
defaultMessage='Are you sure you want to mute {name}?'
values={{ name: <strong>@{account.get('acct')}</strong> }}
/>
</p>
<p>
<FormattedMessage id='mute_modal.hide_notifications' defaultMessage='Hide notifications from this user?' />
<input type="checkbox"; checked={notifications} onChange={this.toggleNotifications} />
<input type='checkbox'; checked={notifications} onChange={this.toggleNotifications} />
</p>
</div>
@ -95,4 +97,5 @@ export default class MuteModal extends React.PureComponent {
</div>
);
}
}

+ 19
- 19
app/javascript/mastodon/reducers/mutes.js View File

@ -1,29 +1,29 @@
import Immutable from 'immutable';
import {
MUTES_INIT_MODAL,
MUTES_TOGGLE_HIDE_NOTIFICATIONS,
MUTES_INIT_MODAL,
MUTES_TOGGLE_HIDE_NOTIFICATIONS,
} from '../actions/mutes';
const initialState = Immutable.Map({
new: Immutable.Map({
isSubmitting: false,
account: null,
notifications: true,
}),
new: Immutable.Map({
isSubmitting: false,
account: null,
notifications: true,
}),
});
export default function mutes(state = initialState, action) {
switch (action.type) {
case MUTES_INIT_MODAL:
return state.withMutations((state) => {
state.setIn(['new', 'isSubmitting'], false);
state.setIn(['new', 'account'], action.account);
state.setIn(['new', 'notifications'], true);
});
case MUTES_TOGGLE_HIDE_NOTIFICATIONS:
return state.setIn(['new', 'notifications'], !state.getIn(['new', 'notifications']));
default:
return state;
}
switch (action.type) {
case MUTES_INIT_MODAL:
return state.withMutations((state) => {
state.setIn(['new', 'isSubmitting'], false);
state.setIn(['new', 'account'], action.account);
state.setIn(['new', 'notifications'], true);
});
case MUTES_TOGGLE_HIDE_NOTIFICATIONS:
return state.setIn(['new', 'notifications'], !state.getIn(['new', 'notifications']));
default:
return state;
}
}

Loading…
Cancel
Save