From 9227eef670797239cd35cea4121db4954efd9e75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Fri, 27 Sep 2024 22:04:48 +0200 Subject: [PATCH] pl-fe: profile fields panel doesn't need a title MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- .../pl-fe/src/components/ui/widget/widget.tsx | 26 ++++++++++--------- .../panels/profile-fields-panel.tsx | 3 +-- packages/pl-fe/src/locales/en.json | 1 - 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/pl-fe/src/components/ui/widget/widget.tsx b/packages/pl-fe/src/components/ui/widget/widget.tsx index 64e295320..c9e3a7eec 100644 --- a/packages/pl-fe/src/components/ui/widget/widget.tsx +++ b/packages/pl-fe/src/components/ui/widget/widget.tsx @@ -26,7 +26,7 @@ const WidgetBody: React.FC = ({ children }): JSX.Element => ( interface IWidget { /** Widget title text. */ - title: React.ReactNode; + title?: React.ReactNode; /** Callback when the widget action is clicked. */ onActionClick?: () => void; /** URL to the svg icon for the widget action. */ @@ -47,17 +47,19 @@ const Widget: React.FC = ({ action, }): JSX.Element => ( - - - {action || (onActionClick && ( - - ))} - + {title || action || onActionClick && ( + + {title && } + {action || (onActionClick && ( + + ))} + + )} {children} ); diff --git a/packages/pl-fe/src/features/ui/components/panels/profile-fields-panel.tsx b/packages/pl-fe/src/features/ui/components/panels/profile-fields-panel.tsx index d7948f87c..ee34b2be2 100644 --- a/packages/pl-fe/src/features/ui/components/panels/profile-fields-panel.tsx +++ b/packages/pl-fe/src/features/ui/components/panels/profile-fields-panel.tsx @@ -1,5 +1,4 @@ import React from 'react'; -import { FormattedMessage } from 'react-intl'; import { Widget, Stack } from 'pl-fe/components/ui'; @@ -13,7 +12,7 @@ interface IProfileFieldsPanel { /** Custom profile fields for sidebar. */ const ProfileFieldsPanel: React.FC = ({ account }) => ( - }> + {account.fields.map((field, i) => ( diff --git a/packages/pl-fe/src/locales/en.json b/packages/pl-fe/src/locales/en.json index 1e4c9c573..aef4e2fd2 100644 --- a/packages/pl-fe/src/locales/en.json +++ b/packages/pl-fe/src/locales/en.json @@ -1288,7 +1288,6 @@ "profile_dropdown.logout": "Log out @{acct}", "profile_dropdown.switch_account": "Switch accounts", "profile_dropdown.theme": "Theme", - "profile_fields_panel.title": "Profile fields", "reactions.all": "All", "regeneration_indicator.label": "Loading…", "regeneration_indicator.sublabel": "Your home feed is being prepared!",