diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/web/src/components/Search/Detail/SearchDetailHeader.js | 50 | ||||
| -rw-r--r-- | src/web/src/components/Search/Search.css | 11 |
2 files changed, 39 insertions, 22 deletions
diff --git a/src/web/src/components/Search/Detail/SearchDetailHeader.js b/src/web/src/components/Search/Detail/SearchDetailHeader.js index c1613721..0768d963 100644 --- a/src/web/src/components/Search/Detail/SearchDetailHeader.js +++ b/src/web/src/components/Search/Detail/SearchDetailHeader.js @@ -3,32 +3,38 @@ import React from 'react'; import { Segment, Button, + Header, + Icon, } from 'semantic-ui-react'; +import SearchStatusIcon from '../SearchStatusIcon'; + +const SearchDetailHeader = ({ search, loading, onStop, onRemove }) => { + const { searchText, isComplete, state } = search; + + const stopOrRemove = () => { + if (isComplete) { + onRemove(search); + } else { + onStop(search); + } + } -const SearchDetailHeader = ({ search, onBack, onStop }) => { return ( <Segment className='search-segment' raised> - {/* <Input - input={<input placeholder="Search phrase" type="search" data-lpignore="true"></input>} - size='big' - ref={searchRef} - disabled={true} - className='search-input' - placeholder="Search phrase" - action={<Button icon='x' color='red' onClick={() => history.push(`/searches`)}/>} - /> */} - <Button - negative - icon={search?.isComplete ? 'arrow left' : 'stop circle'} - onClick={() => { - if (search?.isComplete) { - onBack(); - } else { - onStop(search); - } - }} - /> - </Segment> + <Header className='search-detail-header'> + <SearchStatusIcon state={state}/> + {searchText} + </Header> + <Button + className='search-detail-action-button' + negative + disabled={loading} + onClick={stopOrRemove} + > + <Icon name={isComplete ? 'trash alternate' : 'stop circle'}/> + {isComplete ? 'Delete' : 'Stop'} Search + </Button> + </Segment> ) }; diff --git a/src/web/src/components/Search/Search.css b/src/web/src/components/Search/Search.css index 10d7c15f..d4010bc0 100644 --- a/src/web/src/components/Search/Search.css +++ b/src/web/src/components/Search/Search.css @@ -97,4 +97,15 @@ .search-list-action { width: 5px !important; +} + +.search-detail-header { + font-weight: normal !important; + margin-top: 13px !important; + margin-left: 16px !important; +} + +.search-detail-action-button { + float: right; + margin-top: -48px !important; }
\ No newline at end of file |
