Skip to content

Commit b3fde86

Browse files
author
dashuai
authored
Merge pull request #481 from answerdev/feat/1.1.2/ui
fix: optimize the user name is too long
2 parents 4443811 + 8ffa3b3 commit b3fde86

2 files changed

Lines changed: 11 additions & 8 deletions

File tree

ui/src/components/Counts/index.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ const Index: FC<Props> = ({
3030
const { t } = useTranslation('translation', { keyPrefix: 'counts' });
3131

3232
return (
33-
<div className={classname('d-flex align-items-center', className)}>
33+
<div
34+
className={classname('d-flex align-items-center flex-wrap', className)}>
3435
{showVotes && (
35-
<div className="d-flex align-items-center">
36+
<div className="d-flex align-items-center flex-shrink-0">
3637
<Icon name="hand-thumbs-up-fill me-1" />
3738
<span>
3839
{data.votes} {t('votes')}
@@ -41,15 +42,15 @@ const Index: FC<Props> = ({
4142
)}
4243

4344
{showAccepted && (
44-
<div className="d-flex align-items-center ms-3 text-success">
45+
<div className="d-flex align-items-center ms-3 text-success flex-shrink-0">
4546
<Icon name="check-circle-fill me-1" />
4647
<span>{t('accepted')}</span>
4748
</div>
4849
)}
4950

5051
{showAnswers && (
5152
<div
52-
className={`d-flex align-items-center ms-3 ${
53+
className={`d-flex align-items-center ms-3 flex-shrink-0 ${
5354
isAccepted ? 'text-success' : ''
5455
}`}>
5556
{isAccepted ? (
@@ -63,7 +64,7 @@ const Index: FC<Props> = ({
6364
</div>
6465
)}
6566
{showViews && (
66-
<span className="summary-stat ms-3">
67+
<span className="summary-stat ms-3 flex-shrink-0">
6768
<Icon name="eye-fill" />
6869
<em className="fst-normal ms-1">
6970
{data.views} {t('views')}

ui/src/components/QuestionList/index.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,10 @@ const QuestionList: FC<Props> = ({
8484
{li.status === 2 ? ` [${t('closed')}]` : ''}
8585
</NavLink>
8686
</h5>
87-
<div className="d-flex flex-column flex-md-row align-items-md-center small mb-2 text-secondary">
88-
<div className="d-flex">
87+
<div
88+
className="d-flex flex-column flex-md-row align-items-md-center small mb-2 text-secondary flex-wrap"
89+
style={{ gap: '0.5rem' }}>
90+
<div className="d-flex flex-shrink-0 me-0 me-md-3 flex-nowrap">
8991
<BaseUserCard
9092
data={li.operator}
9193
showAvatar={false}
@@ -105,7 +107,7 @@ const QuestionList: FC<Props> = ({
105107
views: li.view_count,
106108
}}
107109
isAccepted={li.accepted_answer_id >= 1}
108-
className="ms-0 ms-md-3 mt-2 mt-md-0"
110+
className="justify-content-start-end justify-content-md-end flex-fill"
109111
/>
110112
</div>
111113
<div className="question-tags m-n1">

0 commit comments

Comments
 (0)