Move profile follow button back into page body

This commit is contained in:
diondiondion
2026-09-11 14:21:35 +02:00
parent 3f58d94905
commit ed0fa65e75
2 changed files with 3 additions and 50 deletions

View File

@@ -8,7 +8,6 @@ import { useAccount } from '@/mastodon/hooks/useAccount';
import { useFollowReference } from '@/mastodon/hooks/useFollowReference';
import { getAccountHidden } from '@/mastodon/selectors/accounts';
import { useAppDispatch, useAppSelector } from '@/mastodon/store';
import { isRedesignEnabled } from '@/mastodon/utils/environment';
import NotificationsIcon from '@/material-icons/400-24px/notifications.svg?react';
import NotificationsActiveIcon from '@/material-icons/400-24px/notifications_active-fill.svg?react';
import ShareIcon from '@/material-icons/400-24px/share.svg?react';
@@ -95,10 +94,11 @@ const AccountButtonsOther: FC<
return (
<>
{!isMovedAndUnfollowedAccount && !isRedesignEnabled() && (
{!isMovedAndUnfollowedAccount && (
<FollowButton
accountId={accountId}
className={classes.followButton}
withUnmute={false}
labelLength='long'
reference={reference}
/>

View File

@@ -15,12 +15,8 @@ import {
import { AccountHeader } from '@/mastodon/components/account_header';
import { Column } from '@/mastodon/components/column';
import { ColumnBackButton } from '@/mastodon/components/column/back_button';
import {
ColumnHeader,
ColumnHeaderButton,
} from '@/mastodon/components/column_header';
import { ColumnHeader } from '@/mastodon/components/column_header';
import { DisplayNameSimple } from '@/mastodon/components/display_name/simple';
import { useFollowButton } from '@/mastodon/components/follow_button';
import { LimitedAccountHint } from '@/mastodon/components/limited_account_hint';
import { LoadingIndicator } from '@/mastodon/components/loading_indicator';
import { RemoteHint } from '@/mastodon/components/remote_hint';
@@ -32,7 +28,6 @@ import {
useCurrentAccountId,
} from '@/mastodon/hooks/useAccountId';
import { useAccountVisibility } from '@/mastodon/hooks/useAccountVisibility';
import { useFollowReference } from '@/mastodon/hooks/useFollowReference';
import type { Account } from '@/mastodon/models/account';
import { selectTimelineByKey } from '@/mastodon/selectors/timelines';
import { useAppDispatch, useAppSelector } from '@/mastodon/store';
@@ -128,7 +123,6 @@ const InnerTimeline: FC<{ account: Account; multiColumn: boolean }> = ({
<ColumnHeader
withBackButton
title={<DisplayNameSimple account={account} />}
extraButtons={<ColumnHeaderFollowButton accountId={accountId} />}
/>
) : (
<ColumnBackButton />
@@ -157,47 +151,6 @@ const InnerTimeline: FC<{ account: Account; multiColumn: boolean }> = ({
);
};
const ColumnHeaderFollowButton: FC<{ accountId: string }> = ({ accountId }) => {
const reference = useFollowReference('profile');
const { onClick, link, label, icon, disabled, secondary, hidden } =
useFollowButton({
accountId,
withUnmute: false,
labelLength: 'long',
reference,
});
if (hidden) {
return null;
}
if (link) {
return (
<ColumnHeaderButton
showTextOnDesktop
as='link'
variant='solid'
to={link}
icon={icon}
>
{label}
</ColumnHeaderButton>
);
}
return (
<ColumnHeaderButton
showTextOnDesktop
onClick={onClick}
disabled={disabled}
variant={secondary ? 'tonal' : 'solid'}
icon={icon}
>
{label}
</ColumnHeaderButton>
);
};
const Prepend: FC<{
accountId: string;
forceEmpty: boolean;