Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

fix: optimize the user name is too long

shuai8ffa3b3d0ee4
diff --git a/ui/src/components/Counts/index.tsx b/ui/src/components/Counts/index.tsx
index 42555bb4..c32fb6b6 100644
--- a/ui/src/components/Counts/index.tsx
+++ b/ui/src/components/Counts/index.tsx
@@ -30,9 +30,10 @@ const Index: FC<Props> = ({
const { t } = useTranslation('translation', { keyPrefix: 'counts' });
return (
- <div className={classname('d-flex align-items-center', className)}>
+ <div
+ className={classname('d-flex align-items-center flex-wrap', className)}>
{showVotes && (
- <div className="d-flex align-items-center">
+ <div className="d-flex align-items-center flex-shrink-0">
<Icon name="hand-thumbs-up-fill me-1" />
<span>
{data.votes} {t('votes')}
@@ -41,7 +42,7 @@ const Index: FC<Props> = ({
)}
{showAccepted && (
- <div className="d-flex align-items-center ms-3 text-success">
+ <div className="d-flex align-items-center ms-3 text-success flex-shrink-0">
<Icon name="check-circle-fill me-1" />
<span>{t('accepted')}</span>
</div>
@@ -49,7 +50,7 @@ const Index: FC<Props> = ({
{showAnswers && (
<div
- className={`d-flex align-items-center ms-3 ${
+ className={`d-flex align-items-center ms-3 flex-shrink-0 ${
isAccepted ? 'text-success' : ''
}`}>
{isAccepted ? (
@@ -63,7 +64,7 @@ const Index: FC<Props> = ({
</div>
)}
{showViews && (
- <span className="summary-stat ms-3">
+ <span className="summary-stat ms-3 flex-shrink-0">
<Icon name="eye-fill" />
<em className="fst-normal ms-1">
{data.views} {t('views')}
diff --git a/ui/src/components/QuestionList/index.tsx b/ui/src/components/QuestionList/index.tsx
index 0911a945..4aec418d 100644
--- a/ui/src/components/QuestionList/index.tsx
+++ b/ui/src/components/QuestionList/index.tsx
@@ -84,8 +84,10 @@ const QuestionList: FC<Props> = ({
{li.status === 2 ? ` [${t('closed')}]` : ''}
</NavLink>
</h5>
- <div className="d-flex flex-column flex-md-row align-items-md-center small mb-2 text-secondary">
- <div className="d-flex">
+ <div
+ className="d-flex flex-column flex-md-row align-items-md-center small mb-2 text-secondary flex-wrap"
+ style={{ gap: '0.5rem' }}>
+ <div className="d-flex flex-shrink-0 me-0 me-md-3 flex-nowrap">
<BaseUserCard
data={li.operator}
showAvatar={false}
@@ -105,7 +107,7 @@ const QuestionList: FC<Props> = ({
views: li.view_count,
}}
isAccepted={li.accepted_answer_id >= 1}
- className="ms-0 ms-md-3 mt-2 mt-md-0"
+ className="justify-content-start-end justify-content-md-end flex-fill"
/>
</div>
<div className="question-tags m-n1">