Skip to content

Commit 6b1605b

Browse files
ref(ui): Improve spacing of index search (#7493)
Before ![clipboard.png](https://i.imgur.com/vSYamM9.png) After ![clipboard.png](https://i.imgur.com/Q0GiaLD.png)
1 parent 7f5f86a commit 6b1605b

File tree

4 files changed

+22
-19
lines changed

4 files changed

+22
-19
lines changed

src/components/docsbot.tsx renamed to src/components/docsBotButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import styled from '@emotion/styled';
33

44
import SentryDocsBot from 'sentry-docs/logos/chatbot.svg';
55

6-
export function DocsBot() {
6+
export function DocsBotButton() {
77
return (
88
<DocsBotLink
99
href="https://docsbot.ai/chat/skFEy0qDC01GrRrZ7Crs/EPqsd8nu2XmKzWnd45tL"

src/components/search.tsx

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import DOMPurify from 'dompurify';
1010
import {Link, navigate} from 'gatsby';
1111
import algoliaInsights from 'search-insights';
1212

13-
import {DocsBot} from 'sentry-docs/components/docsbot';
13+
import {DocsBotButton} from 'sentry-docs/components/docsBotButton';
1414
import {useOnClickOutside} from 'sentry-docs/utils';
1515

1616
import {useKeyboardNavigate} from './hooks/useKeyboardNavigate';
@@ -155,19 +155,21 @@ export function Search({path, autoFocus, platforms = []}: Props) {
155155
}, []);
156156

157157
return (
158-
<SearchBar ref={ref}>
159-
<input
160-
type="search"
161-
placeholder="Search"
162-
aria-label="Search"
163-
className="form-control search-input"
164-
value={query}
165-
onChange={({target: {value}}) => searchFor(value)}
166-
onFocus={() => setInputFocus(true)}
167-
ref={inputRef}
168-
/>
169-
<Separator>Feeling bold?</Separator>
170-
<DocsBot />
158+
<div ref={ref}>
159+
<SearchBar>
160+
<input
161+
type="search"
162+
placeholder="Search"
163+
aria-label="Search"
164+
className="form-control search-input"
165+
value={query}
166+
onChange={({target: {value}}) => searchFor(value)}
167+
onFocus={() => setInputFocus(true)}
168+
ref={inputRef}
169+
/>
170+
<Separator>Feeling bold?</Separator>
171+
<DocsBotButton />
172+
</SearchBar>
171173
{query.length >= 2 && inputFocus && (
172174
<div className="sgs-search-results">
173175
{loading && <Logo loading />}
@@ -261,16 +263,17 @@ export function Search({path, autoFocus, platforms = []}: Props) {
261263
)}
262264
</div>
263265
)}
264-
</SearchBar>
266+
</div>
265267
);
266268
}
267269

268270
const SearchBar = styled('div')`
269271
display: flex;
270272
flex-direction: row;
273+
align-items: center;
274+
gap: 1rem;
271275
`;
272276

273277
const Separator = styled('div')`
274-
margin: 6px 8px;
275278
white-space: nowrap;
276279
`;

src/css/_includes/index.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ div.footer-btns {
112112
.index-search {
113113
position: relative;
114114
max-width: 40rem;
115-
margin: 0 auto;
115+
margin: 3rem auto;
116116

117117
.sgs-search-results {
118118
width: 100%;

src/css/_includes/search.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
.sgs-search-results {
2121
position: absolute;
22-
margin-top: 3.5rem;
22+
margin-top: 1rem;
2323
z-index: 5;
2424
border: 0.25rem solid var(--sgs-color-border);
2525
border-radius: 0.5rem;

0 commit comments

Comments
 (0)