diff --git a/packages/dashboard-v2/src/contexts/portal-settings/PortalSettingsContext.js b/packages/dashboard-v2/src/contexts/portal-settings/PortalSettingsContext.js index 07e7844c..4c0cf185 100644 --- a/packages/dashboard-v2/src/contexts/portal-settings/PortalSettingsContext.js +++ b/packages/dashboard-v2/src/contexts/portal-settings/PortalSettingsContext.js @@ -2,8 +2,8 @@ import { createContext } from "react"; export const defaultSettings = { areAccountsEnabled: false, - isAuthenticationRequired: true, - isSubscriptionRequired: true, + isAuthenticationRequired: false, + isSubscriptionRequired: false, }; export const PortalSettingsContext = createContext(defaultSettings); diff --git a/packages/dashboard-v2/src/pages/auth/signup.js b/packages/dashboard-v2/src/pages/auth/signup.js index 174a17fd..036d5368 100644 --- a/packages/dashboard-v2/src/pages/auth/signup.js +++ b/packages/dashboard-v2/src/pages/auth/signup.js @@ -1,5 +1,6 @@ import { useEffect, useState } from "react"; import { navigate } from "gatsby"; +import bytes from "pretty-bytes"; import AuthLayout from "../../layouts/AuthLayout"; @@ -7,13 +8,21 @@ import { Alert } from "../../components/Alert"; import HighlightedLink from "../../components/HighlightedLink"; import { SignUpForm } from "../../components/forms/SignUpForm"; import { usePortalSettings } from "../../contexts/portal-settings"; +import { PlansProvider, usePlans } from "../../contexts/plans"; -const FreePortalHeader = () => ( -
-

Create your free account

-

Includes 100 GB storage at basic speed

-
-); +const FreePortalHeader = () => { + const { plans } = usePlans(); + + const freePlan = plans.find(({ price }) => price === 0); + const freeStorage = freePlan ? bytes(freePlan.limits?.storageLimit, { binary: true }) : null; + + return ( +
+

Create your free account

+ {freeStorage &&

Includes {freeStorage} storage at basic speed

} +
+ ); +}; const PaidPortalHeader = () => (
@@ -47,39 +56,41 @@ const SignUpPage = () => { }, [state, settings.isSubscriptionRequired]); return ( -
-
- Skynet + +
+
+ Skynet +
+ + {!settings.areAccountsEnabled && Sorry, registrations are currently disabled.} + + {settings.areAccountsEnabled && ( + <> + {settings.isSubscriptionRequired ? : } + + {state !== State.Success && ( + setState(State.Success)} onFailure={() => setState(State.Failure)} /> + )} + + {state === State.Success && ( +
+

Please check your inbox and confirm your email address.

+

You will be redirected to your dashboard shortly.

+ Click here to go there now. +
+ )} + + {state === State.Failure && ( +

Something went wrong, please try again later.

+ )} + + )} + +

+ Already have an account? Sign in +

- - {!settings.areAccountsEnabled && Sorry, registrations are currently disabled.} - - {settings.areAccountsEnabled && ( - <> - {settings.isSubscriptionRequired ? : } - - {state !== State.Success && ( - setState(State.Success)} onFailure={() => setState(State.Failure)} /> - )} - - {state === State.Success && ( -
-

Please check your inbox and confirm your email address.

-

You will be redirected to your dashboard shortly.

- Click here to go there now. -
- )} - - {state === State.Failure && ( -

Something went wrong, please try again later.

- )} - - )} - -

- Already have an account? Sign in -

-
+ ); };