From b1a89b8d354ebfc4c4b729d116cd54aacaef03ae Mon Sep 17 00:00:00 2001 From: Claire Date: Fri, 29 Nov 2024 17:22:09 +0100 Subject: [PATCH] Add lock icon to hover cards --- .../mastodon/components/display_name.tsx | 14 ++++++++++++-- .../mastodon/components/hover_card_account.tsx | 6 +++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/app/javascript/mastodon/components/display_name.tsx b/app/javascript/mastodon/components/display_name.tsx index 8409244827..c2472e40c8 100644 --- a/app/javascript/mastodon/components/display_name.tsx +++ b/app/javascript/mastodon/components/display_name.tsx @@ -2,6 +2,8 @@ import React from 'react'; import type { List } from 'immutable'; +import LockIcon from '@/material-icons/400-24px/lock.svg?react'; +import { Icon } from 'mastodon/components/icon'; import type { Account } from 'mastodon/models/account'; import { autoPlayGif } from '../initial_state'; @@ -12,6 +14,7 @@ interface Props { account?: Account; others?: List; localDomain?: string; + showLocked?: boolean; } export class DisplayName extends React.PureComponent { @@ -48,7 +51,7 @@ export class DisplayName extends React.PureComponent { }; render() { - const { others, localDomain } = this.props; + const { others, localDomain, showLocked } = this.props; let displayName: React.ReactNode, suffix: React.ReactNode, @@ -93,7 +96,14 @@ export class DisplayName extends React.PureComponent { /> ); - suffix = @{acct}; + suffix = ( + + @{acct} + {showLocked && account.get('locked') && ( + + )} + + ); } else { displayName = ( diff --git a/app/javascript/mastodon/components/hover_card_account.tsx b/app/javascript/mastodon/components/hover_card_account.tsx index 05033e4ac7..4d91c8ead7 100644 --- a/app/javascript/mastodon/components/hover_card_account.tsx +++ b/app/javascript/mastodon/components/hover_card_account.tsx @@ -51,7 +51,11 @@ export const HoverCardAccount = forwardRef< <> - +