From daa05a0b4d77a7b8c788565c05a9e08e734a725f Mon Sep 17 00:00:00 2001 From: glax Date: Sat, 19 Oct 2024 16:28:49 +0200 Subject: [PATCH] Added button to open Search-dialog --- Website/App.tsx | 10 ++++++++-- Website/modules/MonitorJobsList.tsx | 19 ++++++++++++++++--- Website/modules/interfaces/IManga.tsx | 2 +- Website/styles/Manga.css | 12 ++++++++++-- 4 files changed, 35 insertions(+), 8 deletions(-) diff --git a/Website/App.tsx b/Website/App.tsx index 07c7658..63af7b5 100644 --- a/Website/App.tsx +++ b/Website/App.tsx @@ -8,6 +8,13 @@ import './styles/Manga.css' export default function App(){ const [content, setContent] = React.useState(); + function ShowSearch() { + setContent(<> + + + ); + } + useEffect(() => { setContent(

Testing connection to backend...

) getData('http://127.0.0.1:6531/v2/Ping').then((result) => { @@ -16,8 +23,7 @@ export default function App(){ setContent(

No connection to backend

); }else{ setContent(<> - - + ) } }) diff --git a/Website/modules/MonitorJobsList.tsx b/Website/modules/MonitorJobsList.tsx index 046c5f2..0f4cf04 100644 --- a/Website/modules/MonitorJobsList.tsx +++ b/Website/modules/MonitorJobsList.tsx @@ -1,11 +1,11 @@ -import React, {MouseEventHandler, useEffect} from 'react'; +import React, {MouseEventHandler, ReactElement, useEffect} from 'react'; import {Job} from './Job'; import '../styles/monitorMangaList.css'; import IJob from "./interfaces/IJob"; import IManga, {HTMLFromIManga} from "./interfaces/IManga"; import {Manga} from './Manga'; -export default function MonitorJobsList(){ +export default function MonitorJobsList({onStartSearch} : {onStartSearch() : void}){ const [MonitoringJobs, setMonitoringJobs] = React.useState([]); const [AllManga, setAllManga] = React.useState([]); @@ -41,11 +41,24 @@ export default function MonitorJobsList(){ Job.DeleteJob(jobId); } + function StartSearchMangaEntry() : ReactElement { + return (
+
+ +
+

Add new Manga

+

+

+
+
+
); + } + return (
+ {StartSearchMangaEntry()} {AllManga.map((manga: IManga) => { const job = MonitoringJobs.find(job => job.mangaInternalId == manga.internalId); - if(job === undefined || job == null) + if (job === undefined || job == null) return
Error. Could not find matching job for {manga.internalId}
return
{HTMLFromIManga(manga)} diff --git a/Website/modules/interfaces/IManga.tsx b/Website/modules/interfaces/IManga.tsx index 531469c..d6acebf 100644 --- a/Website/modules/interfaces/IManga.tsx +++ b/Website/modules/interfaces/IManga.tsx @@ -41,9 +41,9 @@ export function HTMLFromIManga(manga: IManga) : ReactElement {
-

{manga.sortName}

{manga.mangaConnector.name}

+

{manga.sortName}

); } \ No newline at end of file diff --git a/Website/styles/Manga.css b/Website/styles/Manga.css index e40df3e..bdbe35e 100644 --- a/Website/styles/Manga.css +++ b/Website/styles/Manga.css @@ -17,7 +17,7 @@ height: 300px; border-radius: 5px; margin: 10px 10px; - padding: 15px 19px; + padding: 14px 20px; position: relative; flex-shrink: 0; } @@ -113,7 +113,15 @@ z-index: 0; } +.Manga p { + margin: 2px 0; +} + .Manga > div { - position: absolute; + position: relative; z-index: 1; + width: 100%; + height: 100%; + left: 0; + top: 0; } \ No newline at end of file