From 6696cde09310b6d221fcb69fef8a0c2cd0314337 Mon Sep 17 00:00:00 2001 From: Tassoman Date: Fri, 20 Jan 2023 16:01:13 +0000 Subject: [PATCH] adding: bot badge inside timeline statuses --- CHANGELOG.md | 1 + app/soapbox/components/account.tsx | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4cdc244133..516e9bda01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Admin: redirect the homepage to any URL. - Compatibility: added compatibility with Friendica. +- Posts: bot badge on statuses from bot accounts. ### Changed diff --git a/app/soapbox/components/account.tsx b/app/soapbox/components/account.tsx index f86cf83704..122bfdb51a 100644 --- a/app/soapbox/components/account.tsx +++ b/app/soapbox/components/account.tsx @@ -1,4 +1,5 @@ import React from 'react'; +import { defineMessages, useIntl } from 'react-intl'; import { Link, useHistory } from 'react-router-dom'; import HoverRefWrapper from 'soapbox/components/hover-ref-wrapper'; @@ -8,6 +9,7 @@ import { useAppSelector, useOnScreen } from 'soapbox/hooks'; import { getAcct } from 'soapbox/utils/accounts'; import { displayFqn } from 'soapbox/utils/state'; +import Badge from './badge'; import RelativeTimestamp from './relative-timestamp'; import { Avatar, Emoji, HStack, Icon, IconButton, Stack, Text } from './ui'; @@ -18,6 +20,10 @@ interface IInstanceFavicon { disabled?: boolean, } +const messages = defineMessages({ + bot: { id: 'account.badges.bot', defaultMessage: 'Bot' }, +}); + const InstanceFavicon: React.FC = ({ account, disabled }) => { const history = useHistory(); @@ -151,6 +157,8 @@ const Account = ({ return null; }; + const intl = useIntl(); + React.useEffect(() => { const style: React.CSSProperties = {}; const actionWidth = actionRef.current?.clientWidth || 0; @@ -223,6 +231,8 @@ const Account = ({ /> {account.verified && } + + {account.bot && }