Remove unnecessary imports
This commit is contained in:
parent
db61837457
commit
5aac05ae08
@ -1,4 +1,4 @@
|
|||||||
import React, {EventHandler, ReactElement, useEffect, useState} from 'react';
|
import React, {EventHandler, useEffect} from 'react';
|
||||||
import Footer from "./modules/Footer";
|
import Footer from "./modules/Footer";
|
||||||
import Search from "./modules/Search";
|
import Search from "./modules/Search";
|
||||||
import Header from "./modules/Header";
|
import Header from "./modules/Header";
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import React, {ChangeEventHandler, EventHandler, MouseEventHandler, useEffect, useState} from 'react';
|
import React, {ChangeEventHandler, EventHandler, useEffect, useState} from 'react';
|
||||||
import {MangaConnector} from "./MangaConnector";
|
import {MangaConnector} from "./MangaConnector";
|
||||||
import {Job} from "./Job";
|
|
||||||
import IMangaConnector from "./interfaces/IMangaConnector";
|
import IMangaConnector from "./interfaces/IMangaConnector";
|
||||||
import {isValidUri} from "../App";
|
import {isValidUri} from "../App";
|
||||||
import IManga, {SearchResult} from "./interfaces/IManga";
|
import IManga, {SearchResult} from "./interfaces/IManga";
|
||||||
@ -48,8 +47,7 @@ export default function Search({onJobsChanged, closeSearch} : {onJobsChanged: Ev
|
|||||||
return;
|
return;
|
||||||
let baseUri = match[1];
|
let baseUri = match[1];
|
||||||
const selectCon = mangaConnectors.find((con: IMangaConnector) => {
|
const selectCon = mangaConnectors.find((con: IMangaConnector) => {
|
||||||
let found = con.BaseUris.find(uri => uri == baseUri);
|
return con.BaseUris.find(uri => uri == baseUri);
|
||||||
return found;
|
|
||||||
});
|
});
|
||||||
if(selectCon != undefined){
|
if(selectCon != undefined){
|
||||||
setSelectedConnector(selectCon);
|
setSelectedConnector(selectCon);
|
||||||
@ -58,6 +56,7 @@ export default function Search({onJobsChanged, closeSearch} : {onJobsChanged: Ev
|
|||||||
}
|
}
|
||||||
|
|
||||||
const ExecuteSearch : EventHandler<any> = (event) => {
|
const ExecuteSearch : EventHandler<any> = (event) => {
|
||||||
|
event.preventDefault();
|
||||||
if(searchBoxValue.length < 1 || selectedConnector === undefined || selectedLanguage === ""){
|
if(searchBoxValue.length < 1 || selectedConnector === undefined || selectedLanguage === ""){
|
||||||
console.error("Tried initiating search while not all fields where submitted.")
|
console.error("Tried initiating search while not all fields where submitted.")
|
||||||
return;
|
return;
|
||||||
@ -105,7 +104,7 @@ export default function Search({onJobsChanged, closeSearch} : {onJobsChanged: Ev
|
|||||||
</select>
|
</select>
|
||||||
<button id="Searchbox-button" type="submit" onClick={ExecuteSearch}>Search</button>
|
<button id="Searchbox-button" type="submit" onClick={ExecuteSearch}>Search</button>
|
||||||
</div>
|
</div>
|
||||||
<img id="closeSearch" src="../media/close-x.svg" onClick={closeSearch} />
|
<img alt="Close Search" id="closeSearch" src="../media/close-x.svg" onClick={closeSearch} />
|
||||||
<div id="SearchResults">
|
<div id="SearchResults">
|
||||||
{searchResults === undefined
|
{searchResults === undefined
|
||||||
? <p></p>
|
? <p></p>
|
||||||
|
Loading…
Reference in New Issue
Block a user