From 6667b8aae851aa93b9bb4e7c474926ad7a001f38 Mon Sep 17 00:00:00 2001 From: Edward Cho Date: Tue, 5 Mar 2024 11:34:23 -0500 Subject: [PATCH] update login-link --- blocks/identity-block/_index.scss | 4 ++++ .../bot-challenge-protection/index.jsx | 10 ---------- .../features/login-links/default.jsx | 4 ++-- .../identity-block/features/login/default.jsx | 17 +---------------- blocks/identity-block/intl.json | 5 ++++- blocks/identity-block/themes/news.json | 15 ++++++++++++++- locale/en.json | 3 ++- 7 files changed, 27 insertions(+), 31 deletions(-) diff --git a/blocks/identity-block/_index.scss b/blocks/identity-block/_index.scss index 7d543b3ebc..dae6125ed1 100644 --- a/blocks/identity-block/_index.scss +++ b/blocks/identity-block/_index.scss @@ -83,6 +83,10 @@ .b-login-links { @include scss.block-components("login-links"); @include scss.block-properties("login-links"); + &__inner-link { + @include scss.block-components("login-links-inner-link"); + @include scss.block-properties("login-links-inner-link"); + } } .b-reset-password { diff --git a/blocks/identity-block/components/bot-challenge-protection/index.jsx b/blocks/identity-block/components/bot-challenge-protection/index.jsx index bdeb828f8f..3f4960a6a1 100644 --- a/blocks/identity-block/components/bot-challenge-protection/index.jsx +++ b/blocks/identity-block/components/bot-challenge-protection/index.jsx @@ -7,7 +7,6 @@ import { Paragraph, useIdentity } from "@wpmedia/arc-themes-components"; import useSales from "../../utils/useSales"; import ReCAPTCHA from "react-google-recaptcha"; - const BotChallengeProtection = ({ challengeIn, setCaptchaToken, className }) => { const { Identity, isInitialized } = useIdentity(); const { Sales } = useSales(); @@ -69,13 +68,4 @@ const BotChallengeProtection = ({ challengeIn, setCaptchaToken, className }) => ); }; -BotChallengeProtection.propTypes = { - customFields: PropTypes.shape({ - challengeIn: PropTypes.oneOf(['signup', 'signin', 'magiclink', 'checkout']).tag({ - name: "Challenge In", - defaultValue: "signup", - }) - }), -}; - export default BotChallengeProtection; diff --git a/blocks/identity-block/features/login-links/default.jsx b/blocks/identity-block/features/login-links/default.jsx index a8d069d53f..4a1615492c 100644 --- a/blocks/identity-block/features/login-links/default.jsx +++ b/blocks/identity-block/features/login-links/default.jsx @@ -2,7 +2,7 @@ import React from "react"; import PropTypes from "@arc-fusion/prop-types"; import { useFusionContext } from "fusion:context"; import getTranslatedPhrases from "fusion:intl"; -import { Link, Stack } from "@wpmedia/arc-themes-components"; +import { Link, Paragraph, Stack } from "@wpmedia/arc-themes-components"; const BLOCK_CLASS_NAME = "b-login-links"; const defaultLoginURL = "/account/login/"; @@ -35,7 +35,7 @@ const LoginLinks = ({ customFields }) => { {phrases.t("identity-block.login-links-forgot")} ) : null} {showSignUp ? ( - {phrases.t("identity-block.login-links-signup")} + {phrases.t("identity-block.login-links-signup")}{phrases.t("identity-block.sign-up-natural")} ) : null} ); diff --git a/blocks/identity-block/features/login/default.jsx b/blocks/identity-block/features/login/default.jsx index b72ab714eb..7728adf609 100644 --- a/blocks/identity-block/features/login/default.jsx +++ b/blocks/identity-block/features/login/default.jsx @@ -13,7 +13,7 @@ import validateURL from "../../utils/validate-redirect-url"; const BLOCK_CLASS_NAME = "b-login-form"; const Login = ({ customFields }) => { - const { redirectURL, redirectToPreviousPage, loggedInPageLocation, OIDC, signUpURL } = customFields; + const { redirectURL, redirectToPreviousPage, loggedInPageLocation, OIDC } = customFields; const url_string = window.location.href; const url = new URL(url_string); @@ -35,12 +35,6 @@ const Login = ({ customFields }) => { }); const { loginByOIDC } = useOIDCLogin(); - const redirectToSignUp = () => { - if(signUpURL){ - window.location = signUpURL; - } - } - if (!isInitialized) { return null; } @@ -88,9 +82,6 @@ const Login = ({ customFields }) => { {phrases.t("identity-block.privacy-statement")} -
- Need to create an account? -
); }; @@ -115,12 +106,6 @@ Login.propTypes = { description: "The URL to which a user would be redirected to if visiting a login page when already logged in.", }), - signUpURL: PropTypes.string.tag({ - name: "Sign up URL", - defaultValue: "/signup/", - description: - "The URL to which a user would be redirected to if the user clicks on the sign up button", - }), OIDC: PropTypes.bool.tag({ name: 'Login with OIDC', defaultValue: false, diff --git a/blocks/identity-block/intl.json b/blocks/identity-block/intl.json index f3d7a027de..24bf25d773 100644 --- a/blocks/identity-block/intl.json +++ b/blocks/identity-block/intl.json @@ -643,7 +643,7 @@ "id": "Belum memiliki akun? Daftar", "fr": "Sign up for an account.", "es": "Sign up for an account.", - "en": "Don't have an account? Sign up", + "en": "Need to create an account? ", "de": "Sign up for an account.", "bo": "ཁྱེད་ལ་དྲ་གྲངས་མེད་དམ། ཐོ་འགོད།", "bn": "কোনো অ্যাকাউন্ট নেই?\nসাইন আপ করুন", @@ -1282,5 +1282,8 @@ }, "identity-block.privacy-statement": { "en": "By creating an account, you agree to the Terms of Service and acknowledge our Privacy Policy." + }, + "identity-block.sign-up-natural": { + "en": "Sign up" } } \ No newline at end of file diff --git a/blocks/identity-block/themes/news.json b/blocks/identity-block/themes/news.json index da07517971..5bd5a6d6c0 100644 --- a/blocks/identity-block/themes/news.json +++ b/blocks/identity-block/themes/news.json @@ -340,9 +340,15 @@ "login-links": { "styles": { "default": { + "font-family": "inter", "components": { + "paragraph": { + "text-align": "center", + "font-family": "inter" + }, "link": { - "text-align": "center" + "text-align": "center", + "font-family": "inter" }, "link-hover": { "color": "var(--text-color-subtle)" @@ -352,6 +358,13 @@ "desktop": {} } }, + "login-links-inner-link": { + "styles": { + "default": { + "text-decoration": "underline" + } + } + }, "reset-password": { "styles": { "default": { diff --git a/locale/en.json b/locale/en.json index 8caf6bd9d5..7cc9e66a4e 100644 --- a/locale/en.json +++ b/locale/en.json @@ -132,7 +132,7 @@ "identity-block.login-form-error": "There's been an error logging you in", "identity-block.login-links-forgot": "Forgot your password?", "identity-block.login-links-login": "Already have an account? Log in", - "identity-block.login-links-signup": "Don't have an account? Sign up", + "identity-block.login-links-signup": "Need to create an account? ", "identity-block.login-options": "Log in options", "identity-block.manage-account": "Manage Your Account", "identity-block.new-password": "New Password", @@ -154,6 +154,7 @@ "identity-block.reset-password-submit-submitted": "Continue to log in", "identity-block.save": "Save", "identity-block.sign-up": "Sign Up", + "identity-block.sign-up-natural": "Sign up", "identity-block.sign-up-form-error": "There's been an error creating your account", "identity-block.terms-privacy-text": "By creating an account, you agree to the Terms of Service<\/a> and acknowledge our Privacy Policy<\/a>.", "identity-block.update-email-error": "There's been an error updating your email address",