From 05edb7c7a7549ecf9f58428c604ac6b39139a136 Mon Sep 17 00:00:00 2001
From: martylukyy <35452459+martylukyy@users.noreply.github.com>
Date: Tue, 17 Jan 2023 23:43:49 +0100
Subject: [PATCH] enhancement(web): make settings pages uniform for desktop and
mobile (#634)
* enhancement(web): make settings pages uniform for desktop and mobile
removed var 'idx' from line 17:51 since it is defined but never used
converted the indexer table in to a responsive grid
* fix missing col-span adjustment for mobile
Co-authored-by: ze0s <43699394+zze0s@users.noreply.github.com>
---
web/src/screens/settings/Api.tsx | 90 +++++++----
web/src/screens/settings/DownloadClient.tsx | 28 ++--
web/src/screens/settings/Feed.tsx | 20 ++-
web/src/screens/settings/Indexer.tsx | 164 ++++++++++----------
web/src/screens/settings/Notifications.tsx | 20 ++-
5 files changed, 169 insertions(+), 153 deletions(-)
diff --git a/web/src/screens/settings/Api.tsx b/web/src/screens/settings/Api.tsx
index f659e05..db4f4ee 100644
--- a/web/src/screens/settings/Api.tsx
+++ b/web/src/screens/settings/Api.tsx
@@ -15,24 +15,22 @@ import { EmptySimple } from "../../components/emptystates";
function APISettings() {
const [addFormIsOpen, toggleAddForm] = useToggle(false);
- const { data } = useQuery(
- ["apikeys"],
- () => APIClient.apikeys.getAll(),
- {
- retry: false,
- refetchOnWindowFocus: false,
- onError: err => console.log(err)
- }
- );
+ const { data } = useQuery(["apikeys"], () => APIClient.apikeys.getAll(), {
+ retry: false,
+ refetchOnWindowFocus: false,
+ onError: (err) => console.log(err)
+ });
return (
-
+
-
API keys
+
+ API keys
+
Manage API keys.
@@ -48,32 +46,36 @@ function APISettings() {
- {data && data.length > 0 ?
+ {data && data.length > 0 ? (
- -
-
Name
+
-
+
+ Name
- Key
+
+ Key
- {data && data.map((k) => (
-
- ))}
+ {data && data.map((k) => )}
- : }
+ ) : (
+
+ )}
);
}
interface ApiKeyItemProps {
- apikey: APIKey
+ apikey: APIKey;
}
function APIListItem({ apikey }: ApiKeyItemProps) {
@@ -87,7 +89,13 @@ function APIListItem({ apikey }: ApiKeyItemProps) {
queryClient.invalidateQueries(["apikeys"]);
queryClient.invalidateQueries(["apikeys", apikey.key]);
- toast.custom((t) => );
+ toast.custom((t) => (
+
+ ));
}
}
);
@@ -106,15 +114,32 @@ function APIListItem({ apikey }: ApiKeyItemProps) {
text="Are you sure you want to remove this API key? This action cannot be undone."
/>
-
-
- {apikey.name}
+
+
+
+
{apikey.name}
+
+
+
+
-
+
-
@@ -134,4 +156,4 @@ function APIListItem({ apikey }: ApiKeyItemProps) {
);
}
-export default APISettings;
\ No newline at end of file
+export default APISettings;
diff --git a/web/src/screens/settings/DownloadClient.tsx b/web/src/screens/settings/DownloadClient.tsx
index ea08219..7f89d38 100644
--- a/web/src/screens/settings/DownloadClient.tsx
+++ b/web/src/screens/settings/DownloadClient.tsx
@@ -14,7 +14,7 @@ interface DLSettingsItemProps {
idx: number;
}
-function DownloadClientSettingsListItem({ client, idx }: DLSettingsItemProps) {
+function DownloadClientSettingsListItem({ client }: DLSettingsItemProps) {
const [updateClientIsOpen, toggleUpdateClient] = useToggle(false);
const queryClient = useQueryClient();
@@ -37,13 +37,13 @@ function DownloadClientSettingsListItem({ client, idx }: DLSettingsItemProps) {
return (
-
-
+
-
+
-
{client.name}
-
{client.host}
-
{DownloadClientTypeNameMap[client.type]}
-
+
{client.name}
+
{client.host}
+
{DownloadClientTypeNameMap[client.type]}
+
Edit
@@ -104,7 +104,7 @@ function DownloadClientSettings() {