From c0616bcab6feffd5b7ebee4e2ed7ec30292a174d Mon Sep 17 00:00:00 2001 From: Echo Date: Tue, 27 Jan 2026 16:03:52 +0100 Subject: [PATCH] Profile redesign: Username update (#37627) --- .../account/components/domain_pill.tsx | 3 +- .../components/account_header.tsx | 7 +- .../components/account_name.tsx | 73 +++++++++++-------- .../components/redesign.module.scss | 30 +++++--- .../material-icons/400-24px/help-fill.svg | 1 + .../material-icons/400-24px/help.svg | 1 + 6 files changed, 64 insertions(+), 51 deletions(-) create mode 100644 app/javascript/material-icons/400-24px/help-fill.svg create mode 100644 app/javascript/material-icons/400-24px/help.svg diff --git a/app/javascript/mastodon/features/account/components/domain_pill.tsx b/app/javascript/mastodon/features/account/components/domain_pill.tsx index 1f334bc004a..93edf5140f4 100644 --- a/app/javascript/mastodon/features/account/components/domain_pill.tsx +++ b/app/javascript/mastodon/features/account/components/domain_pill.tsx @@ -44,8 +44,7 @@ export const DomainPill: React.FC<{ aria-controls={accessibilityId} type='button' > - {domain} - {children} + {children ?? domain} - + {isRedesignEnabled() && } diff --git a/app/javascript/mastodon/features/account_timeline/components/account_name.tsx b/app/javascript/mastodon/features/account_timeline/components/account_name.tsx index 90ccf7486d3..20bff5aeeed 100644 --- a/app/javascript/mastodon/features/account_timeline/components/account_name.tsx +++ b/app/javascript/mastodon/features/account_timeline/components/account_name.tsx @@ -6,7 +6,7 @@ import { DisplayName } from '@/mastodon/components/display_name'; import { Icon } from '@/mastodon/components/icon'; import { useAccount } from '@/mastodon/hooks/useAccount'; import { useAppSelector } from '@/mastodon/store'; -import InfoIcon from '@/material-icons/400-24px/info.svg?react'; +import HelpIcon from '@/material-icons/400-24px/help.svg?react'; import LockIcon from '@/material-icons/400-24px/lock.svg?react'; import { DomainPill } from '../../account/components/domain_pill'; @@ -14,10 +14,7 @@ import { isRedesignEnabled } from '../common'; import classes from './redesign.module.scss'; -export const AccountName: FC<{ accountId: string; className?: string }> = ({ - accountId, - className, -}) => { +export const AccountName: FC<{ accountId: string }> = ({ accountId }) => { const intl = useIntl(); const account = useAccount(accountId); const me = useAppSelector((state) => state.meta.get('me') as string); @@ -31,38 +28,52 @@ export const AccountName: FC<{ accountId: string; className?: string }> = ({ const [username = '', domain = localDomain] = account.acct.split('@'); - return ( -

- - - - @{username} - {isRedesignEnabled() && '@'} - - {!isRedesignEnabled() && '@'} - {domain} + if (!isRedesignEnabled()) { + return ( +

+ + + + @{username} + @{domain} - + + {account.locked && ( + + )} + +

+ ); + } + + return ( +
+

+ +

+

+ @{username}@{domain} - {isRedesignEnabled() && } + - {!isRedesignEnabled() && account.locked && ( - - )} - -

+

+ ); }; diff --git a/app/javascript/mastodon/features/account_timeline/components/redesign.module.scss b/app/javascript/mastodon/features/account_timeline/components/redesign.module.scss index 0f46fdfbfdd..70d629e3466 100644 --- a/app/javascript/mastodon/features/account_timeline/components/redesign.module.scss +++ b/app/javascript/mastodon/features/account_timeline/components/redesign.module.scss @@ -7,20 +7,16 @@ flex-grow: 1; font-size: 22px; white-space: initial; - text-overflow: initial; line-height: normal; - - :global(.icon-info) { - margin-left: 2px; - width: 1em; - height: 1em; - align-self: center; - } } -// Overrides .account__header__tabs__name h1 small -h1.name > small { - gap: 0; +.username { + display: flex; + font-size: 13px; + color: var(--color-text-secondary); + align-items: center; + user-select: all; + margin-top: 4px; } .domainPill { @@ -32,10 +28,20 @@ h1.name > small { color: inherit; font-size: 1em; font-weight: initial; + margin-left: 2px; + width: 16px; + height: 16px; + transition: color 0.2s ease-in-out; + > svg { + width: 100%; + height: 100%; + } + + &:hover, &:global(.active) { background: none; - color: inherit; + color: var(--color-text-brand-soft); } } diff --git a/app/javascript/material-icons/400-24px/help-fill.svg b/app/javascript/material-icons/400-24px/help-fill.svg new file mode 100644 index 00000000000..6fd48ca5dd1 --- /dev/null +++ b/app/javascript/material-icons/400-24px/help-fill.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/javascript/material-icons/400-24px/help.svg b/app/javascript/material-icons/400-24px/help.svg new file mode 100644 index 00000000000..0f10691c552 --- /dev/null +++ b/app/javascript/material-icons/400-24px/help.svg @@ -0,0 +1 @@ + \ No newline at end of file