From d0935779098ebfd842ef6f76a09512b1c4a03074 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Leszczyk?= Date: Mon, 11 Apr 2022 12:37:14 +0200 Subject: [PATCH] dashboard-v2: move static elements of auth pages to AuthLayout --- .../src/components/forms/LoginForm.js | 2 +- .../dashboard-v2/src/layouts/AuthLayout.js | 9 +++- packages/dashboard-v2/src/pages/auth/login.js | 15 ++---- .../src/pages/auth/registration.js | 6 +-- .../src/pages/auth/reset-password.js | 37 ++++++-------- .../dashboard-v2/src/pages/user/confirm.js | 25 ++++------ .../dashboard-v2/src/pages/user/recover.js | 49 +++++++++---------- 7 files changed, 63 insertions(+), 80 deletions(-) diff --git a/packages/dashboard-v2/src/components/forms/LoginForm.js b/packages/dashboard-v2/src/components/forms/LoginForm.js index a5a1deeb..eeafc092 100644 --- a/packages/dashboard-v2/src/components/forms/LoginForm.js +++ b/packages/dashboard-v2/src/components/forms/LoginForm.js @@ -82,7 +82,7 @@ export const LoginForm = ({ onSuccess }) => {

- Don't have an account? Sign up + Don't have an account? Sign up

)} diff --git a/packages/dashboard-v2/src/layouts/AuthLayout.js b/packages/dashboard-v2/src/layouts/AuthLayout.js index 847562e5..8141e606 100644 --- a/packages/dashboard-v2/src/layouts/AuthLayout.js +++ b/packages/dashboard-v2/src/layouts/AuthLayout.js @@ -33,7 +33,14 @@ const AuthLayout = - {children} + +
+
+ Skynet +
+ {children} +
+
diff --git a/packages/dashboard-v2/src/pages/auth/login.js b/packages/dashboard-v2/src/pages/auth/login.js index 5812fd8f..8d51968d 100644 --- a/packages/dashboard-v2/src/pages/auth/login.js +++ b/packages/dashboard-v2/src/pages/auth/login.js @@ -22,16 +22,11 @@ const LoginPage = ({ location }) => { Sign In -
-
- Skynet -
- { - await refreshUserState(); - }} - /> -
+ { + await refreshUserState(); + }} + /> ); }; diff --git a/packages/dashboard-v2/src/pages/auth/registration.js b/packages/dashboard-v2/src/pages/auth/registration.js index e8e67354..b58562fd 100644 --- a/packages/dashboard-v2/src/pages/auth/registration.js +++ b/packages/dashboard-v2/src/pages/auth/registration.js @@ -61,11 +61,7 @@ const SignUpPage = () => { Sign Up -
-
- Skynet -
- +
{!settings.areAccountsEnabled && Accounts are not enabled on this portal.} {settings.areAccountsEnabled && ( diff --git a/packages/dashboard-v2/src/pages/auth/reset-password.js b/packages/dashboard-v2/src/pages/auth/reset-password.js index 88db338a..74c40203 100644 --- a/packages/dashboard-v2/src/pages/auth/reset-password.js +++ b/packages/dashboard-v2/src/pages/auth/reset-password.js @@ -20,30 +20,25 @@ const ResetPasswordPage = () => { Reset Password -
-
- Skynet -
- {state !== State.Success && ( - setState(State.Success)} onFailure={() => setState(State.Failure)} /> - )} + {state !== State.Success && ( + setState(State.Success)} onFailure={() => setState(State.Failure)} /> + )} - {state === State.Success && ( -

Please check your inbox for further instructions.

- )} + {state === State.Success && ( +

Please check your inbox for further instructions.

+ )} - {state === State.Failure && ( -

Something went wrong, please try again later.

- )} + {state === State.Failure && ( +

Something went wrong, please try again later.

+ )} -
-

- Suddenly remembered your password? Sign in -

-

- Don't actually have an account? Create one! -

-
+
+

+ Suddenly remembered your password? Sign in +

+

+ Don't actually have an account? Create one! +

); diff --git a/packages/dashboard-v2/src/pages/user/confirm.js b/packages/dashboard-v2/src/pages/user/confirm.js index b4ce6bc1..1430a4f9 100644 --- a/packages/dashboard-v2/src/pages/user/confirm.js +++ b/packages/dashboard-v2/src/pages/user/confirm.js @@ -57,23 +57,18 @@ const EmailConfirmationPage = ({ location }) => { Confirm E-mail Address -
-
- Skynet -
-
- {state === State.Pure &&

Please wait while we verify your account...

} +
+ {state === State.Pure &&

Please wait while we verify your account...

} - {state === State.Success && ( - <> -

All done!

-

You will be redirected to your dashboard shortly.

- Redirect now. - - )} + {state === State.Success && ( + <> +

All done!

+

You will be redirected to your dashboard shortly.

+ Redirect now. + + )} - {state === State.Failure &&

Something went wrong, please try again later.

} -
+ {state === State.Failure &&

Something went wrong, please try again later.

}
); diff --git a/packages/dashboard-v2/src/pages/user/recover.js b/packages/dashboard-v2/src/pages/user/recover.js index d8d02e8a..ddba982f 100644 --- a/packages/dashboard-v2/src/pages/user/recover.js +++ b/packages/dashboard-v2/src/pages/user/recover.js @@ -24,35 +24,30 @@ const RecoverPage = ({ location }) => { Recover Your Account -
-
- Skynet -
- {state !== State.Success && ( - { - setState(State.Success); - navigate("/"); - }} - onFailure={() => setState(State.Failure)} - /> - )} + {state !== State.Success && ( + { + setState(State.Success); + navigate("/"); + }} + onFailure={() => setState(State.Failure)} + /> + )} - {state === State.Success && ( -

- All done! You will be redirected to your dashboard shortly. -

- )} - - {state === State.Failure && ( -

Something went wrong, please try again later.

- )} - -

- Suddenly remembered your old password? Sign in + {state === State.Success && ( +

+ All done! You will be redirected to your dashboard shortly.

-
+ )} + + {state === State.Failure && ( +

Something went wrong, please try again later.

+ )} + +

+ Suddenly remembered your old password? Sign in +

); };