From 5471704b51db8061211eb44af1e3f9a6d3c8607f Mon Sep 17 00:00:00 2001 From: shuai Date: Wed, 1 Mar 2023 17:28:50 +0800 Subject: [PATCH] fix: question detail show delete msg for admin users --- i18n/en_US.yaml | 8 +++++--- ui/src/pages/Questions/Detail/components/Answer/index.tsx | 7 ++++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/i18n/en_US.yaml b/i18n/en_US.yaml index 987d76de..c2158947 100644 --- a/i18n/en_US.yaml +++ b/i18n/en_US.yaml @@ -1410,8 +1410,10 @@ ui: reputation: reputation votes: votes prompt: - leave_page: "Are you sure you want to leave the page?" - changes_not_save: "Your changes may not be saved." + leave_page: Are you sure you want to leave the page? + changes_not_save: Your changes may not be saved. draft: - discard_confirm: "Are you sure you want to discard your draft?" + discard_confirm: Are you sure you want to discard your draft? + messages: + post_deleted: This post has been deleted. diff --git a/ui/src/pages/Questions/Detail/components/Answer/index.tsx b/ui/src/pages/Questions/Detail/components/Answer/index.tsx index 1fb5f5d0..7da9f028 100644 --- a/ui/src/pages/Questions/Detail/components/Answer/index.tsx +++ b/ui/src/pages/Questions/Detail/components/Answer/index.tsx @@ -1,5 +1,5 @@ import { memo, FC, useEffect, useRef } from 'react'; -import { Button } from 'react-bootstrap'; +import { Button, Alert } from 'react-bootstrap'; import { useTranslation } from 'react-i18next'; import { Link, useSearchParams } from 'react-router-dom'; @@ -72,6 +72,11 @@ const Index: FC = ({ } return (
+ {data.status === 10 && ( + + {t('post_deleted', { keyPrefix: 'messages' })} + + )}