Profile: Remove old classes (#38920)

This commit is contained in:
Echo authored and GitHub committed 2026-05-07 09:41:03 +00:00
1 parent 2fed2edd5e
commit f24f98ce40
10 files changed
+232 -530

No files matched your search

@@ -3,8 +3,6 @@ import type { FC } from 'react';
import { defineMessages, useIntl } from 'react-intl';
import classNames from 'classnames';
import { followAccount } from '@/mastodon/actions/accounts';
import { useAccount } from '@/mastodon/hooks/useAccount';
import { getAccountHidden } from '@/mastodon/selectors/accounts';
@@ -18,6 +16,7 @@ import { FollowButton } from '../follow_button';
import { IconButton } from '../icon_button';
import { AccountMenu } from './menu';
import classes from './styles.module.scss';
const messages = defineMessages({
enableNotifications: {
@@ -49,7 +48,7 @@ export const AccountButtons: FC<AccountButtonsProps> = ({
const me = useAppSelector((state) => state.meta.get('me') as string);
return (
<div className={classNames('account__header__buttons', className)}>
<div className={className}>
{!hidden && (
<AccountButtonsOther accountId={accountId} noShare={noShare} />
)}
@@ -94,7 +93,7 @@ const AccountButtonsOther: FC<
{!isMovedAndUnfollowedAccount && (
<FollowButton
accountId={accountId}
className='account__header__follow-button'
className={classes.followButton}
labelLength='long'
/>
)}
@@ -107,15 +107,8 @@ const FieldCard: FC<{
field: AccountField;
}> = ({ htmlHandlers, field }) => {
const intl = useIntl();
const {
name,
name_emojified,
nameHasEmojis,
value_emojified,
value_plain,
valueHasEmojis,
verified_at,
} = field;
const { name, nameHasEmojis, value_plain, valueHasEmojis, verified_at } =
field;
const { wrapperRef, isLabelOverflowing, isValueOverflowing } =
useFieldOverflow();
@@ -139,7 +132,6 @@ const FieldCard: FC<{
label={
<FieldHTML
text={name}
textEmojified={name_emojified}
textHasCustomEmoji={nameHasEmojis}
className='translate'
isOverflowing={isLabelOverflowing}
@@ -150,7 +142,6 @@ const FieldCard: FC<{
value={
<FieldHTML
text={value_plain}
textEmojified={value_emojified}
textHasCustomEmoji={valueHasEmojis}
isOverflowing={isValueOverflowing}
onOverflowClick={handleOverflowClick}
@@ -175,7 +166,6 @@ const FieldCard: FC<{
type FieldHTMLProps = {
text: string;
textEmojified: string;
textHasCustomEmoji: boolean;
isOverflowing?: boolean;
onOverflowClick?: () => void;
@@ -183,9 +173,7 @@ type FieldHTMLProps = {
const FieldHTML: FC<FieldHTMLProps> = ({
className,
extraEmojis,
text,
textEmojified,
textHasCustomEmoji,
isOverflowing,
onOverflowClick,
@@ -198,7 +186,7 @@ const FieldHTML: FC<FieldHTMLProps> = ({
const html = (
<EmojiHTML
as='span'
htmlString={textEmojified}
htmlString={text}
className={className}
onElement={handleElement}
data-contents
@@ -97,22 +97,20 @@ export const AccountHeader: React.FC<{
const isMe = me && account.id === me;
return (
<div className='account-timeline__header'>
<div>
{!hidden && account.memorial && <MemorialNote />}
{!hidden && account.moved && (
<MovedNote accountId={account.id} targetAccountId={account.moved} />
)}
<AnimateEmojiProvider
className={classNames('account__header', {
inactive: !!account.moved,
})}
className={classNames(!!account.moved && classes.moved)}
>
{!suspendedOrHidden && !account.moved && relationship?.requested_by && (
<FollowRequestNoteContainer account={account} />
)}
<div className={classNames('account__header__image', classes.header)}>
<div className={classes.header}>
{!suspendedOrHidden && (
<img
src={autoPlayGif ? account.header : account.header_static}
@@ -122,21 +120,16 @@ export const AccountHeader: React.FC<{
)}
</div>
<div className={classNames('account__header__bar', classes.barWrapper)}>
<div
className={classNames(
'account__header__tabs',
classes.avatarWrapper,
)}
>
<div className={classes.barWrapper}>
<div className={classes.avatarWrapper}>
<a
className='avatar'
href={account.avatar}
rel='noopener'
target='_blank'
onClick={handleOpenAvatar}
>
<Avatar
className={classes.avatar}
account={suspendedOrHidden ? undefined : account}
alt={account.avatar_description}
size={80}
@@ -144,12 +137,7 @@ export const AccountHeader: React.FC<{
</a>
</div>
<div
className={classNames(
'account__header__tabs__name',
classes.displayNameWrapper,
)}
>
<div className={classes.displayNameWrapper}>
<AccountName accountId={accountId} />
<AccountButtons
accountId={accountId}
@@ -169,23 +157,16 @@ export const AccountHeader: React.FC<{
)}
{!suspendedOrHidden && (
<div className='account__header__extra'>
<div className='account__header__bio'>
{me && account.id !== me && (
<AccountNote accountId={accountId} />
)}
<div className={classes.bioButtonsWrapper}>
{me && account.id !== me && <AccountNote accountId={accountId} />}
<AccountBio
showDropdown
accountId={accountId}
className={classNames(
'account__header__content',
classes.bio,
)}
/>
<AccountBio
showDropdown
accountId={accountId}
className={classes.bio}
/>
<AccountHeaderFields accountId={accountId} />
</div>
<AccountHeaderFields accountId={accountId} />
{!me && account.email_subscriptions && (
<AccountSubscriptionForm accountId={accountId} />
@@ -1,26 +1,79 @@
.moved {
opacity: 0.5;
}
// Account header
.header {
height: 120px;
overflow: hidden;
background: var(--color-bg-secondary);
border-bottom: 1px solid var(--color-border-primary);
img {
object-fit: cover;
display: block;
width: 100%;
height: 100%;
margin: 0;
}
@container (width >= 500px) {
height: 160px;
}
:global(.inactive) & {
filter: grayscale(100%);
}
}
// Wraps everything except the header image.
.barWrapper {
border-bottom: none;
padding-inline: 16px;
}
// Avatar
.avatarWrapper {
margin-top: -64px;
padding-top: 0;
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 8px;
overflow: hidden;
margin-inline-start: -2px; // aligns the pfp with content below
}
.avatar {
background: var(--color-bg-primary);
border: 1px solid var(--color-border-primary);
border-radius: var(--avatar-border-radius);
.moved & {
filter: grayscale(100%);
}
}
.displayNameWrapper {
display: flex;
align-items: start;
gap: 16px;
margin-top: 16px;
margin-bottom: 16px;
h1 {
font-size: 17px;
line-height: 22px;
color: var(--color-text-primary);
font-weight: 600;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
:global(.emojione) {
width: 22px;
height: 22px;
}
}
.nameWrapper {
@@ -112,21 +165,6 @@
}
}
$button-breakpoint: 420px;
$button-fallback-breakpoint: $button-breakpoint + 55px;
.buttonsDesktop {
@container (width < #{$button-breakpoint}) {
display: none;
}
@supports (not (container-type: inline-size)) {
@media (max-width: #{$button-fallback-breakpoint}) {
display: none;
}
}
}
.handleCopy {
border: 1px solid var(--color-border-primary);
border-radius: 8px;
@@ -147,6 +185,45 @@ $button-fallback-breakpoint: $button-breakpoint + 55px;
}
}
$button-breakpoint: 420px;
$button-fallback-breakpoint: $button-breakpoint + 55px;
.buttonsDesktop,
.buttonsMobile {
display: flex;
align-items: center;
gap: 8px;
:global(.button) {
flex-shrink: 1;
white-space: nowrap;
min-width: 80px;
}
:global(.icon-button) {
border: 1px solid var(--color-border-primary);
border-radius: 4px;
box-sizing: content-box;
padding: 5px;
&:global(.copied) {
border-color: var(--color-text-success);
}
}
}
.buttonsDesktop {
@container (width < #{$button-breakpoint}) {
display: none;
}
@supports (not (container-type: inline-size)) {
@media (max-width: #{$button-fallback-breakpoint}) {
display: none;
}
}
}
.buttonsMobile {
position: sticky;
bottom: var(--mobile-bottom-nav-height);
@@ -188,6 +265,7 @@ $button-fallback-breakpoint: $button-breakpoint + 55px;
.bio {
font-size: 15px;
color: var(--color-text-primary);
}
.familiarFollowers {
@@ -420,3 +498,13 @@ $button-fallback-breakpoint: $button-breakpoint + 55px;
background: var(--color-bg-primary);
}
}
// Buttons
.followButton {
flex-grow: 1;
}
.bioButtonsWrapper {
margin-top: 16px;
}