aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2022-05-16 11:01:58 -0500
committerJP Dillingham <jp@dillingham.me>2022-05-16 11:01:58 -0500
commit26dae3076a0d61705e3653b44d92dc3f31b6a250 (patch)
tree09befd611067aefe4bb9712a651ef88dcaec2c9b /src
parent3ee2c0b442660f13f36beae095eff2beb059cec9 (diff)
downloadslskd-26dae3076a0d61705e3653b44d92dc3f31b6a250.tar.gz
wip
Diffstat (limited to 'src')
-rw-r--r--src/web/src/components/Search/Detail/SearchDetail.js24
-rw-r--r--src/web/src/components/Search/Detail/SearchDetailHeader.js35
2 files changed, 37 insertions, 22 deletions
diff --git a/src/web/src/components/Search/Detail/SearchDetail.js b/src/web/src/components/Search/Detail/SearchDetail.js
index 31d2616e..810ac897 100644
--- a/src/web/src/components/Search/Detail/SearchDetail.js
+++ b/src/web/src/components/Search/Detail/SearchDetail.js
@@ -13,6 +13,7 @@ import ErrorSegment from '../../Shared/ErrorSegment';
import Response from '../Response';
import { getResponses, parseFiltersFromString, filterResponse } from '../../../lib/searches';
import LoaderSegment from '../../Shared/LoaderSegment';
+import SearchDetailHeader from './SearchDetailHeader';
const sortDropdownOptions = [
{ key: 'uploadSpeed', text: 'Upload Speed (Fastest to Slowest)', value: 'uploadSpeed' },
@@ -106,28 +107,7 @@ const SearchDetail = ({ search, onStop, onBack }) => {
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={isComplete ? 'arrow left' : 'stop circle'}
- onClick={() => {
- if (isComplete) {
- onBack();
- } else {
- onStop(search);
- }
- }}
- />
- </Segment>
+ <SearchDetailHeader search={search} onStop={onStop} onBack={onBack}/>
{(results && results.length > 0) &&
<Segment className='search-options' raised>
<Dropdown
diff --git a/src/web/src/components/Search/Detail/SearchDetailHeader.js b/src/web/src/components/Search/Detail/SearchDetailHeader.js
new file mode 100644
index 00000000..c1613721
--- /dev/null
+++ b/src/web/src/components/Search/Detail/SearchDetailHeader.js
@@ -0,0 +1,35 @@
+import React from 'react';
+
+import {
+ Segment,
+ Button,
+} from 'semantic-ui-react';
+
+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>
+ )
+};
+
+export default SearchDetailHeader; \ No newline at end of file