diff --git a/src/components/SearchBox/SearchBox.tsx b/src/components/SearchBox/SearchBox.tsx
index ab4557fce8..eaa654f3e8 100644
--- a/src/components/SearchBox/SearchBox.tsx
+++ b/src/components/SearchBox/SearchBox.tsx
@@ -1,81 +1,13 @@
import * as React from 'react';
-import styled from '../../styled-components';
-
import { IMenuItem } from '../../services/MenuStore';
import { SearchStore } from '../../services/SearchStore';
import { MenuItem } from '../SideMenu/MenuItem';
-import { MenuItemLabel } from '../SideMenu/styled.elements';
+
import { MarkerService } from '../../services/MarkerService';
import { SearchDocument } from '../../services/SearchWorker.worker';
-const SearchInput = styled.input.attrs({
- className: 'search-input',
-})`
- width: calc(100% - ${props => props.theme.spacingUnit * 2}px);
- box-sizing: border-box;
- margin: 0 ${props => props.theme.spacingUnit}px;
- padding: 5px 0 5px ${props => props.theme.spacingUnit}px;
- border: 0;
- border-bottom: 1px solid #e1e1e1;
- font-weight: bold;
- font-size: 13px;
- color: ${props => props.theme.colors.text};
- background-color: transparent;
- outline: none;
-`;
-
-const SearchIcon = styled((props: any) => (
-
-)).attrs({
- className: 'search-icon',
-})`
- position: absolute;
- left: ${props => props.theme.spacingUnit}px;
- height: 1.8em;
- width: 0.9em;
-
- path {
- fill: ${props => props.theme.colors.text};
- }
-`;
-
-const SearchResultsBox = styled.div.attrs({
- className: 'search-results',
-})`
- padding: ${props => props.theme.spacingUnit / 4}px 0;
- background-color: #ededed;
- min-height: 150px;
- max-height: 250px;
- border-top: 1px solid #e1e1e1;
- border-bottom: 1px solid #e1e1e1;
- margin-top: 10px;
- line-height: 1.4;
- font-size: 0.9em;
- overflow: auto;
-
- ${MenuItemLabel} {
- padding-top: 6px;
- padding-bottom: 6px;
-
- &:hover {
- background-color: #e1e1e1;
- }
-
- > svg {
- display: none;
- }
- }
-`;
+import { ClearIcon, SearchIcon, SearchInput, SearchResultsBox } from './elements';
export interface SearchBoxProps {
search: SearchStore;
@@ -113,13 +45,13 @@ export class SearchBox extends React.PureComponent {
this.setState({
results: [],
term: '',
});
this.props.marker.unmark();
- }
+ };
clearIfEsq = event => {
if (event && event.keyCode === 27) {
@@ -163,6 +95,7 @@ export class SearchBox extends React.PureComponent
+ {this.state.term && ×}
props.theme.spacingUnit * 2}px);
+ box-sizing: border-box;
+ margin: 0 ${props => props.theme.spacingUnit}px;
+ padding: 5px ${props => props.theme.spacingUnit / 2}px 5px ${props => props.theme.spacingUnit}px;
+ border: 0;
+ border-bottom: 1px solid #e1e1e1;
+ font-weight: bold;
+ font-size: 13px;
+ color: ${props => props.theme.colors.text};
+ background-color: transparent;
+ outline: none;
+`;
+
+export const SearchIcon = styled((props: any) => (
+
+)).attrs({
+ className: 'search-icon',
+})`
+ position: absolute;
+ left: ${props => props.theme.spacingUnit}px;
+ height: 1.8em;
+ width: 0.9em;
+
+ path {
+ fill: ${props => props.theme.colors.text};
+ }
+`;
+
+export const SearchResultsBox = styled.div.attrs({
+ className: 'search-results',
+})`
+ padding: ${props => props.theme.spacingUnit / 4}px 0;
+ background-color: #ededed;
+ min-height: 150px;
+ max-height: 250px;
+ border-top: 1px solid #e1e1e1;
+ border-bottom: 1px solid #e1e1e1;
+ margin-top: 10px;
+ line-height: 1.4;
+ font-size: 0.9em;
+ overflow: auto;
+
+ ${MenuItemLabel} {
+ padding-top: 6px;
+ padding-bottom: 6px;
+
+ &:hover {
+ background-color: #e1e1e1;
+ }
+
+ > svg {
+ display: none;
+ }
+ }
+`;
+
+export const ClearIcon = styled.i`
+ position: absolute;
+ display: inline-block;
+ width: ${props => props.theme.spacingUnit / 2}px;
+ text-align: center;
+ right: ${props => props.theme.spacingUnit}px;
+ line-height: 2em;
+ vertical-align: middle;
+ margin-right: 2px;
+ cursor: pointer;
+ font-style: normal;
+ color: '#666';
+`;