Skip to content

Commit 2fac528

Browse files
committed
refactor(ui): optimize search and sort bar layout for better responsive display
1 parent fb8ad76 commit 2fac528

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

src/components/Article/SearchAndSortBar.css

+3-6
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,9 @@
1616
white-space: nowrap;
1717
overflow: hidden;
1818
flex: 1;
19-
justify-content: space-between;
2019
}
2120

2221
.search-and-sort-bar .page-info .title-container {
23-
flex: 1;
24-
min-width: 0;
2522
overflow: hidden;
2623
}
2724

@@ -35,14 +32,14 @@
3532
.search-and-sort-bar .page-info .count-label {
3633
color: var(--color-text-4);
3734
margin-left: 6px;
38-
flex-shrink: 0;
35+
flex: 0 0 auto;
3936
font-weight: 500;
40-
text-align: right;
37+
display: inline-block;
4138
}
4239

4340
.search-and-sort-bar .button-group {
4441
display: flex;
45-
flex-shrink: 0;
42+
flex: 0 0 auto;
4643
gap: 8px;
4744
margin: 0 8px;
4845
}

src/components/Article/SearchAndSortBar.jsx

+9-7
Original file line numberDiff line numberDiff line change
@@ -209,22 +209,24 @@ const SearchAndSortBar = () => {
209209
return (
210210
<div className="search-and-sort-bar" style={{ width: isBelowMedium ? "100%" : 370 }}>
211211
<SidebarTrigger />
212-
{title && (
213-
<div className="page-info">
214-
<div className="title-container">
212+
<div className="page-info">
213+
<div className="title-container">
214+
{title ? (
215215
<Typography.Ellipsis
216216
expandable={false}
217217
showTooltip={!isBelowMedium}
218218
style={{ fontWeight: 500 }}
219219
>
220220
{title}
221221
</Typography.Ellipsis>
222-
</div>
223-
{isArticleListReady && count > 0 && (
224-
<Typography.Text className="count-label">({count})</Typography.Text>
222+
) : (
223+
<div className="placeholder-title"></div>
225224
)}
226225
</div>
227-
)}
226+
{isArticleListReady && count > 0 && (
227+
<Typography.Text className="count-label">({count})</Typography.Text>
228+
)}
229+
</div>
228230
<div className="button-group">
229231
<ActiveButton
230232
active={!!filterString}

0 commit comments

Comments
 (0)