Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions modules/search/instant-search/components/gridicon/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ class Gridicon extends Component {
<path d="M10 19h4v-2h-4v2zm-4-6h12v-2H6v2zM3 5v2h18V5H3z" />
</g>
);
case 'gridicons-jetpack-search':
return (
<g>
<path d="M0 9.257C0 4.15 4.151 0 9.257 0c5.105 0 9.256 4.151 9.256 9.257a9.218 9.218 0 01-2.251 6.045l.034.033h1.053L24 22.01l-1.986 1.989-6.664-6.662v-1.055l-.033-.033a9.218 9.218 0 01-6.06 2.264C4.15 18.513 0 14.362 0 9.257zm4.169 1.537h4.61V1.82l-4.61 8.973zm5.547-3.092v8.974l4.61-8.974h-4.61z" />
</g>
);
}
}

Expand All @@ -159,10 +165,11 @@ class Gridicon extends Component {
<svg
className={ iconClass }
height={ size }
width={ size }
onClick={ this.props.onClick }
style={ { height: size, width: size } }
viewBox={ '0 0 ' + size + ' ' + size }
width={ size }
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
>
{ this.getSVGTitle( icon ) }
{ this.renderIcon( icon ) }
Expand Down
1 change: 1 addition & 0 deletions modules/search/instant-search/components/search-app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ class SearchApp extends Component {
query={ getSearchQuery() }
response={ this.state.response }
resultFormat={ getResultFormatQuery() }
showLogo={ this.state.overlayOptions.showLogo }
showPoweredBy={ this.state.overlayOptions.showPoweredBy }
widgets={ this.props.options.widgets }
/>
Expand Down
5 changes: 5 additions & 0 deletions modules/search/instant-search/components/search-box.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ const SearchBox = props => {
<label htmlFor={ inputId } className="screen-reader-text">
{ __( 'Site Search', 'jetpack' ) }
</label>
{ props.showLogo && (
<div className="jetpack-instant-search__box-gridicon">
<Gridicon icon="jetpack-search" size={ 28 } />
</div>
) }
<input
id={ inputId }
className="search-field jetpack-instant-search__box-input"
Expand Down
33 changes: 33 additions & 0 deletions modules/search/instant-search/components/search-box.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,39 @@
flex: 0 0 100%;
}

input.jetpack-instant-search__box-input.search-field,
.jetpack-instant-search__box-gridicon {
background: #fff;
border-radius: 5px;
border-style: solid;
border-width: 0.1rem;
color: black;
font-size: 1.6rem;
line-height: 1;
margin: 0;
padding: 1.3rem 1rem;
vertical-align: middle;
}

.jetpack-instant-search__box-gridicon {
background: lightgray;
border-bottom-right-radius: 0;
border-color: lightgray;
border-right: none;
border-top-right-radius: 0;
padding: 1rem 1.5rem;
}

input.jetpack-instant-search__box-input.search-field {
padding: 1.5rem 1.8rem;
}

.jetpack-instant-search__box-gridicon + input.jetpack-instant-search__box-input.search-field {
border-bottom-left-radius: 0;
border-top-left-radius: 0;
border-left: none;
}

.jetpack-instant-search__box-filter-icon {
margin: 0 16px;
cursor: pointer;
Expand Down
5 changes: 3 additions & 2 deletions modules/search/instant-search/components/search-form.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,10 @@ class SearchForm extends Component {
enableFilters
onChangeQuery={ this.onChangeQuery }
query={ getSearchQuery() }
widget={ this.props.widget }
toggleFilters={ this.toggleFilters }
showFilters={ this.state.showFilters }
showLogo={ this.props.showLogo }
toggleFilters={ this.toggleFilters }
widget={ this.props.widget }
/>
</div>
{ this.state.showFilters && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class SearchResults extends Component {
locale={ this.props.locale }
postTypes={ this.props.postTypes }
response={ this.props.response }
showLogo={ this.props.showLogo }
widgets={ this.props.widgets }
/>

Expand Down