Profile redesign: Pinned posts (#37761)
Co-authored-by: diondiondion <mail@diondiondion.com>
This commit is contained in:
1 parent
1310628a60
commit
2e30044a37
13 files changed
+340
-40
No files matched your search
@@ -5,6 +5,7 @@ import { FormattedMessage } from 'react-intl';
|
||||
|
||||
import classNames from 'classnames';
|
||||
|
||||
import IconPinned from '@/images/icons/icon_pinned.svg?react';
|
||||
import { fetchRelationships } from '@/mastodon/actions/accounts';
|
||||
import {
|
||||
AdminBadge,
|
||||
@@ -14,6 +15,7 @@ import {
|
||||
GroupBadge,
|
||||
MutedBadge,
|
||||
} from '@/mastodon/components/badge';
|
||||
import { Icon } from '@/mastodon/components/icon';
|
||||
import { useAccount } from '@/mastodon/hooks/useAccount';
|
||||
import type { AccountRole } from '@/mastodon/models/account';
|
||||
import { useAppDispatch, useAppSelector } from '@/mastodon/store';
|
||||
@@ -119,6 +121,16 @@ export const AccountBadges: FC<{ accountId: string }> = ({ accountId }) => {
|
||||
return <div className={'account__header__badges'}>{badges}</div>;
|
||||
};
|
||||
|
||||
export const PinnedBadge: FC = () => (
|
||||
<Badge
|
||||
className={classes.badge}
|
||||
icon={<Icon id='pinned' icon={IconPinned} />}
|
||||
label={
|
||||
<FormattedMessage id='account.timeline.pinned' defaultMessage='Pinned' />
|
||||
}
|
||||
/>
|
||||
);
|
||||
|
||||
function isAdminBadge(role: AccountRole) {
|
||||
const name = role.name.toLowerCase();
|
||||
return isRedesignEnabled() && (name === 'admin' || name === 'owner');
|
||||
|
||||
@@ -296,6 +296,11 @@ svg.badgeIcon {
|
||||
text-decoration: none;
|
||||
color: var(--color-text-primary);
|
||||
border-radius: 0;
|
||||
transition: color 0.2s ease-in-out;
|
||||
|
||||
&:not([aria-current='page']):is(:hover, :focus) {
|
||||
color: var(--color-text-brand-soft);
|
||||
}
|
||||
}
|
||||
|
||||
:global(.active) {
|
||||
|
||||
Reference in new issue
Block a user