Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a360c67

Browse files
committedJul 24, 2020
Merge branch 'develop' into issues/timor/281
2 parents c88c6c6 + 3cb621c commit a360c67

File tree

4 files changed

+21
-9
lines changed

4 files changed

+21
-9
lines changed
 

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

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
/* importing colors */
22
@value colors: "../../styles/colors.module.css";
3-
@value gray1,
4-
gray2,
5-
gray1_025,
6-
white,
7-
blue from colors;
3+
@value gray1, gray2, gray1_025, white, blue from colors;
84

95
/* Group Tab filters (lett col) styles */
106
.groupTabFilters {
@@ -93,6 +89,7 @@ blue from colors;
9389

9490
display: flex;
9591
flex-direction: row;
92+
align-items: center;
9693
padding-left: 17px;
9794
padding-top: 13px;
9895
padding-bottom: 13px;
@@ -104,14 +101,13 @@ blue from colors;
104101
}
105102

106103
.sectionItemTitle {
107-
align-self: flex-start;
104+
color: gray2;
108105
word-break: break-word;
109106
padding-right: 12px;
110-
color: gray2;
111107
}
112108

113109
.sectionItemBadge {
114-
align-self: flex-start;
110+
align-self: center;
115111
margin-left: auto;
116112
color: gray1;
117113

‎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)
This repository has been archived.