diff options
| author | JP Dillingham <jp@dillingham.me> | 2022-05-09 08:15:05 -0500 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2022-05-09 08:15:05 -0500 |
| commit | 139a9bf00b07c52556155c0f3c450751cfbbbb33 (patch) | |
| tree | 958f32487c05bdc2f33056c391a11906559ab094 /src/web | |
| parent | 16f188e8f2a0976334cf22eb31d4e7ae79be92ea (diff) | |
| download | slskd-139a9bf00b07c52556155c0f3c450751cfbbbb33.tar.gz | |
tidy up
Diffstat (limited to 'src/web')
| -rw-r--r-- | src/web/src/components/Search/Searches.js | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/web/src/components/Search/Searches.js b/src/web/src/components/Search/Searches.js index 272282aa..e707f3d0 100644 --- a/src/web/src/components/Search/Searches.js +++ b/src/web/src/components/Search/Searches.js @@ -1,14 +1,6 @@ import React, { useState, useEffect, useRef } from 'react'; -import { - BrowserRouter as Router, - Switch, - Route, - Link, - useParams -} from "react-router-dom"; import { v4 as uuidv4 } from 'uuid'; - import * as lib from '../../lib/searches'; import { createSearchHubConnection } from '../../lib/hubFactory'; @@ -19,6 +11,7 @@ import './Search.css'; import { Input, Segment, + Button, } from 'semantic-ui-react'; const Searches = () => { @@ -26,7 +19,6 @@ const Searches = () => { const [{ creating, createError }, setCreating] = useState({ creating: false, createError: false }); const [error, setError] = useState(undefined); const [searches, setSearches] = useState({}); - const params = useParams(); const inputRef = useRef(); const onConnecting = () => setConnected({ connected: false, connecting: true, connectError: false }) @@ -62,6 +54,8 @@ const Searches = () => { }); }); + searchHub.on('create', () => {}); + searchHub.onreconnecting((error) => onConnectionError(error?.message ?? 'Disconnected')); searchHub.onreconnected(() => onConnected()); searchHub.onclose((error) => onConnectionError(error?.message ?? 'Disconnected')); @@ -123,7 +117,10 @@ const Searches = () => { disabled={creating} className='search-input' placeholder="Search phrase" - action={{ icon: 'search', onClick: create }} + action={<> + <Button icon='plus' onClick={create}/> + <Button icon='search' onClick={create}/> + </>} onKeyUp={(e) => e.key === 'Enter' ? create() : ''} /> </Segment> |
