{(status.get('poll') || status.get('media_attachments').size > 0) && (
diff --git a/app/javascript/flavours/glitch/features/compose/containers/compose_form_container.js b/app/javascript/flavours/glitch/features/compose/containers/compose_form_container.js
index 067621c84b..227e793869 100644
--- a/app/javascript/flavours/glitch/features/compose/containers/compose_form_container.js
+++ b/app/javascript/flavours/glitch/features/compose/containers/compose_form_container.js
@@ -82,8 +82,8 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
dispatch(changeCompose(text));
},
- onSubmit (router, overridePrivacy = null) {
- dispatch(submitCompose(router, overridePrivacy));
+ onSubmit (overridePrivacy = null) {
+ dispatch(submitCompose(overridePrivacy));
},
onClearSuggestions () {
@@ -110,14 +110,14 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
dispatch(insertEmojiCompose(position, data, needsSpace));
},
- onMediaDescriptionConfirm (routerHistory, mediaId, overridePrivacy = null) {
+ onMediaDescriptionConfirm (mediaId, overridePrivacy = null) {
dispatch(openModal({
modalType: 'CONFIRM',
modalProps: {
message: intl.formatMessage(messages.missingDescriptionMessage),
confirm: intl.formatMessage(messages.missingDescriptionConfirm),
onConfirm: () => {
- dispatch(submitCompose(routerHistory, overridePrivacy));
+ dispatch(submitCompose(overridePrivacy));
},
secondary: intl.formatMessage(messages.missingDescriptionEdit),
onSecondary: () => dispatch(openModal({
diff --git a/app/javascript/flavours/glitch/features/compose/index.jsx b/app/javascript/flavours/glitch/features/compose/index.jsx
index b59fafe048..f9a763ef8b 100644
--- a/app/javascript/flavours/glitch/features/compose/index.jsx
+++ b/app/javascript/flavours/glitch/features/compose/index.jsx
@@ -24,7 +24,6 @@ import { Icon } from 'flavours/glitch/components/icon';
import glitchedElephant1 from 'flavours/glitch/images/mbstobon-ui-0.png';
import glitchedElephant2 from 'flavours/glitch/images/mbstobon-ui-1.png';
import glitchedElephant3 from 'flavours/glitch/images/mbstobon-ui-2.png';
-import { logOut } from 'flavours/glitch/utils/log_out';
import elephantUIPlane from '../../../../images/elephant_ui_plane.svg';
import { changeComposing, mountCompose, unmountCompose } from '../../actions/compose';
@@ -45,8 +44,6 @@ const messages = defineMessages({
settings: { id: 'navigation_bar.app_settings', defaultMessage: 'App settings' },
logout: { id: 'navigation_bar.logout', defaultMessage: 'Logout' },
compose: { id: 'navigation_bar.compose', defaultMessage: 'Compose new post' },
- logoutMessage: { id: 'confirmations.logout.message', defaultMessage: 'Are you sure you want to log out?' },
- logoutConfirm: { id: 'confirmations.logout.confirm', defaultMessage: 'Log out' },
});
const mapStateToProps = (state, ownProps) => ({
@@ -88,20 +85,12 @@ class Compose extends PureComponent {
}
handleLogoutClick = e => {
- const { dispatch, intl } = this.props;
+ const { dispatch } = this.props;
e.preventDefault();
e.stopPropagation();
- dispatch(openModal({
- modalType: 'CONFIRM',
- modalProps: {
- message: intl.formatMessage(messages.logoutMessage),
- confirm: intl.formatMessage(messages.logoutConfirm),
- closeWhenConfirm: false,
- onConfirm: () => logOut(),
- },
- }));
+ dispatch(openModal({ modalType: 'CONFIRM_LOG_OUT' }));
return false;
};
diff --git a/app/javascript/flavours/glitch/features/direct_timeline/components/conversation.jsx b/app/javascript/flavours/glitch/features/direct_timeline/components/conversation.jsx
index 7071c8719d..50b2a9d5ab 100644
--- a/app/javascript/flavours/glitch/features/direct_timeline/components/conversation.jsx
+++ b/app/javascript/flavours/glitch/features/direct_timeline/components/conversation.jsx
@@ -18,7 +18,7 @@ import ReplyIcon from '@/material-icons/400-24px/reply.svg?react';
import { replyCompose } from 'flavours/glitch/actions/compose';
import { markConversationRead, deleteConversation } from 'flavours/glitch/actions/conversations';
import { openModal } from 'flavours/glitch/actions/modal';
-import { muteStatus, unmuteStatus, revealStatus, hideStatus } from 'flavours/glitch/actions/statuses';
+import { muteStatus, unmuteStatus, toggleStatusSpoilers } from 'flavours/glitch/actions/statuses';
import AttachmentList from 'flavours/glitch/components/attachment_list';
import AvatarComposite from 'flavours/glitch/components/avatar_composite';
import { IconButton } from 'flavours/glitch/components/icon_button';
@@ -37,8 +37,6 @@ const messages = defineMessages({
delete: { id: 'conversation.delete', defaultMessage: 'Delete conversation' },
muteConversation: { id: 'status.mute_conversation', defaultMessage: 'Mute conversation' },
unmuteConversation: { id: 'status.unmute_conversation', defaultMessage: 'Unmute conversation' },
- replyConfirm: { id: 'confirmations.reply.confirm', defaultMessage: 'Reply' },
- replyMessage: { id: 'confirmations.reply.message', defaultMessage: 'Replying now will overwrite the message you are currently composing. Are you sure you want to proceed?' },
});
const getAccounts = createSelector(
@@ -121,19 +119,12 @@ export const Conversation = ({ conversation, scrollKey, onMoveUp, onMoveDown })
let state = getState();
if (state.getIn(['compose', 'text']).trim().length !== 0) {
- dispatch(openModal({
- modalType: 'CONFIRM',
- modalProps: {
- message: intl.formatMessage(messages.replyMessage),
- confirm: intl.formatMessage(messages.replyConfirm),
- onConfirm: () => dispatch(replyCompose(lastStatus, history)),
- },
- }));
+ dispatch(openModal({ modalType: 'CONFIRM_REPLY', modalProps: { status: lastStatus } }));
} else {
- dispatch(replyCompose(lastStatus, history));
+ dispatch(replyCompose(lastStatus));
}
});
- }, [dispatch, lastStatus, history, intl]);
+ }, [dispatch, lastStatus]);
const handleDelete = useCallback(() => {
dispatch(deleteConversation(id));
@@ -156,11 +147,7 @@ export const Conversation = ({ conversation, scrollKey, onMoveUp, onMoveDown })
}, [dispatch, lastStatus]);
const handleShowMore = useCallback(() => {
- if (lastStatus.get('hidden')) {
- dispatch(revealStatus(lastStatus.get('id')));
- } else {
- dispatch(hideStatus(lastStatus.get('id')));
- }
+ dispatch(toggleStatusSpoilers(lastStatus.get('id')));
if (lastStatus.get('spoiler_text')) {
setExpanded(!expanded);
diff --git a/app/javascript/flavours/glitch/features/directory/components/account_card.tsx b/app/javascript/flavours/glitch/features/directory/components/account_card.tsx
index 907dbba9fd..8afb9f59d5 100644
--- a/app/javascript/flavours/glitch/features/directory/components/account_card.tsx
+++ b/app/javascript/flavours/glitch/features/directory/components/account_card.tsx
@@ -7,7 +7,6 @@ import classNames from 'classnames';
import {
followAccount,
- unfollowAccount,
unblockAccount,
unmuteAccount,
} from 'flavours/glitch/actions/accounts';
@@ -29,20 +28,12 @@ const messages = defineMessages({
id: 'account.cancel_follow_request',
defaultMessage: 'Withdraw follow request',
},
- cancelFollowRequestConfirm: {
- id: 'confirmations.cancel_follow_request.confirm',
- defaultMessage: 'Withdraw request',
- },
requested: {
id: 'account.requested',
defaultMessage: 'Awaiting approval. Click to cancel follow request',
},
unblock: { id: 'account.unblock_short', defaultMessage: 'Unblock' },
unmute: { id: 'account.unmute_short', defaultMessage: 'Unmute' },
- unfollowConfirm: {
- id: 'confirmations.unfollow.confirm',
- defaultMessage: 'Unfollow',
- },
edit_profile: { id: 'account.edit_profile', defaultMessage: 'Edit profile' },
});
@@ -89,48 +80,17 @@ export const AccountCard: React.FC<{ accountId: string }> = ({ accountId }) => {
const handleFollow = useCallback(() => {
if (!account) return;
- if (account.getIn(['relationship', 'following'])) {
+ if (
+ account.getIn(['relationship', 'following']) ||
+ account.getIn(['relationship', 'requested'])
+ ) {
dispatch(
- openModal({
- modalType: 'CONFIRM',
- modalProps: {
- message: (
-
@{account.get('acct')} }}
- />
- ),
- confirm: intl.formatMessage(messages.unfollowConfirm),
- onConfirm: () => {
- dispatch(unfollowAccount(account.get('id')));
- },
- },
- }),
- );
- } else if (account.getIn(['relationship', 'requested'])) {
- dispatch(
- openModal({
- modalType: 'CONFIRM',
- modalProps: {
- message: (
- @{account.get('acct')} }}
- />
- ),
- confirm: intl.formatMessage(messages.cancelFollowRequestConfirm),
- onConfirm: () => {
- dispatch(unfollowAccount(account.get('id')));
- },
- },
- }),
+ openModal({ modalType: 'CONFIRM_UNFOLLOW', modalProps: { account } }),
);
} else {
dispatch(followAccount(account.get('id')));
}
- }, [account, dispatch, intl]);
+ }, [account, dispatch]);
const handleBlock = useCallback(() => {
if (account?.relationship?.blocking) {
diff --git a/app/javascript/flavours/glitch/features/domain_blocks/index.jsx b/app/javascript/flavours/glitch/features/domain_blocks/index.jsx
index 964eada9c1..67ee801cbf 100644
--- a/app/javascript/flavours/glitch/features/domain_blocks/index.jsx
+++ b/app/javascript/flavours/glitch/features/domain_blocks/index.jsx
@@ -11,16 +11,15 @@ import { connect } from 'react-redux';
import { debounce } from 'lodash';
import BlockIcon from '@/material-icons/400-24px/block-fill.svg?react';
+import { Domain } from 'flavours/glitch/components/domain';
import { fetchDomainBlocks, expandDomainBlocks } from '../../actions/domain_blocks';
import { LoadingIndicator } from '../../components/loading_indicator';
import ScrollableList from '../../components/scrollable_list';
-import DomainContainer from '../../containers/domain_container';
import Column from '../ui/components/column';
const messages = defineMessages({
heading: { id: 'column.domain_blocks', defaultMessage: 'Blocked domains' },
- unblockDomain: { id: 'account.unblock_domain', defaultMessage: 'Unblock domain {domain}' },
});
const mapStateToProps = state => ({
@@ -70,7 +69,7 @@ class Blocks extends ImmutablePureComponent {
bindToDocument={!multiColumn}
>
{domains.map(domain =>
- ,
+ ,
)}
diff --git a/app/javascript/flavours/glitch/features/list_timeline/index.jsx b/app/javascript/flavours/glitch/features/list_timeline/index.jsx
index 08ce97f1ba..122e43669d 100644
--- a/app/javascript/flavours/glitch/features/list_timeline/index.jsx
+++ b/app/javascript/flavours/glitch/features/list_timeline/index.jsx
@@ -15,7 +15,7 @@ import DeleteIcon from '@/material-icons/400-24px/delete.svg?react';
import EditIcon from '@/material-icons/400-24px/edit.svg?react';
import ListAltIcon from '@/material-icons/400-24px/list_alt.svg?react';
import { addColumn, removeColumn, moveColumn } from 'flavours/glitch/actions/columns';
-import { fetchList, deleteList, updateList } from 'flavours/glitch/actions/lists';
+import { fetchList, updateList } from 'flavours/glitch/actions/lists';
import { openModal } from 'flavours/glitch/actions/modal';
import { connectListStream } from 'flavours/glitch/actions/streaming';
import { expandListTimeline } from 'flavours/glitch/actions/timelines';
@@ -29,8 +29,6 @@ import StatusListContainer from 'flavours/glitch/features/ui/containers/status_l
import { WithRouterPropTypes } from 'flavours/glitch/utils/react_router';
const messages = defineMessages({
- deleteMessage: { id: 'confirmations.delete_list.message', defaultMessage: 'Are you sure you want to permanently delete this list?' },
- deleteConfirm: { id: 'confirmations.delete_list.confirm', defaultMessage: 'Delete' },
followed: { id: 'lists.replies_policy.followed', defaultMessage: 'Any followed user' },
none: { id: 'lists.replies_policy.none', defaultMessage: 'No one' },
list: { id: 'lists.replies_policy.list', defaultMessage: 'Members of the list' },
@@ -125,25 +123,10 @@ class ListTimeline extends PureComponent {
};
handleDeleteClick = () => {
- const { dispatch, columnId, intl } = this.props;
+ const { dispatch, columnId } = this.props;
const { id } = this.props.params;
- dispatch(openModal({
- modalType: 'CONFIRM',
- modalProps: {
- message: intl.formatMessage(messages.deleteMessage),
- confirm: intl.formatMessage(messages.deleteConfirm),
- onConfirm: () => {
- dispatch(deleteList(id));
-
- if (columnId) {
- dispatch(removeColumn(columnId));
- } else {
- this.props.history.push('/lists');
- }
- },
- },
- }));
+ dispatch(openModal({ modalType: 'CONFIRM_DELETE_LIST', modalProps: { listId: id, columnId } }));
};
handleRepliesPolicyChange = ({ target }) => {
diff --git a/app/javascript/flavours/glitch/features/notifications/components/checkbox_with_label.jsx b/app/javascript/flavours/glitch/features/notifications/components/checkbox_with_label.jsx
deleted file mode 100644
index 5a7bb2307b..0000000000
--- a/app/javascript/flavours/glitch/features/notifications/components/checkbox_with_label.jsx
+++ /dev/null
@@ -1,31 +0,0 @@
-import PropTypes from 'prop-types';
-import { useCallback } from 'react';
-
-import Toggle from 'react-toggle';
-
-export const CheckboxWithLabel = ({ checked, disabled, children, onChange }) => {
- const handleChange = useCallback(({ target }) => {
- onChange(target.checked);
- }, [onChange]);
-
- return (
-
- );
-};
-
-CheckboxWithLabel.propTypes = {
- checked: PropTypes.bool,
- disabled: PropTypes.bool,
- children: PropTypes.children,
- onChange: PropTypes.func,
-};
diff --git a/app/javascript/flavours/glitch/features/notifications/components/checkbox_with_label.tsx b/app/javascript/flavours/glitch/features/notifications/components/checkbox_with_label.tsx
new file mode 100644
index 0000000000..9922bc6c7c
--- /dev/null
+++ b/app/javascript/flavours/glitch/features/notifications/components/checkbox_with_label.tsx
@@ -0,0 +1,40 @@
+import type { PropsWithChildren } from 'react';
+import { useCallback } from 'react';
+
+import Toggle from 'react-toggle';
+
+interface Props {
+ checked: boolean;
+ disabled?: boolean;
+ onChange: (checked: boolean) => void;
+}
+
+export const CheckboxWithLabel: React.FC> = ({
+ checked,
+ disabled,
+ children,
+ onChange,
+}) => {
+ const handleChange = useCallback(
+ ({ target }: React.ChangeEvent) => {
+ onChange(target.checked);
+ },
+ [onChange],
+ );
+
+ return (
+
+ );
+};
diff --git a/app/javascript/flavours/glitch/features/notifications/components/column_settings.jsx b/app/javascript/flavours/glitch/features/notifications/components/column_settings.jsx
index 0d77b3d581..bf31ce5ae5 100644
--- a/app/javascript/flavours/glitch/features/notifications/components/column_settings.jsx
+++ b/app/javascript/flavours/glitch/features/notifications/components/column_settings.jsx
@@ -8,10 +8,10 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
import { identityContextPropShape, withIdentity } from 'flavours/glitch/identity_context';
import { PERMISSION_MANAGE_USERS, PERMISSION_MANAGE_REPORTS } from 'flavours/glitch/permissions';
-import { CheckboxWithLabel } from './checkbox_with_label';
import ClearColumnButton from './clear_column_button';
import GrantPermissionButton from './grant_permission_button';
import PillBarButton from './pill_bar_button';
+import { PolicyControls } from './policy_controls';
import SettingToggle from './setting_toggle';
class ColumnSettings extends PureComponent {
@@ -25,34 +25,17 @@ class ColumnSettings extends PureComponent {
alertsEnabled: PropTypes.bool,
browserSupport: PropTypes.bool,
browserPermission: PropTypes.string,
- notificationPolicy: PropTypes.object.isRequired,
- onChangePolicy: PropTypes.func.isRequired,
};
onPushChange = (path, checked) => {
this.props.onChange(['push', ...path], checked);
};
- handleFilterNotFollowing = checked => {
- this.props.onChangePolicy('filter_not_following', checked);
- };
-
- handleFilterNotFollowers = checked => {
- this.props.onChangePolicy('filter_not_followers', checked);
- };
-
- handleFilterNewAccounts = checked => {
- this.props.onChangePolicy('filter_new_accounts', checked);
- };
-
- handleFilterPrivateMentions = checked => {
- this.props.onChangePolicy('filter_private_mentions', checked);
- };
-
render () {
- const { settings, pushSettings, onChange, onClear, alertsEnabled, browserSupport, browserPermission, onRequestNotificationPermission, notificationPolicy } = this.props;
+ const { settings, pushSettings, onChange, onClear, alertsEnabled, browserSupport, browserPermission, onRequestNotificationPermission } = this.props;
const unreadMarkersShowStr = ;
+ const groupingShowStr = ;
const filterBarShowStr = ;
const filterAdvancedStr = ;
const alertStr = ;
@@ -80,31 +63,7 @@ class ColumnSettings extends PureComponent {
)}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -115,6 +74,16 @@ class ColumnSettings extends PureComponent {