Feat/1.3.0/UI (#848)

This commit is contained in:
dashuai
2024-03-15 10:40:19 +08:00
committed by GitHub
parent 4a038b95ef
commit a309f9f897
3 changed files with 37 additions and 33 deletions
+1
View File
@@ -1071,6 +1071,7 @@ ui:
asked: asked
update: Modified
edit: edited
commented: commented
Views: Viewed
Follow: Follow
Following: Following
+22 -26
View File
@@ -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>
@@ -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', {