diff --git a/packages/website/src/components/Navigation/Navigation.js b/packages/website/src/components/Navigation/Navigation.js
index ab96ab2a..1e223c44 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,18 +90,18 @@ const Navigation = ({ mode, uri }) => {
{showLoginNavigation && (
<>
-
+
Log in
-
+
Sign up
>
)}
{showAccountNavigation && (
-
+
My account
)}
@@ -144,18 +144,18 @@ const Navigation = ({ mode, uri }) => {
{showLoginNavigation && (
<>
-
+
Log in
-
+
Sign up
>
)}
{showAccountNavigation && (
-
+
My account
)}
diff --git a/packages/website/src/components/Uploader/Uploader.js b/packages/website/src/components/Uploader/Uploader.js
index 0384bf67..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..ec3ed3e3 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 = "") => url && new URL(path, url).toString(), [url]);
React.useEffect(() => {
(async function resolve() {
@@ -14,5 +15,5 @@ export default function useAccountsUrl() {
})();
}, [setUrl]);
- return url;
+ return createAccountsUrl;
}