Skip to content

Commit

Permalink
Add a separate button to the "What to search" input
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmz committed Oct 30, 2024
1 parent cb7acfc commit 35db1a3
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 8 deletions.
27 changes: 19 additions & 8 deletions src/components/advanced-search-form/advanced-search-form.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import cn from 'classnames';
import { browserHistory } from 'react-router';
import { useEffect, useMemo, useReducer, useState } from 'react';
import { useEvent } from 'react-use-event-hook';
Expand Down Expand Up @@ -81,13 +82,23 @@ export function AdvancedSearchForm() {
<filtersContext.Provider value={ctxValue}>
<div className={style.form}>
<Section title="What to search">
<input
type="search"
name="q"
{...queryAttrs}
className="form-control"
placeholder="Text to search"
/>
<div className={style.searchInputBox}>
<input
type="search"
name="q"
{...queryAttrs}
className="form-control"
placeholder="Text to search"
/>
<button
type="button"
disabled={resultingQuery === ''}
className={cn('btn btn-primary')}
onClick={onSearch}
>
Search
</button>
</div>
<div className={style.searchScopes}>
Search for:
<label>
Expand Down Expand Up @@ -199,7 +210,7 @@ export function AdvancedSearchForm() {
<button
type="button"
disabled={resultingQuery === ''}
className="btn btn-primary col-sm-4 col-xs-12"
className={cn('btn btn-primary', style.bigSearchButton)}
onClick={onSearch}
>
Search
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,20 @@
margin-bottom: 0.5em;
}

.searchInputBox {
display: flex;
gap: 0.3em;

button {
padding-inline: 2em;
display: none;

@media (min-width: 768px) {
display: block;
}
}
}

.searchScopes {
margin-top: 0.5em;
display: flex;
Expand Down Expand Up @@ -148,3 +162,12 @@
.textInputChosen {
color: var(--text-color) !important;
}

.bigSearchButton {
width: 100%;

@media (min-width: 768px) {
// Width of one column of the form
width: calc(50% - 1em);
}
}

0 comments on commit 35db1a3

Please sign in to comment.