Satisfy eslint.
This commit is contained in:
parent
62fde4c01c
commit
9cdcd429d9
4 changed files with 26 additions and 27 deletions
|
@ -39,10 +39,7 @@ import {
|
||||||
unreblog,
|
unreblog,
|
||||||
unfavourite,
|
unfavourite,
|
||||||
} from '../../../mastodon/actions/interactions';
|
} from '../../../mastodon/actions/interactions';
|
||||||
import {
|
import { blockAccount } from '../../../mastodon/actions/accounts';
|
||||||
blockAccount,
|
|
||||||
muteAccount,
|
|
||||||
} from '../../../mastodon/actions/accounts';
|
|
||||||
import { initMuteModal } from '../../../mastodon/actions/mutes';
|
import { initMuteModal } from '../../../mastodon/actions/mutes';
|
||||||
import {
|
import {
|
||||||
muteStatus,
|
muteStatus,
|
||||||
|
|
|
@ -7,7 +7,6 @@ import {
|
||||||
unfollowAccount,
|
unfollowAccount,
|
||||||
blockAccount,
|
blockAccount,
|
||||||
unblockAccount,
|
unblockAccount,
|
||||||
muteAccount,
|
|
||||||
unmuteAccount,
|
unmuteAccount,
|
||||||
} from '../../../actions/accounts';
|
} from '../../../actions/accounts';
|
||||||
import { mentionCompose } from '../../../actions/compose';
|
import { mentionCompose } from '../../../actions/compose';
|
||||||
|
|
|
@ -19,7 +19,7 @@ const mapStateToProps = state => {
|
||||||
const mapDispatchToProps = dispatch => {
|
const mapDispatchToProps = dispatch => {
|
||||||
return {
|
return {
|
||||||
onConfirm(account, notifications) {
|
onConfirm(account, notifications) {
|
||||||
dispatch(muteAccount(account.get('id'), notifications))
|
dispatch(muteAccount(account.get('id'), notifications));
|
||||||
},
|
},
|
||||||
|
|
||||||
onClose() {
|
onClose() {
|
||||||
|
@ -35,6 +35,7 @@ const mapDispatchToProps = dispatch => {
|
||||||
@connect(mapStateToProps, mapDispatchToProps)
|
@connect(mapStateToProps, mapDispatchToProps)
|
||||||
@injectIntl
|
@injectIntl
|
||||||
export default class MuteModal extends React.PureComponent {
|
export default class MuteModal extends React.PureComponent {
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
isSubmitting: PropTypes.bool.isRequired,
|
isSubmitting: PropTypes.bool.isRequired,
|
||||||
account: PropTypes.object.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='modal-root__modal mute-modal'>
|
||||||
<div className='mute-modal__container'>
|
<div className='mute-modal__container'>
|
||||||
<p>
|
<p>
|
||||||
<FormattedMessage id='confirmations.mute.message'
|
<FormattedMessage
|
||||||
|
id='confirmations.mute.message'
|
||||||
defaultMessage='Are you sure you want to mute {name}?'
|
defaultMessage='Are you sure you want to mute {name}?'
|
||||||
values={{ name: <strong>@{account.get('acct')}</strong> }}
|
values={{ name: <strong>@{account.get('acct')}</strong> }}
|
||||||
/>
|
/>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<FormattedMessage id='mute_modal.hide_notifications' defaultMessage='Hide notifications from this user?' />
|
<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>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -95,4 +97,5 @@ export default class MuteModal extends React.PureComponent {
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,29 +1,29 @@
|
||||||
import Immutable from 'immutable';
|
import Immutable from 'immutable';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
MUTES_INIT_MODAL,
|
MUTES_INIT_MODAL,
|
||||||
MUTES_TOGGLE_HIDE_NOTIFICATIONS,
|
MUTES_TOGGLE_HIDE_NOTIFICATIONS,
|
||||||
} from '../actions/mutes';
|
} from '../actions/mutes';
|
||||||
|
|
||||||
const initialState = Immutable.Map({
|
const initialState = Immutable.Map({
|
||||||
new: Immutable.Map({
|
new: Immutable.Map({
|
||||||
isSubmitting: false,
|
isSubmitting: false,
|
||||||
account: null,
|
account: null,
|
||||||
notifications: true,
|
notifications: true,
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default function mutes(state = initialState, action) {
|
export default function mutes(state = initialState, action) {
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
case MUTES_INIT_MODAL:
|
case MUTES_INIT_MODAL:
|
||||||
return state.withMutations((state) => {
|
return state.withMutations((state) => {
|
||||||
state.setIn(['new', 'isSubmitting'], false);
|
state.setIn(['new', 'isSubmitting'], false);
|
||||||
state.setIn(['new', 'account'], action.account);
|
state.setIn(['new', 'account'], action.account);
|
||||||
state.setIn(['new', 'notifications'], true);
|
state.setIn(['new', 'notifications'], true);
|
||||||
});
|
});
|
||||||
case MUTES_TOGGLE_HIDE_NOTIFICATIONS:
|
case MUTES_TOGGLE_HIDE_NOTIFICATIONS:
|
||||||
return state.setIn(['new', 'notifications'], !state.getIn(['new', 'notifications']));
|
return state.setIn(['new', 'notifications'], !state.getIn(['new', 'notifications']));
|
||||||
default:
|
default:
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue