You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@answer.apache.org by sh...@apache.org on 2024/03/15 02:28:47 UTC
(incubator-answer) branch feat/1.3.0/ui updated: fix: ui adjustment
This is an automated email from the ASF dual-hosted git repository.
shuai pushed a commit to branch feat/1.3.0/ui
in repository https://gitbox.apache.org/repos/asf/incubator-answer.git
The following commit(s) were added to refs/heads/feat/1.3.0/ui by this push:
new 6df4d792 fix: ui adjustment
6df4d792 is described below
commit 6df4d7926015796c8251b10408aa967f665c0ff7
Author: shuai <li...@sifou.com>
AuthorDate: Fri Mar 15 10:19:57 2024 +0800
fix: ui adjustment
---
ui/src/pages/Admin/Answers/index.tsx | 48 ++++++++++------------
.../Ask/components/SearchQuestion/index.tsx | 21 ++++++----
2 files changed, 36 insertions(+), 33 deletions(-)
diff --git a/ui/src/pages/Admin/Answers/index.tsx b/ui/src/pages/Admin/Answers/index.tsx
index a653f7f5..091fe2db 100644
--- a/ui/src/pages/Admin/Answers/index.tsx
+++ b/ui/src/pages/Admin/Answers/index.tsx
@@ -110,32 +110,28 @@ const Answers: FC = () => {
return (
<tr key={li.id}>
<td>
- <Stack>
- <Stack direction="horizontal" gap={2}>
- <a
- href={pathFactory.answerLanding({
- questionId: li.question_id,
- slugTitle: li.question_info.url_title,
- answerId: li.id,
- })}
- target="_blank"
- className="text-break text-wrap"
- rel="noreferrer">
- {li.question_info.title}
- {li.accepted === 2 && (
- <Icon
- name="check-circle-fill"
- className="ms-2 text-success"
- />
- )}
- </a>
- </Stack>
- <div
- className="text-truncate-2 small"
- style={{ maxWidth: '30rem' }}>
- {escapeRemove(li.description)}
- </div>
- </Stack>
+ <a
+ href={pathFactory.answerLanding({
+ questionId: li.question_id,
+ slugTitle: li.question_info.url_title,
+ answerId: li.id,
+ })}
+ target="_blank"
+ className="text-break text-wrap"
+ rel="noreferrer">
+ {li.question_info.title}
+ </a>
+ {li.accepted === 2 && (
+ <Icon
+ name="check-circle-fill"
+ className="ms-2 text-success"
+ />
+ )}
+ <div
+ className="text-truncate-2 small"
+ style={{ maxWidth: '30rem' }}>
+ {escapeRemove(li.description)}
+ </div>
</td>
<td>{li.vote_count}</td>
<td>
diff --git a/ui/src/pages/Questions/Ask/components/SearchQuestion/index.tsx b/ui/src/pages/Questions/Ask/components/SearchQuestion/index.tsx
index 2f79305b..96b2b0ac 100644
--- a/ui/src/pages/Questions/Ask/components/SearchQuestion/index.tsx
+++ b/ui/src/pages/Questions/Ask/components/SearchQuestion/index.tsx
@@ -46,17 +46,24 @@ const SearchQuestion = ({ similarQuestions }) => {
<ListGroup.Item
action
as="a"
- className="link-dark text-wrap text-break grid gap-0 row-gap-3"
+ className="link-dark text-wrap text-break"
key={item.id}
href={pathFactory.questionLanding(item.id, item.url_title)}
target="_blank">
- {item.title}
- {item.status === 'closed'
- ? ` [${t('closed', { keyPrefix: 'question' })}]`
- : null}
+ <span
+ className={`${
+ item.accepted_answer || item.answer_count > 0
+ ? 'me-3'
+ : ''
+ }`}>
+ {item.title}
+ {item.status === 'closed'
+ ? ` [${t('closed', { keyPrefix: 'question' })}] `
+ : null}
+ </span>
{item.accepted_answer ? (
- <span className="small ms-3 text-success d-inline-block">
+ <span className="small text-success d-inline-block">
<Icon type="bi" name="check-circle-fill" />
<span className="ms-1">
{t('x_answers', {
@@ -67,7 +74,7 @@ const SearchQuestion = ({ similarQuestions }) => {
</span>
) : (
item.answer_count > 0 && (
- <span className="small ms-3 text-secondary d-inline-block">
+ <span className="small text-secondary d-inline-block">
<Icon type="bi" name="chat-square-text-fill" />
<span className="ms-1">
{t('x_answers', {