From 56f0427b5ee5a0be3c740f261c118ef82cd4530b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Huy=20Ph=C3=BAc?= Date: Wed, 30 Aug 2023 15:28:35 +0700 Subject: [PATCH 1/6] fix: fix bug when submit form forgot password in popup --- Controller/Popup/Forgot.php | 3 ++- Helper/Data.php | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/Controller/Popup/Forgot.php b/Controller/Popup/Forgot.php index afc162d..10958dc 100755 --- a/Controller/Popup/Forgot.php +++ b/Controller/Popup/Forgot.php @@ -38,6 +38,7 @@ use Magento\Framework\Exception\SecurityViolationException; use Magento\Framework\Validator\ValidateException; use Magento\Framework\Validator\ValidatorChain; +use Magento\Framework\Validator\EmailAddress; use Mageplaza\SocialLogin\Helper\Data; /** @@ -142,7 +143,7 @@ public function execute() $email = (string) $this->getRequest()->getPost('email'); if ($email) { - if (!ValidatorChain::is($email, 'EmailAddress')) { + if (!ValidatorChain::is($email, EmailAddress::class)) { $this->session->setForgottenEmail($email); $result['message'][] = __('Please correct the email address.'); } diff --git a/Helper/Data.php b/Helper/Data.php index 606a9f5..52acd59 100755 --- a/Helper/Data.php +++ b/Helper/Data.php @@ -158,4 +158,26 @@ public function isCheckMode($storeId = null) { return $this->getConfigGeneral('check_mode', $storeId) && $this->getPopupLogin(); } + + /** + * @param string $code + * @param null $storeId + * + * @return array|mixed + */ + public function getConfigGoogleRecaptcha($code = '', $storeId = null) + { + return $this->getConfigValue('googlerecaptcha' . $code, $storeId); + } + + /** + * @param null $storeId + * + * @return bool + */ + public function isEnabledGGRecaptcha($storeId = null) + { + return $this->getConfigGoogleRecaptcha('/general/enabled', $storeId) + && $this->getConfigGoogleRecaptcha('/frontend/enabled', $storeId); + } } From f251198da085fe12948ff8c5fdf033ff8d9486a2 Mon Sep 17 00:00:00 2001 From: longdb Date: Mon, 25 Dec 2023 13:51:26 +0700 Subject: [PATCH 2/6] comp hyva_ --- view/frontend/layout/hyva_default.xml | 111 ++++++ .../templates/header/customer-menu.phtml | 57 ++++ .../templates/header/link/register.phtml | 34 ++ .../templates/header/link/sign-in.phtml | 41 +++ view/frontend/templates/header/modal.phtml | 62 ++++ .../popup/hyva_form/authentication.phtml | 274 +++++++++++++++ .../templates/popup/hyva_form/create.phtml | 323 ++++++++++++++++++ .../templates/popup/hyva_form/email.phtml | 126 +++++++ .../templates/popup/hyva_form/forgot.phtml | 157 +++++++++ .../popup/hyva_form/social_buttons.phtml | 65 ++++ view/frontend/web/css/style_hyva.css | 135 ++++++++ 11 files changed, 1385 insertions(+) create mode 100755 view/frontend/layout/hyva_default.xml create mode 100644 view/frontend/templates/header/customer-menu.phtml create mode 100644 view/frontend/templates/header/link/register.phtml create mode 100644 view/frontend/templates/header/link/sign-in.phtml create mode 100644 view/frontend/templates/header/modal.phtml create mode 100755 view/frontend/templates/popup/hyva_form/authentication.phtml create mode 100755 view/frontend/templates/popup/hyva_form/create.phtml create mode 100644 view/frontend/templates/popup/hyva_form/email.phtml create mode 100755 view/frontend/templates/popup/hyva_form/forgot.phtml create mode 100755 view/frontend/templates/popup/hyva_form/social_buttons.phtml create mode 100644 view/frontend/web/css/style_hyva.css diff --git a/view/frontend/layout/hyva_default.xml b/view/frontend/layout/hyva_default.xml new file mode 100755 index 0000000..3c57834 --- /dev/null +++ b/view/frontend/layout/hyva_default.xml @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + user_login + + + 230 + + + 50 + + + + + + + + + user_create + + + 230 + + + 50 + + + + + + + + + user_forgotpassword + + + 230 + + + 50 + + + + + + + + + + + Mageplaza_SocialLogin::header/link/sign-in.phtml + + + + + + + + + + + Mageplaza_SocialLogin/js/view/social-buttons + before + + + + + + + + + + diff --git a/view/frontend/templates/header/customer-menu.phtml b/view/frontend/templates/header/customer-menu.phtml new file mode 100644 index 0000000..8aa67e5 --- /dev/null +++ b/view/frontend/templates/header/customer-menu.phtml @@ -0,0 +1,57 @@ +require(HeroiconsOutline::class); +?> + +
+ + +
diff --git a/view/frontend/templates/header/link/register.phtml b/view/frontend/templates/header/link/register.phtml new file mode 100644 index 0000000..8d760ce --- /dev/null +++ b/view/frontend/templates/header/link/register.phtml @@ -0,0 +1,34 @@ +require(CustomerRegistration::class); + +$label = $block->getLabel() ? $block->getLabel() : __('Create an Account'); +?> + +isAllowed()): ?> + + escapeHtml($label) ?> + + diff --git a/view/frontend/templates/header/link/sign-in.phtml b/view/frontend/templates/header/link/sign-in.phtml new file mode 100644 index 0000000..c155ed2 --- /dev/null +++ b/view/frontend/templates/header/link/sign-in.phtml @@ -0,0 +1,41 @@ +getLabel() ? $block->getLabel() : __('Login In'); +$modalViewModel = $viewModels->require(\Hyva\Theme\ViewModel\Modal::class); + +?> + +
+ + + escapeHtml($label) ?> + + +
+ + \ No newline at end of file diff --git a/view/frontend/templates/header/modal.phtml b/view/frontend/templates/header/modal.phtml new file mode 100644 index 0000000..439418c --- /dev/null +++ b/view/frontend/templates/header/modal.phtml @@ -0,0 +1,62 @@ +require(\Hyva\Theme\ViewModel\Modal::class) + ->createModal() + ->addDialogClass('p-3 w-full') + ->removeDialogClass('shadow-xl','inline-block','bg-white', 'rounded-lg', 'p-10', 'max-h-screen', 'overflow-auto', 'border border-10', 'border-blue-500') + ->withDialogRefName('my-dialog') + ->withContent(' + + '); +?> + +
+ +
+ + + + \ No newline at end of file diff --git a/view/frontend/templates/popup/hyva_form/authentication.phtml b/view/frontend/templates/popup/hyva_form/authentication.phtml new file mode 100755 index 0000000..b2e21c2 --- /dev/null +++ b/view/frontend/templates/popup/hyva_form/authentication.phtml @@ -0,0 +1,274 @@ + + + + diff --git a/view/frontend/templates/popup/hyva_form/create.phtml b/view/frontend/templates/popup/hyva_form/create.phtml new file mode 100755 index 0000000..656b464 --- /dev/null +++ b/view/frontend/templates/popup/hyva_form/create.phtml @@ -0,0 +1,323 @@ + + + diff --git a/view/frontend/templates/popup/hyva_form/email.phtml b/view/frontend/templates/popup/hyva_form/email.phtml new file mode 100644 index 0000000..4fb095d --- /dev/null +++ b/view/frontend/templates/popup/hyva_form/email.phtml @@ -0,0 +1,126 @@ + +isCheckMode() || $block->isRequireMoreInfo()): ?> + + + + diff --git a/view/frontend/templates/popup/hyva_form/forgot.phtml b/view/frontend/templates/popup/hyva_form/forgot.phtml new file mode 100755 index 0000000..9842a36 --- /dev/null +++ b/view/frontend/templates/popup/hyva_form/forgot.phtml @@ -0,0 +1,157 @@ + + diff --git a/view/frontend/templates/popup/hyva_form/social_buttons.phtml b/view/frontend/templates/popup/hyva_form/social_buttons.phtml new file mode 100755 index 0000000..4c72892 --- /dev/null +++ b/view/frontend/templates/popup/hyva_form/social_buttons.phtml @@ -0,0 +1,65 @@ + +getAvailableSocials(); +?> +canShow(Position::PAGE_POPUP) && sizeof($availableSocials)): ?> + + + + + + +getSocialButtonsConfig(); ?> +canShow(Position::PAGE_AUTHEN) && sizeof($availableSocials)): ?> + + diff --git a/view/frontend/web/css/style_hyva.css b/view/frontend/web/css/style_hyva.css new file mode 100644 index 0000000..2796cfa --- /dev/null +++ b/view/frontend/web/css/style_hyva.css @@ -0,0 +1,135 @@ +@import url('https://fonts.googleapis.com/css?family=Roboto'); +@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,300;1,400;1,500;1,600;1,700;1,800&display=swap'); + +html { + /*font-size: 62.5%;*/ + font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; + +} + +#popup_test { + color: #333333; + font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; + font-style: normal; + font-weight: 400; + line-height: 1.42857143; + font-size: 0.8rem; +} + + +#popup_test .block-content > .actions-toolbar { + display: block; +} + +#popup_test .actions-toolbar { + border-top-width: 0; + --tw-border-opacity: 0; + border-color: unset; + padding-top: 0; + justify-content: flex-start; + flex-direction: row; +} + +#popup_test .fieldset > .field > .label, .fieldset > .fields > .field > .label { + font-weight: 600; +} + +#popup_test .fieldset > .field > .label, .fieldset > .fields > .field > .label { + margin: 0 0 8px; + display: inline-block; +} + +#popup_test .action.primary, .action-primary { + + border: 1px solid #1979c3; + color: #ffffff; + cursor: pointer; + display: inline-block; + font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; + font-weight: 600; + padding: 0px 15px; + font-size: 0.8rem; + box-sizing: border-box; + vertical-align: middle; +} + +#popup_test .fieldset > .field.required > .label:after, .fieldset > .fields > .field.required > .label:after, .fieldset > .field._required > .label:after, .fieldset > .fields > .field._required > .label:after { + content: '*'; + color: #e02b27; + font-size: 0.6rem; + margin: 0 0 0 5px; +} +#popup_test .remind, .action.create, .back { + color: #006bb4 !important; + text-decoration: none !important; +} + +#popup_test .remind:hover, .back:hover, .action.create:hover { + color: #006bb4 !important; + text-decoration: underline !important; +} + +#popup_test .remind:active, .back:active, .action.create:active { + color: #ff5501 !important; + text-decoration: underline !important; +} +#popup_test .messages { + color: #e02b27; + font-size: 0.8rem; +} +#popup_test .control { + margin-bottom: 10px; +} + + +#popup_test h2 { + font-weight: 300; + line-height: 1.1; + font-size: 1.6rem; + +} +#popup_test .messages li { + margin-bottom: 20px; + margin-top: 7px; + +} +#popup_test .primary button:focus { + --tw-ring-shadow: 0 0 #000 ; +} +#popup_test input[type="text"], input[type="password"], input[type="url"], input[type="tel"], input[type="search"], input[type="number"], input[type*="date"], input[type="email"] { + background: #ffffff; + background-clip: padding-box; + border: 1px solid #c2c2c2; + border-radius: 1px; + font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; + font-size: 14px; + height: 32px; + min-height: 32px; + line-height: 1.42857143; + padding: 0 9px; + vertical-align: baseline; + width: 100%; + box-sizing: border-box; +} +#popup_test fieldset .field.field-reserved, form .field.field-reserved { + margin-bottom: 0; +} +#popup_test button { + background-image: none; + background: #eeeeee; + border: 1px solid #cccccc; + color: #333333; + cursor: pointer; + display: inline-block; + font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; + font-weight: 600; + margin: 0; + padding: 0px 15px; + font-size: 0.8rem; + line-height: 1.6rem; + box-sizing: border-box; + vertical-align: middle; +} +#popup_test .captcha-img { + margin: 0 10px 10px 0; +} \ No newline at end of file From 98c97fa690350527c465bd44e28d26b4f9a656d9 Mon Sep 17 00:00:00 2001 From: longdb Date: Thu, 4 Jan 2024 16:35:21 +0700 Subject: [PATCH 3/6] comp: hyva_theme --- view/frontend/layout/hyva_default.xml | 7 +- .../templates/header/link/register.phtml | 61 ++++- .../templates/header/link/sign-in.phtml | 70 +++-- view/frontend/templates/header/modal.phtml | 241 +++++++++++++++++- .../popup/hyva_form/social_buttons.phtml | 24 +- view/frontend/web/css/style_hyva.css | 35 +++ 6 files changed, 390 insertions(+), 48 deletions(-) diff --git a/view/frontend/layout/hyva_default.xml b/view/frontend/layout/hyva_default.xml index 3c57834..d822b76 100755 --- a/view/frontend/layout/hyva_default.xml +++ b/view/frontend/layout/hyva_default.xml @@ -84,12 +84,15 @@ - Mageplaza_SocialLogin::header/link/sign-in.phtml - + + + Mageplaza_SocialLogin::header/link/register.phtml + + diff --git a/view/frontend/templates/header/link/register.phtml b/view/frontend/templates/header/link/register.phtml index 8d760ce..4bbfb8e 100644 --- a/view/frontend/templates/header/link/register.phtml +++ b/view/frontend/templates/header/link/register.phtml @@ -1,11 +1,25 @@ require(CustomerRegistration::class); $label = $block->getLabel() ? $block->getLabel() : __('Create an Account'); +$helperData = $this->helper(\Mageplaza\SocialLogin\Helper\Data::class); +$popupLogin = $helperData->getPopupLogin(); ?> isAllowed()): ?> - - escapeHtml($label) ?> - + + + + + + + \ No newline at end of file diff --git a/view/frontend/templates/header/link/sign-in.phtml b/view/frontend/templates/header/link/sign-in.phtml index c155ed2..a2abadf 100644 --- a/view/frontend/templates/header/link/sign-in.phtml +++ b/view/frontend/templates/header/link/sign-in.phtml @@ -1,9 +1,22 @@ getLabel() ? $block->getLabel() : __('Login In'); +$label = $block->getLabel() ? $block->getLabel() : __('Login In'); $modalViewModel = $viewModels->require(\Hyva\Theme\ViewModel\Modal::class); - +$helperData = $this->helper(\Mageplaza\SocialLogin\Helper\Data::class); +$popupLogin = $helperData->getPopupLogin(); ?> + + + + + \ No newline at end of file diff --git a/view/frontend/templates/header/modal.phtml b/view/frontend/templates/header/modal.phtml index 439418c..6cd0091 100644 --- a/view/frontend/templates/header/modal.phtml +++ b/view/frontend/templates/header/modal.phtml @@ -1,18 +1,220 @@ require(\Hyva\Theme\ViewModel\Modal::class) +$helperData = $this->helper(\Mageplaza\SocialLogin\Helper\Data::class); +$popupEffect = $helperData->getPopupEffect(); +$modal = $viewModels->require(\Hyva\Theme\ViewModel\Modal::class) ->createModal() - ->addDialogClass('p-3 w-full') - ->removeDialogClass('shadow-xl','inline-block','bg-white', 'rounded-lg', 'p-10', 'max-h-screen', 'overflow-auto', 'border border-10', 'border-blue-500') + ->addDialogClass("p-3 w-full wrap-modal-login transform origin-left opacity-0 scale-0" . " " . $popupEffect . "-appear") + ->removeDialogClass('shadow-xl', 'inline-block', 'bg-white', 'rounded-lg', 'p-10', 'max-h-screen', 'overflow-auto', + 'border border-10', 'border-blue-500') ->withDialogRefName('my-dialog') ->withContent(' '); + + ?> +
- +