diff --git a/app/javascript/mastodon/features/account_timeline/index.tsx b/app/javascript/mastodon/features/account_timeline/index.tsx index dfd2095ea25..264a3521910 100644 --- a/app/javascript/mastodon/features/account_timeline/index.tsx +++ b/app/javascript/mastodon/features/account_timeline/index.tsx @@ -15,8 +15,12 @@ import { import { AccountHeader } from '@/mastodon/components/account_header'; import { Column } from '@/mastodon/components/column'; import { ColumnBackButton } from '@/mastodon/components/column/back_button'; -import { ColumnHeader } from '@/mastodon/components/column_header'; +import { + ColumnHeader, + ColumnHeaderButton, +} 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'; @@ -28,6 +32,7 @@ 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'; @@ -123,6 +128,7 @@ const InnerTimeline: FC<{ account: Account; multiColumn: boolean }> = ({ } + extraButtons={} /> ) : ( @@ -151,6 +157,42 @@ 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, labelLength: 'long', reference }); + + if (hidden) { + return null; + } + + if (link) { + return ( + + {label} + + ); + } + + return ( + + {label} + + ); +}; + const Prepend: FC<{ accountId: string; forceEmpty: boolean;