Skip to content

Commit 6c466cd

Browse files
authored
Merge pull request #3149 from PiyushChandra17/piyush/Fix-search-box-overlay-mobile
Fix searchbox fit overlays on mobile
2 parents df50578 + 256fb24 commit 6c466cd

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

Diff for: client/modules/App/components/Overlay.jsx

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import PropTypes from 'prop-types';
22
import React, { useCallback, useRef } from 'react';
3+
import MediaQuery from 'react-responsive';
34
import { useSelector } from 'react-redux';
45
import { useHistory } from 'react-router-dom';
56
import { useTranslation } from 'react-i18next';
@@ -54,7 +55,7 @@ const Overlay = ({
5455
<header className="overlay__header">
5556
<h2 className="overlay__title">{title}</h2>
5657
<div className="overlay__actions">
57-
{actions}
58+
<MediaQuery minWidth={770}>{actions}</MediaQuery>
5859
<button
5960
className="overlay__close-button"
6061
onClick={close}
@@ -64,6 +65,11 @@ const Overlay = ({
6465
</button>
6566
</div>
6667
</header>
68+
<MediaQuery maxWidth={769}>
69+
{actions && (
70+
<div className="overlay__actions-mobile">{actions}</div>
71+
)}
72+
</MediaQuery>
6773
{children}
6874
</section>
6975
</div>

Diff for: client/styles/components/_overlay.scss

+4
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@
5151
display: flex;
5252
}
5353

54+
.overlay__actions-mobile {
55+
padding-left: #{24/ $base-font-size}rem;
56+
}
57+
5458
.overlay__title {
5559
font-size: #{math.div(21, $base-font-size)}rem;
5660
}

0 commit comments

Comments
 (0)