Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit f2c005e

Browse files
Merge branch 'develop' into issue128
2 parents 6e51c4d + 28377e5 commit f2c005e

File tree

4 files changed

+21
-4
lines changed

4 files changed

+21
-4
lines changed

client/src/components/GroupsSideMenu/filters.module.css

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,13 @@
8383

8484
.sectionItem {
8585
cursor: pointer;
86-
height: 24px;
8786
width: 322px;
8887
border-radius: 10px;
8988
border: 1px solid gray1_025;
9089

9190
display: flex;
9291
flex-direction: row;
92+
align-items: center;
9393
padding-left: 17px;
9494
padding-top: 13px;
9595
padding-bottom: 13px;
@@ -101,12 +101,13 @@
101101
}
102102

103103
.sectionItemTitle {
104-
align-self: flex-start;
105104
color: gray2;
105+
word-break: break-word;
106+
padding-right: 12px;
106107
}
107108

108109
.sectionItemBadge {
109-
align-self: flex-start;
110+
align-self: center;
110111
margin-left: auto;
111112
color: gray1;
112113

client/src/components/Header/style.module.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676

7777
.downArrow {
7878
margin-left: 15px;
79+
overflow: hidden;
7980
}
8081

8182
.menu {

client/src/pages/Search/Global.jsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,18 @@ export default function SearchGlobal({ keyword }) {
5858
const [windowWidth, setWindowWidth] = React.useState(window.innerWidth);
5959
const [orderBy, setOrderBy] = React.useState(config.DEFAULT_SORT_ORDER);
6060
const [totalPages, setTotalPages] = React.useState(0);
61+
const dropdownRef = React.useRef(null);
6162

6263
const prevOrderBy = usePrevious(orderBy);
6364

6465
const usersPerPage = config.ITEMS_PER_PAGE;
6566

6667
React.useEffect(() => {
6768
window.addEventListener("resize", updateWindowDimensions);
69+
window.addEventListener("click", onWholeContentClick);
6870
return () => {
6971
window.removeEventListener("resize", updateWindowDimensions);
72+
window.removeEventListener("click", onWholeContentClick);
7073
};
7174
});
7275

@@ -237,6 +240,7 @@ export default function SearchGlobal({ keyword }) {
237240
});
238241

239242
setUsers(data);
243+
setSortByDropdownShown(false);
240244
setTotalResults(Number(headers["x-total"]));
241245
setTotalPages(Number(headers["x-total-pages"]));
242246
}
@@ -256,6 +260,12 @@ export default function SearchGlobal({ keyword }) {
256260
setWindowWidth(window.innerWidth);
257261
};
258262

263+
const onWholeContentClick = (evt) => {
264+
if (dropdownRef.current && !dropdownRef.current.contains(evt.target)) {
265+
setSortByDropdownShown(false);
266+
}
267+
};
268+
259269
return (
260270
<>
261271
<div className={style.sideMenu}>
@@ -273,6 +283,7 @@ export default function SearchGlobal({ keyword }) {
273283
</div>
274284
<div
275285
className={style.sort}
286+
ref={dropdownRef}
276287
onClick={() => setSortByDropdownShown(!sortByDropdownShown)}
277288
style={{
278289
marginRight:
@@ -289,7 +300,7 @@ export default function SearchGlobal({ keyword }) {
289300
{getOrderByText(orderBy)}
290301
</span>
291302
)}
292-
<DownArrowIcon />
303+
<DownArrowIcon className={style.downArrow} />
293304
{sortByDropdownShown && (
294305
<ul className={style.dropdown}>
295306
<li

client/src/pages/Search/style.module.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@
5656
margin-bottom: 100px;
5757
}
5858

59+
.downArrow {
60+
overflow: hidden;
61+
}
62+
5963
.pills {
6064
margin: 15px -5px 0;
6165
}

0 commit comments

Comments
 (0)