Skip to content

Commit

Permalink
Merge pull request bigcommerce#2242 from serhii-tkachenko/PAYPAL-1579
Browse files Browse the repository at this point in the history
feat(payment): PAYPAL-1579 added wallet buttons component for product details and quick view
  • Loading branch information
serhii-tkachenko authored Aug 8, 2022
2 parents 68deea3 + 30332f5 commit 83d17dd
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 24 deletions.
28 changes: 28 additions & 0 deletions assets/scss/components/foundation/dropdown/_dropdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,34 @@

.form-wishlist {
position: relative;

@include breakpoint("small") {
float: left;
padding: 0 remCalc(10);
width: 50%;
}

@include breakpoint("medium") {
padding: 0;
width: auto;
}

@include breakpoint("large") {
display: inline-block;
margin-top: 1rem;
}

.button {
width: 100%;

@include breakpoint("medium") {
width: auto;
}

@include breakpoint("large") {
margin-right: spacing("half");
}
}
}

.dropdown-menu-button {
Expand Down
38 changes: 25 additions & 13 deletions assets/scss/components/stencil/productView/_productView.scss
Original file line number Diff line number Diff line change
Expand Up @@ -335,38 +335,50 @@
}
}

.form-action {
.add-to-cart-buttons {
display: inline-grid;
float: left;
margin-bottom: 1rem;
width: 100%;

@include breakpoint("small") {
float: left;
padding: 0 remCalc(10);
width: 50%;
}

@include breakpoint("medium") {
padding: 0;
width: auto;
padding-right: spacing("half");
width: 50%;
}

@include breakpoint("large") {
display: inline-block;
margin-top: 1rem;
padding-right: spacing("half");
width: 50%;
}

.button {
margin: 0;
width: 100%;
}
}

@include breakpoint("medium") {
width: auto;
}
.add-to-cart-wallet-buttons {
margin-top: spacing("half");

@include breakpoint("large") {
margin-right: spacing("half");
}
}
button {
color: stencilColor("color-textSecondary");
display: block;
padding: spacing("quarter") 0;
text-align: center;
text-decoration: underline;
vertical-align: middle;
width: 100%;

.button--primary {
margin-right: spacing("half");
&:hover {
color: stencilColor("color-textSecondary--hover");
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion templates/components/amp/products/product-options.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{{{dynamicComponent 'components/products/options'}}}
{{/each}}
</div>
{{> components/products/add-to-cart}}
{{> components/products/add-to-cart with_wallet_buttons=false}}
<div class="loadingOverlay"></div>
</form>
</div>
Expand Down
3 changes: 3 additions & 0 deletions templates/components/common/wallet-buttons.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{#if wallet_buttons}}
{{{wallet_buttons}}}
{{/if}}
25 changes: 16 additions & 9 deletions templates/components/products/add-to-cart.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,22 @@
<p class="alertBox-column alertBox-message"></p>
</div>
{{#or customer (if theme_settings.restrict_to_login '!==' true)}}
<div class="form-action">
<input
id="form-action-addToCart"
data-wait-message="{{lang 'products.adding_to_cart'}}"
class="button button--primary"
type="submit"
value="{{#if product.pre_order}}{{lang 'products.pre_order'}}{{else}}{{lang 'products.add_to_cart'}}{{/if}}"
>
<span class="product-status-message aria-description--hidden">{{lang 'products.adding_to_cart'}} {{lang 'category.add_cart_announcement'}}</span>
<div class="add-to-cart-buttons">
<div class="form-action">
<input
id="form-action-addToCart"
data-wait-message="{{lang 'products.adding_to_cart'}}"
class="button button--primary"
type="submit"
value="{{#if product.pre_order}}{{lang 'products.pre_order'}}{{else}}{{lang 'products.add_to_cart'}}{{/if}}"
>
<span class="product-status-message aria-description--hidden">{{lang 'products.adding_to_cart'}} {{lang 'category.add_cart_announcement'}}</span>
</div>
{{#if this.with_wallet_buttons}}
<div class="add-to-cart-wallet-buttons">
{{> components/common/wallet-buttons}}
</div>
{{/if}}
</div>
{{/or}}
</div>
2 changes: 1 addition & 1 deletion templates/components/products/product-view.html
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ <h2 class="productView-brand">
<span data-product-stock>{{product.stock_level}}</span>
</label>
</div>
{{> components/products/add-to-cart}}
{{> components/products/add-to-cart with_wallet_buttons=true}}
{{#if product.out_of_stock}}
{{#if product.out_of_stock_message}}
{{> components/common/alert/alert-error product.out_of_stock_message}}
Expand Down

0 comments on commit 83d17dd

Please sign in to comment.