From c8bdf0f0f4d08c286dbf14ab0b0e75b5ec205c03 Mon Sep 17 00:00:00 2001 From: shuai Date: Thu, 29 Sep 2022 12:32:31 +0800 Subject: [PATCH 1/3] fix: #955 --- ui/src/components/Pagination/index.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ui/src/components/Pagination/index.tsx b/ui/src/components/Pagination/index.tsx index 2ae10b35..e8ac8883 100644 --- a/ui/src/components/Pagination/index.tsx +++ b/ui/src/components/Pagination/index.tsx @@ -1,4 +1,4 @@ -import { FC, memo } from 'react'; +import { FC } from 'react'; import { Pagination } from 'react-bootstrap'; import { useTranslation } from 'react-i18next'; import { useSearchParams, useNavigate, useLocation } from 'react-router-dom'; @@ -47,6 +47,7 @@ const PageItem = ({ page, currentPage, path }: PageItemProps) => { href={path} onClick={(e) => { e.preventDefault(); + e.stopPropagation(); navigate(path); window.scrollTo(0, 0); }}> @@ -111,7 +112,7 @@ const Index: FC = ({ )} {currentPage === 4 && totalPage > 6 && ( = ({ {currentPage >= 5 && ( <> = ({ ); }; -export default memo(Index); +export default Index; From 00fbfeb9e0a9493056892216ea42a4f8104adc1f Mon Sep 17 00:00:00 2001 From: fen Date: Thu, 29 Sep 2022 12:43:00 +0800 Subject: [PATCH 2/3] fix: lang typo --- ui/src/i18n/locales/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/src/i18n/locales/en.json b/ui/src/i18n/locales/en.json index eaca6094..cb6fb595 100644 --- a/ui/src/i18n/locales/en.json +++ b/ui/src/i18n/locales/en.json @@ -848,7 +848,7 @@ "interface": { "page_title": "Interface", "logo": { - "label": "Logo", + "label": "Logo (optional)", "msg": "Site logo cannot be empty.", "text": "You can upload your image or <1>reset it to the site title text." }, From 814b73548980460c5f8715045380b30174db0f81 Mon Sep 17 00:00:00 2001 From: shuai Date: Thu, 29 Sep 2022 14:56:09 +0800 Subject: [PATCH 3/3] fix: user deleted remove link --- ui/config-overrides.js | 3 +- ui/src/components/BaseUserCard/index.tsx | 24 +++++++++---- .../Comment/components/ActionBar/index.tsx | 13 ++++--- ui/src/components/Comment/index.tsx | 1 + ui/src/components/Questions/index.tsx | 34 +++++++++++-------- ui/src/components/UserCard/index.tsx | 18 +++++++--- .../Search/components/SearchItem/index.tsx | 13 ++----- .../Notifications/components/Inbox/index.tsx | 10 ++++-- .../Personal/components/DefaultList/index.tsx | 13 +++---- .../Personal/components/UserInfo/index.tsx | 23 ++++++++++--- 10 files changed, 94 insertions(+), 58 deletions(-) diff --git a/ui/config-overrides.js b/ui/config-overrides.js index a1c4dce4..706bca3f 100644 --- a/ui/config-overrides.js +++ b/ui/config-overrides.js @@ -26,7 +26,8 @@ module.exports = { const config = configFunction(proxy, allowedHost); config.proxy = { '/answer': { - target: 'http://10.0.10.98:2060', + target: "http://10.0.20.84:8080", + // target: 'http://10.0.10.98:2060', changeOrigin: true, secure: false, }, diff --git a/ui/src/components/BaseUserCard/index.tsx b/ui/src/components/BaseUserCard/index.tsx index a5278ebc..58e7f313 100644 --- a/ui/src/components/BaseUserCard/index.tsx +++ b/ui/src/components/BaseUserCard/index.tsx @@ -5,23 +5,35 @@ import { Avatar } from '@answer/components'; interface Props { data: any; + showAvatar?: boolean; avatarSize?: string; className?: string; } const Index: FC = ({ data, + showAvatar = true, avatarSize = '20px', className = 'fs-14', }) => { return (
- - - - - {data?.display_name} - + {data.status !== 'deleted' ? ( + + {showAvatar && ( + + )} + {data?.display_name} + + ) : ( + <> + {showAvatar && ( + + )} + {data?.display_name} + + )} + {data?.rank}
); diff --git a/ui/src/components/Comment/components/ActionBar/index.tsx b/ui/src/components/Comment/components/ActionBar/index.tsx index 041bd97b..7fee20f1 100644 --- a/ui/src/components/Comment/components/ActionBar/index.tsx +++ b/ui/src/components/Comment/components/ActionBar/index.tsx @@ -17,15 +17,20 @@ const ActionBar = ({ onReply, onVote, onAction, + userStatus = '', }) => { const { t } = useTranslation('translation', { keyPrefix: 'comment' }); return (
-
- {nickName} - - +
+ {userStatus !== 'deleted' ? ( + {nickName} + ) : ( + {nickName} + )} + +