= ({ accountId }) => {
@@ -66,19 +64,9 @@ export const AccountMenu: FC<{ accountId: string }> = ({ accountId }) => {
return [];
}
- if (isRedesignEnabled()) {
- return redesignMenuItems({
- account,
- signedIn: !isMe && signedIn,
- permissions,
- intl,
- relationship,
- dispatch,
- });
- }
- return currentMenuItems({
+ return redesignMenuItems({
account,
- signedIn,
+ signedIn: !isMe && signedIn,
permissions,
intl,
relationship,
@@ -181,270 +169,6 @@ const messages = defineMessages({
},
});
-function currentMenuItems({
- account,
- signedIn,
- permissions,
- intl,
- relationship,
- dispatch,
-}: MenuItemsParams): MenuItem[] {
- const items: MenuItem[] = [];
- const isRemote = account.acct !== account.username;
-
- if (signedIn && !account.suspended) {
- items.push(
- {
- text: intl.formatMessage(messages.mention, {
- name: account.username,
- }),
- action: () => {
- dispatch(mentionCompose(account));
- },
- },
- {
- text: intl.formatMessage(messages.direct, {
- name: account.username,
- }),
- action: () => {
- dispatch(directCompose(account));
- },
- },
- null,
- );
- }
-
- if (isRemote) {
- items.push({
- text: intl.formatMessage(messages.openOriginalPage),
- href: account.url,
- });
-
- if (signedIn) {
- items.push(null);
- }
- }
-
- if (!signedIn) {
- return items;
- }
-
- if (relationship?.following) {
- // Timeline options
- if (!relationship.muting) {
- if (relationship.showing_reblogs) {
- items.push({
- text: intl.formatMessage(messages.hideReblogs, {
- name: account.username,
- }),
- action: () => {
- dispatch(followAccount(account.id, { reblogs: false }));
- },
- });
- } else {
- items.push({
- text: intl.formatMessage(messages.showReblogs, {
- name: account.username,
- }),
- action: () => {
- dispatch(followAccount(account.id, { reblogs: true }));
- },
- });
- }
-
- items.push(
- {
- text: intl.formatMessage(messages.languages),
- action: () => {
- dispatch(
- openModal({
- modalType: 'SUBSCRIBED_LANGUAGES',
- modalProps: {
- accountId: account.id,
- },
- }),
- );
- },
- },
- null,
- );
- }
-
- items.push(
- {
- text: intl.formatMessage(
- relationship.endorsed ? messages.unendorse : messages.endorse,
- ),
- action: () => {
- if (relationship.endorsed) {
- dispatch(unpinAccount(account.id));
- } else {
- dispatch(pinAccount(account.id));
- }
- },
- },
- {
- text: intl.formatMessage(messages.add_or_remove_from_list),
- action: () => {
- dispatch(
- openModal({
- modalType: 'LIST_ADDER',
- modalProps: {
- accountId: account.id,
- },
- }),
- );
- },
- },
- null,
- );
- }
-
- if (relationship?.followed_by) {
- const handleRemoveFromFollowers = () => {
- dispatch(
- openModal({
- modalType: 'CONFIRM',
- modalProps: {
- title: intl.formatMessage(messages.confirmRemoveFromFollowersTitle),
- message: intl.formatMessage(
- messages.confirmRemoveFromFollowersMessage,
- { name: {account.acct} },
- ),
- confirm: intl.formatMessage(
- messages.confirmRemoveFromFollowersButton,
- ),
- onConfirm: () => {
- void dispatch(
- removeAccountFromFollowers({ accountId: account.id }),
- );
- },
- },
- }),
- );
- };
-
- items.push({
- text: intl.formatMessage(messages.removeFromFollowers, {
- name: account.username,
- }),
- action: handleRemoveFromFollowers,
- dangerous: true,
- });
- }
-
- if (relationship?.muting) {
- items.push({
- text: intl.formatMessage(messages.unmute, {
- name: account.username,
- }),
- action: () => {
- dispatch(unmuteAccount(account.id));
- },
- });
- } else {
- items.push({
- text: intl.formatMessage(messages.mute, {
- name: account.username,
- }),
- action: () => {
- dispatch(initMuteModal(account));
- },
- dangerous: true,
- });
- }
-
- if (relationship?.blocking) {
- items.push({
- text: intl.formatMessage(messages.unblock, {
- name: account.username,
- }),
- action: () => {
- dispatch(unblockAccount(account.id));
- },
- });
- } else {
- items.push({
- text: intl.formatMessage(messages.block, {
- name: account.username,
- }),
- action: () => {
- dispatch(blockAccount(account.id));
- },
- dangerous: true,
- });
- }
-
- if (!account.suspended) {
- items.push({
- text: intl.formatMessage(messages.report, {
- name: account.username,
- }),
- action: () => {
- dispatch(initReport(account));
- },
- dangerous: true,
- });
- }
-
- const remoteDomain = isRemote ? account.acct.split('@')[1] : null;
- if (remoteDomain) {
- items.push(null);
-
- if (relationship?.domain_blocking) {
- items.push({
- text: intl.formatMessage(messages.unblockDomain, {
- domain: remoteDomain,
- }),
- action: () => {
- dispatch(unblockDomain(remoteDomain));
- },
- });
- } else {
- items.push({
- text: intl.formatMessage(messages.blockDomain, {
- domain: remoteDomain,
- }),
- action: () => {
- dispatch(initDomainBlockModal(account));
- },
- dangerous: true,
- });
- }
- }
-
- if (
- (permissions & PERMISSION_MANAGE_USERS) === PERMISSION_MANAGE_USERS ||
- (isRemote &&
- (permissions & PERMISSION_MANAGE_FEDERATION) ===
- PERMISSION_MANAGE_FEDERATION)
- ) {
- items.push(null);
- if ((permissions & PERMISSION_MANAGE_USERS) === PERMISSION_MANAGE_USERS) {
- items.push({
- text: intl.formatMessage(messages.admin_account, {
- name: account.username,
- }),
- href: `/admin/accounts/${account.id}`,
- });
- }
- if (
- isRemote &&
- (permissions & PERMISSION_MANAGE_FEDERATION) ===
- PERMISSION_MANAGE_FEDERATION
- ) {
- items.push({
- text: intl.formatMessage(messages.admin_domain, {
- domain: remoteDomain,
- }),
- href: `/admin/instances/${remoteDomain}`,
- });
- }
- }
-
- return items;
-}
-
const redesignMessages = defineMessages({
share: { id: 'account.menu.share', defaultMessage: 'Share…' },
copy: { id: 'account.menu.copy', defaultMessage: 'Copy link' },
diff --git a/app/javascript/flavours/glitch/features/account_timeline/components/number_fields.tsx b/app/javascript/flavours/glitch/features/account_timeline/components/number_fields.tsx
index b90d14afca..a8de28f1ce 100644
--- a/app/javascript/flavours/glitch/features/account_timeline/components/number_fields.tsx
+++ b/app/javascript/flavours/glitch/features/account_timeline/components/number_fields.tsx
@@ -3,13 +3,6 @@ import type { FC } from 'react';
import { FormattedMessage, useIntl } from 'react-intl';
-import { NavLink } from 'react-router-dom';
-
-import {
- FollowersCounter,
- FollowingCounter,
- StatusesCounter,
-} from '@/flavours/glitch/components/counters';
import { FormattedDateWrapper } from '@/flavours/glitch/components/formatted_date';
import {
NumberFields,
@@ -18,54 +11,9 @@ import {
import { ShortNumber } from '@/flavours/glitch/components/short_number';
import { useAccount } from '@/flavours/glitch/hooks/useAccount';
-import { isRedesignEnabled } from '../common';
-
-const LegacyNumberFields: FC<{ accountId: string }> = ({ accountId }) => {
- const intl = useIntl();
- const account = useAccount(accountId);
-
- if (!account) {
- return null;
- }
-
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
-};
-
-const RedesignNumberFields: FC<{ accountId: string }> = ({ accountId }) => {
+export const AccountNumberFields: FC<{ accountId: string }> = ({
+ accountId,
+}) => {
const intl = useIntl();
const account = useAccount(accountId);
const createdThisYear = useMemo(
@@ -125,7 +73,3 @@ const RedesignNumberFields: FC<{ accountId: string }> = ({ accountId }) => {
);
};
-
-export const AccountNumberFields = isRedesignEnabled()
- ? RedesignNumberFields
- : LegacyNumberFields;
diff --git a/app/javascript/flavours/glitch/features/account_timeline/components/tabs.tsx b/app/javascript/flavours/glitch/features/account_timeline/components/tabs.tsx
index 9181961020..e03cd1161d 100644
--- a/app/javascript/flavours/glitch/features/account_timeline/components/tabs.tsx
+++ b/app/javascript/flavours/glitch/features/account_timeline/components/tabs.tsx
@@ -8,40 +8,13 @@ import { NavLink } from 'react-router-dom';
import { useAccount } from '@/flavours/glitch/hooks/useAccount';
import { useAccountId } from '@/flavours/glitch/hooks/useAccountId';
-import { isRedesignEnabled } from '../common';
-
import classes from './redesign.module.scss';
-export const AccountTabs: FC<{ acct: string }> = ({ acct }) => {
- if (isRedesignEnabled()) {
- return ;
- }
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
-};
-
const isActive: Required['isActive'] = (match, location) =>
match?.url === location.pathname ||
(!!match?.url && location.pathname.startsWith(`${match.url}/tagged/`));
-const RedesignTabs: FC = () => {
+export const AccountTabs: FC = () => {
const accountId = useAccountId();
const account = useAccount(accountId);
diff --git a/app/javascript/flavours/glitch/features/account_timeline/v2/filters.tsx b/app/javascript/flavours/glitch/features/account_timeline/v2/filters.tsx
index 375c91eb5c..0982c6598f 100644
--- a/app/javascript/flavours/glitch/features/account_timeline/v2/filters.tsx
+++ b/app/javascript/flavours/glitch/features/account_timeline/v2/filters.tsx
@@ -23,7 +23,7 @@ export const AccountFilters: FC = () => {
}
return (
<>
-
+
diff --git a/app/javascript/flavours/glitch/features/account_timeline/v2/pinned_statuses.tsx b/app/javascript/flavours/glitch/features/account_timeline/v2/pinned_statuses.tsx
index c3cfa3c018..05505417fb 100644
--- a/app/javascript/flavours/glitch/features/account_timeline/v2/pinned_statuses.tsx
+++ b/app/javascript/flavours/glitch/features/account_timeline/v2/pinned_statuses.tsx
@@ -18,7 +18,6 @@ import { selectTimelineByKey } from '@/flavours/glitch/selectors/timelines';
import { useAppDispatch, useAppSelector } from '@/flavours/glitch/store';
import IconPinned from '@/images/icons/icon_pinned.svg?react';
-import { isRedesignEnabled } from '../common';
import { PinnedBadge } from '../components/badges';
import { useAccountContext } from './context';
@@ -88,10 +87,6 @@ export const renderPinnedStatusHeader: StatusHeaderRenderFn = ({
export const PinnedShowAllButton: FC = () => {
const { onShowAllPinned } = useAccountContext();
- if (!isRedesignEnabled()) {
- return null;
- }
-
return (
,
-
- )
- } else {
- // If profile editing is not enabled, redirect to the home timeline as the current editing pages are outside React Router.
- profileRedesignRoutes.push(
- ,
- ,
- );
- }
-
return (
@@ -250,7 +235,8 @@ class SwitchingColumnsArea extends PureComponent {
- {...profileRedesignRoutes}
+
+
diff --git a/app/javascript/flavours/glitch/features/ui/util/async-components.js b/app/javascript/flavours/glitch/features/ui/util/async-components.js
index ad386a8da7..7f8c3222d8 100644
--- a/app/javascript/flavours/glitch/features/ui/util/async-components.js
+++ b/app/javascript/flavours/glitch/features/ui/util/async-components.js
@@ -1,5 +1,3 @@
-import { isServerFeatureEnabled } from '@/flavours/glitch/utils/environment';
-
export function EmojiPicker () {
return import('../../emoji/emoji_picker');
}
@@ -79,10 +77,7 @@ export function PinnedStatuses () {
}
export function AccountTimeline () {
- if (isServerFeatureEnabled('profile_redesign')) {
- return import('../../account_timeline/v2');
- }
- return import('../../account_timeline');
+ return import('../../account_timeline/v2');
}
export function AccountGallery () {
diff --git a/app/javascript/flavours/glitch/utils/environment.ts b/app/javascript/flavours/glitch/utils/environment.ts
index 5f736fa80c..ded0fe05bb 100644
--- a/app/javascript/flavours/glitch/utils/environment.ts
+++ b/app/javascript/flavours/glitch/utils/environment.ts
@@ -12,7 +12,7 @@ export function isProduction() {
else return import.meta.env.PROD;
}
-export type ServerFeatures = 'fasp' | 'collections' | 'profile_redesign';
+export type ServerFeatures = 'fasp' | 'collections';
export function isServerFeatureEnabled(feature: ServerFeatures) {
return initialState?.features.includes(feature) ?? false;