From f6ec418cef601602115838b96d19ae23faabbeb1 Mon Sep 17 00:00:00 2001 From: Daniel Helm Date: Mon, 31 Jan 2022 10:22:20 -0600 Subject: [PATCH 1/5] fix login link url --- packages/website/src/components/Navigation/Navigation.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/website/src/components/Navigation/Navigation.js b/packages/website/src/components/Navigation/Navigation.js index ab96ab2a..2134a288 100644 --- a/packages/website/src/components/Navigation/Navigation.js +++ b/packages/website/src/components/Navigation/Navigation.js @@ -90,11 +90,11 @@ const Navigation = ({ mode, uri }) => { {showLoginNavigation && ( <> - + Log in - + Sign up @@ -144,11 +144,11 @@ const Navigation = ({ mode, uri }) => {
{showLoginNavigation && ( <> - + Log in - + Sign up From 75e7844c9da338dd6d5f7d35a0b4da06ae30a3b7 Mon Sep 17 00:00:00 2001 From: Daniel Helm Date: Mon, 31 Jan 2022 10:41:11 -0600 Subject: [PATCH 2/5] fix uploader widget links --- packages/website/src/components/Uploader/Uploader.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/website/src/components/Uploader/Uploader.js b/packages/website/src/components/Uploader/Uploader.js index 0384bf67..a4fc48f2 100644 --- a/packages/website/src/components/Uploader/Uploader.js +++ b/packages/website/src/components/Uploader/Uploader.js @@ -26,7 +26,7 @@ const RegistrationLink = () => { return ( Sign up @@ -39,7 +39,7 @@ const LogInLink = () => { return ( Log in From e2dfc8a36fb9dbedde052d8bf2d8c7cbad81ebbd Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Wed, 2 Feb 2022 19:05:30 +0100 Subject: [PATCH 3/5] return url factory function for useAccountsUrl --- packages/website/src/components/Navigation/Navigation.js | 6 +++--- packages/website/src/components/Uploader/Uploader.js | 8 ++++---- packages/website/src/services/useAccountsUrl.js | 3 ++- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/packages/website/src/components/Navigation/Navigation.js b/packages/website/src/components/Navigation/Navigation.js index 2134a288..0361245d 100644 --- a/packages/website/src/components/Navigation/Navigation.js +++ b/packages/website/src/components/Navigation/Navigation.js @@ -26,7 +26,7 @@ const Navigation = ({ mode, uri }) => { const windowSize = useWindowSize(); const isWindowTop = useWindowTop(); const { data: accounts } = useAccounts(); - const accountsUrl = useAccountsUrl(); + const createAccountsUrl = useAccountsUrl(); React.useEffect(() => { setOpen(false); @@ -90,11 +90,11 @@ const Navigation = ({ mode, uri }) => { {showLoginNavigation && ( <> - + Log in - + Sign up diff --git a/packages/website/src/components/Uploader/Uploader.js b/packages/website/src/components/Uploader/Uploader.js index a4fc48f2..5772bca9 100644 --- a/packages/website/src/components/Uploader/Uploader.js +++ b/packages/website/src/components/Uploader/Uploader.js @@ -22,11 +22,11 @@ const getRootDirectory = (file) => { }; const RegistrationLink = () => { - const accountsUrl = useAccountsUrl(); + const createAccountsUrl = useAccountsUrl(); return ( Sign up @@ -35,11 +35,11 @@ const RegistrationLink = () => { }; const LogInLink = () => { - const accountsUrl = useAccountsUrl(); + const createAccountsUrl = useAccountsUrl(); return ( Log in diff --git a/packages/website/src/services/useAccountsUrl.js b/packages/website/src/services/useAccountsUrl.js index 3f8832f6..ac537688 100644 --- a/packages/website/src/services/useAccountsUrl.js +++ b/packages/website/src/services/useAccountsUrl.js @@ -3,6 +3,7 @@ import skynetClient from "./skynetClient"; export default function useAccountsUrl() { const [url, setUrl] = React.useState(""); + const createAccountsUrl = React.useCallback((path = "") => new URL(path, url).toString(), [url]); React.useEffect(() => { (async function resolve() { @@ -14,5 +15,5 @@ export default function useAccountsUrl() { })(); }, [setUrl]); - return url; + return createAccountsUrl; } From ad86704ac496efa5e7e93223ffbf7cf58ce79444 Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Wed, 2 Feb 2022 19:22:09 +0100 Subject: [PATCH 4/5] ensure url is set before passing to URL constructor --- packages/website/src/services/useAccountsUrl.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/website/src/services/useAccountsUrl.js b/packages/website/src/services/useAccountsUrl.js index ac537688..ec3ed3e3 100644 --- a/packages/website/src/services/useAccountsUrl.js +++ b/packages/website/src/services/useAccountsUrl.js @@ -3,7 +3,7 @@ import skynetClient from "./skynetClient"; export default function useAccountsUrl() { const [url, setUrl] = React.useState(""); - const createAccountsUrl = React.useCallback((path = "") => new URL(path, url).toString(), [url]); + const createAccountsUrl = React.useCallback((path = "") => url && new URL(path, url).toString(), [url]); React.useEffect(() => { (async function resolve() { From b1653e11162bafe2e085a68fe09e7e5aaa1c32ed Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Wed, 2 Feb 2022 19:32:29 +0100 Subject: [PATCH 5/5] fix missing account url usages --- packages/website/src/components/Navigation/Navigation.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/website/src/components/Navigation/Navigation.js b/packages/website/src/components/Navigation/Navigation.js index 0361245d..1e223c44 100644 --- a/packages/website/src/components/Navigation/Navigation.js +++ b/packages/website/src/components/Navigation/Navigation.js @@ -101,7 +101,7 @@ const Navigation = ({ mode, uri }) => { )} {showAccountNavigation && ( - + My account )} @@ -144,18 +144,18 @@ const Navigation = ({ mode, uri }) => {
{showLoginNavigation && ( <> - + Log in - + Sign up )} {showAccountNavigation && ( - + My account )}