Skip to content

Commit 1e1258d

Browse files
author
shuai
committed
fix: name max width set 300px
1 parent 255f76b commit 1e1258d

3 files changed

Lines changed: 15 additions & 14 deletions

File tree

ui/src/components/BaseUserCard/index.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const Index: FC<Props> = ({
2424
showReputation = true,
2525
}) => {
2626
return (
27-
<div className={`text-secondary ${className}`}>
27+
<div className={`d-flex align-items-center text-secondary ${className}`}>
2828
{data?.status !== 'deleted' ? (
2929
<Link to={`/users/${data?.username}`}>
3030
{showAvatar && (
@@ -36,7 +36,9 @@ const Index: FC<Props> = ({
3636
alt={data?.display_name}
3737
/>
3838
)}
39-
<span className="me-1 text-break">{data?.display_name}</span>
39+
<span className="me-1 text-truncate-1" style={{ maxWidth: '300px' }}>
40+
{data?.display_name}
41+
</span>
4042
</Link>
4143
) : (
4244
<>
@@ -49,7 +51,9 @@ const Index: FC<Props> = ({
4951
alt={data?.display_name}
5052
/>
5153
)}
52-
<span className="me-1 text-break">{data?.display_name}</span>
54+
<span className="me-1 text-truncate-1" style={{ maxWidth: '300px' }}>
55+
{data?.display_name}
56+
</span>
5357
</>
5458
)}
5559

ui/src/components/Counts/index.tsx

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

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

4443
{showAccepted && (
45-
<div className="d-flex align-items-center ms-3 text-success flex-shrink-0">
44+
<div className="d-flex align-items-center ms-3 text-success">
4645
<Icon name="check-circle-fill me-1" />
4746
<span>{t('accepted')}</span>
4847
</div>
4948
)}
5049

5150
{showAnswers && (
5251
<div
53-
className={`d-flex align-items-center ms-3 flex-shrink-0 ${
52+
className={`d-flex align-items-center ms-3 ${
5453
isAccepted ? 'text-success' : ''
5554
}`}>
5655
{isAccepted ? (
@@ -64,7 +63,7 @@ const Index: FC<Props> = ({
6463
</div>
6564
)}
6665
{showViews && (
67-
<span className="summary-stat ms-3 flex-shrink-0">
66+
<span className="summary-stat ms-3">
6867
<Icon name="eye-fill" />
6968
<em className="fst-normal ms-1">
7069
{data.views} {t('views')}

ui/src/components/QuestionList/index.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,8 @@ const QuestionList: FC<Props> = ({
8484
{li.status === 2 ? ` [${t('closed')}]` : ''}
8585
</NavLink>
8686
</h5>
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">
87+
<div className="d-flex flex-column flex-md-row align-items-md-center small mb-2 text-secondary">
88+
<div className="d-flex flex-nowrap">
9189
<BaseUserCard
9290
data={li.operator}
9391
showAvatar={false}
@@ -107,7 +105,7 @@ const QuestionList: FC<Props> = ({
107105
views: li.view_count,
108106
}}
109107
isAccepted={li.accepted_answer_id >= 1}
110-
className="justify-content-start-end justify-content-md-end flex-fill"
108+
className="ms-0 ms-md-3 mt-2 mt-md-0"
111109
/>
112110
</div>
113111
<div className="question-tags m-n1">

0 commit comments

Comments
 (0)