From 429becec7c93322660d1897c8f7ee9bc012071dd Mon Sep 17 00:00:00 2001 From: Rafael Bradley <84998222+Nekidev@users.noreply.github.com> Date: Fri, 26 Jan 2024 02:46:23 -0300 Subject: [PATCH] update(app): Add support for OAuth2 login (with AniList support) --- .../src/components/CreateListModal/index.tsx | 2 +- .../src/components/EditListModal/index.tsx | 2 +- .../src/components/FormModal/index.tsx | 2 +- .../components/LibraryEntryModal/index.tsx | 6 +- .../src/components/ReviewModal/index.tsx | 2 +- .../SettingsModal/tabs/connections.tsx | 176 +++++++++++++----- src/app/renderer/src/lib/crypto.ts | 17 ++ src/app/renderer/src/lib/db/types.ts | 23 +++ .../src/lib/messages/translations/en-US.ts | 9 +- .../src/lib/providers/anilist/index.tsx | 59 +++++- .../{update-review.js => SaveReview.js} | 0 .../lib/providers/anilist/queries/Viewer.js | 10 + .../lib/providers/anilist/queries/library.js | 1 + src/app/renderer/src/lib/providers/base.ts | 9 +- src/app/renderer/src/lib/providers/index.ts | 4 + .../src/lib/providers/myanimelist/config.ts | 2 +- .../src/lib/providers/myanimelist/index.tsx | 1 + 17 files changed, 255 insertions(+), 70 deletions(-) create mode 100644 src/app/renderer/src/lib/crypto.ts rename src/app/renderer/src/lib/providers/anilist/queries/{update-review.js => SaveReview.js} (100%) create mode 100644 src/app/renderer/src/lib/providers/anilist/queries/Viewer.js diff --git a/src/app/renderer/src/components/CreateListModal/index.tsx b/src/app/renderer/src/components/CreateListModal/index.tsx index 10a924d..30c8f15 100644 --- a/src/app/renderer/src/components/CreateListModal/index.tsx +++ b/src/app/renderer/src/components/CreateListModal/index.tsx @@ -58,7 +58,7 @@ export default function CreateListModal({ className="w-full border border-zinc-900 rounded bg-zinc-900 p-2 leading-none outline-none placeholder:text-zinc-400 focus:border-zinc-100 transition" placeholder="Name" value={name} - autoComplete="none" + autoComplete="off" onChange={(e) => { setName(e.target.value); }} diff --git a/src/app/renderer/src/components/EditListModal/index.tsx b/src/app/renderer/src/components/EditListModal/index.tsx index ed6b01c..45c1769 100644 --- a/src/app/renderer/src/components/EditListModal/index.tsx +++ b/src/app/renderer/src/components/EditListModal/index.tsx @@ -69,7 +69,7 @@ export default function EditListModal({ type="text" className="w-full border border-zinc-900 rounded bg-zinc-900 p-2 leading-none outline-none placeholder:text-zinc-400 focus:border-zinc-100 transition" placeholder="Name" - autoComplete="none" + autoComplete="off" value={name} onChange={(e) => { setName(e.target.value); diff --git a/src/app/renderer/src/components/FormModal/index.tsx b/src/app/renderer/src/components/FormModal/index.tsx index b4b700a..54c3907 100644 --- a/src/app/renderer/src/components/FormModal/index.tsx +++ b/src/app/renderer/src/components/FormModal/index.tsx @@ -168,7 +168,7 @@ function FormModalContent(props: FormModalProps) { ); }} className="leading-none p-2 rounded bg-zinc-900 w-full border border-zinc-900 focus:border-zinc-100 transition placeholder:text-zinc-400" - autoComplete="none" + autoComplete="off" /> ); diff --git a/src/app/renderer/src/components/LibraryEntryModal/index.tsx b/src/app/renderer/src/components/LibraryEntryModal/index.tsx index 0d08d32..d42ffa7 100644 --- a/src/app/renderer/src/components/LibraryEntryModal/index.tsx +++ b/src/app/renderer/src/components/LibraryEntryModal/index.tsx @@ -565,7 +565,7 @@ function NumberInput({ ...props }: { [key: string]: any }) {
{ setValue(e.target.value); @@ -626,7 +626,7 @@ function DateInput({ ...props }: { [key: string]: any }) {
@@ -639,7 +639,7 @@ function TextArea({ ...props }: { [key: string]: any }) { return (