Skip to content

Commit

Permalink
Adds Shop Login Button liquid drop provider on login template
Browse files Browse the repository at this point in the history
  • Loading branch information
QuintonC committed Apr 3, 2024
1 parent 8b1099b commit 78cb8af
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
3 changes: 2 additions & 1 deletion locales/en.default.json
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,8 @@
"password": "Password",
"title": "Login",
"sign_in": "Sign in",
"submit": "Submit"
"submit": "Submit",
"alternate_provider_separator": "or"
},
"order": {
"title": "Order {{ name }}",
Expand Down
5 changes: 4 additions & 1 deletion locales/en.default.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1909,7 +1909,10 @@
}
},
"main-login": {
"name": "Login"
"name": "Login",
"shop_login_button": {
"enable": "Enable Sign in with Shop"
}
},
"main-order": {
"name": "Order"
Expand Down
20 changes: 20 additions & 0 deletions sections/main-login.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
}
{%- endstyle -%}

{%- if section.settings.enable_shop_login_button == false -%}
{%- assign hide_shop_login_button = true -%}
{%- endif -%}

<div class="customer login section-{{ section.id }}-padding">
<h1 id="recover" tabindex="-1">
{{ 'customer.recover_password.title' | t }}
Expand Down Expand Up @@ -96,6 +100,16 @@
{{ form.errors | default_errors }}
{%- endif -%}

<section name="sign-in-with-shop-provider">
{{ shop | login_button: hide_button: hide_shop_login_button }}

{%- unless hide_shop_login_button -%}
<p>
{{ 'customer.login_page.alternate_provider_separator' | t }}
</p>
{%- endunless -%}
</section>

<div class="field">
<input
type="email"
Expand Down Expand Up @@ -165,6 +179,12 @@
{
"name": "t:sections.main-login.name",
"settings": [
{
"type": "checkbox",
"id": "enable_shop_login_button",
"label": "t:sections.main-login.shop_login_button.enable",
"default": true
},
{
"type": "header",
"content": "t:sections.all.padding.section_padding_heading"
Expand Down

0 comments on commit 78cb8af

Please sign in to comment.