onEmbed: PropTypes.func,
onHeightChange: PropTypes.func,
me: PropTypes.string,
- boostModal: PropTypes.bool,
muted: PropTypes.bool,
hidden: PropTypes.bool,
onMoveUp: PropTypes.func,
'status',
'account',
'me',
- 'boostModal',
'muted',
'hidden',
]
unmuteAccount,
} from '../actions/accounts';
import { openModal } from '../actions/modal';
+import { unfollowModal } from '../initial_state';
const messages = defineMessages({
unfollowConfirm: { id: 'confirmations.unfollow.confirm', defaultMessage: 'Unfollow' },
const mapStateToProps = (state, props) => ({
account: getAccount(state, props.id),
me: state.getIn(['meta', 'me']),
- unfollowModal: state.getIn(['meta', 'unfollow_modal']),
});
return mapStateToProps;
onFollow (account) {
if (account.getIn(['relationship', 'following']) || account.getIn(['relationship', 'requested'])) {
- if (this.unfollowModal) {
+ if (unfollowModal) {
dispatch(openModal('CONFIRM', {
message: <FormattedMessage id='confirmations.unfollow.message' defaultMessage='Are you sure you want to unfollow {name}?' values={{ name: <strong>@{account.get('acct')}</strong> }} />,
confirm: intl.formatMessage(messages.unfollowConfirm),
import { initReport } from '../actions/reports';
import { openModal } from '../actions/modal';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
+import { boostModal, deleteModal } from '../initial_state';
const messages = defineMessages({
deleteConfirm: { id: 'confirmations.delete.confirm', defaultMessage: 'Delete' },
const mapStateToProps = (state, props) => ({
status: getStatus(state, props.id),
me: state.getIn(['meta', 'me']),
- boostModal: state.getIn(['meta', 'boost_modal']),
- deleteModal: state.getIn(['meta', 'delete_modal']),
});
return mapStateToProps;
if (status.get('reblogged')) {
dispatch(unreblog(status));
} else {
- if (e.shiftKey || !this.boostModal) {
+ if (e.shiftKey || !boostModal) {
this.onModalReblog(status);
} else {
dispatch(openModal('BOOST', { status, onReblog: this.onModalReblog }));
},
onDelete (status) {
- if (!this.deleteModal) {
+ if (!deleteModal) {
dispatch(deleteStatus(status.get('id')));
} else {
dispatch(openModal('CONFIRM', {
import { openModal } from '../../../actions/modal';
import { blockDomain, unblockDomain } from '../../../actions/domain_blocks';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
+import { unfollowModal } from '../../../initial_state';
const messages = defineMessages({
unfollowConfirm: { id: 'confirmations.unfollow.confirm', defaultMessage: 'Unfollow' },
const mapStateToProps = (state, { accountId }) => ({
account: getAccount(state, accountId),
me: state.getIn(['meta', 'me']),
- unfollowModal: state.getIn(['meta', 'unfollow_modal']),
});
return mapStateToProps;
onFollow (account) {
if (account.getIn(['relationship', 'following']) || account.getIn(['relationship', 'requested'])) {
- if (this.unfollowModal) {
+ if (unfollowModal) {
dispatch(openModal('CONFIRM', {
message: <FormattedMessage id='confirmations.unfollow.message' defaultMessage='Are you sure you want to unfollow {name}?' values={{ name: <strong>@{account.get('acct')}</strong> }} />,
confirm: intl.formatMessage(messages.unfollowConfirm),
import { defineMessages, injectIntl } from 'react-intl';
import ImmutablePureComponent from 'react-immutable-pure-component';
import { HotKeys } from 'react-hotkeys';
+import { boostModal, deleteModal } from '../../initial_state';
const messages = defineMessages({
deleteConfirm: { id: 'confirmations.delete.confirm', defaultMessage: 'Delete' },
ancestorsIds: state.getIn(['contexts', 'ancestors', props.params.statusId]),
descendantsIds: state.getIn(['contexts', 'descendants', props.params.statusId]),
me: state.getIn(['meta', 'me']),
- boostModal: state.getIn(['meta', 'boost_modal']),
- deleteModal: state.getIn(['meta', 'delete_modal']),
});
return mapStateToProps;
ancestorsIds: ImmutablePropTypes.list,
descendantsIds: ImmutablePropTypes.list,
me: PropTypes.string,
- boostModal: PropTypes.bool,
- deleteModal: PropTypes.bool,
intl: PropTypes.object.isRequired,
};
if (status.get('reblogged')) {
this.props.dispatch(unreblog(status));
} else {
- if (e.shiftKey || !this.props.boostModal) {
+ if (e.shiftKey || !boostModal) {
this.handleModalReblog(status);
} else {
this.props.dispatch(openModal('BOOST', { status, onReblog: this.handleModalReblog }));
handleDeleteClick = (status) => {
const { dispatch, intl } = this.props;
- if (!this.props.deleteModal) {
+ if (!deleteModal) {
dispatch(deleteStatus(status.get('id')));
} else {
dispatch(openModal('CONFIRM', {
export const reduceMotion = getMeta('reduce_motion');
export const autoPlayGif = getMeta('auto_play_gif');
+export const unfollowModal = getMeta('unfollow_modal');
+export const boostModal = getMeta('boost_modal');
+export const deleteModal = getMeta('delete_modal');
export default initialState;