Skip to content

Commit

Permalink
Merge pull request #27 from two-inc/prettier
Browse files Browse the repository at this point in the history
style: Format static assets
  • Loading branch information
brtkwr authored Nov 10, 2023
2 parents bd3a947 + d7a3db0 commit 015cd97
Show file tree
Hide file tree
Showing 12 changed files with 897 additions and 754 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
.git* export-ignore
.prettierrc export-ignore
Makefile export-ignore
bumpver.toml export-ignore
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"useTabs": false,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100,
"tabWidth": 4,
"semi": true
}
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
prettier:
prettier -w view/frontend/web/js/
prettier -w view/frontend/web/css/
prettier -w view/frontend/web/template/
2 changes: 1 addition & 1 deletion view/frontend/layout/checkout_index_index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<css src="Two_Gateway::css/style.css"/>
<css src="Two_Gateway::css/select2.min.css"/>
<css src="Two_Gateway::select2-4.1.0/css/select2.min.css"/>
<css src="Two_Gateway::intl-tel-input-18.2.1/css/intlTelInput.min.css"/>
</head>
<body>
Expand Down
22 changes: 11 additions & 11 deletions view/frontend/web/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ input#two_payment:before {
content: '';
display: block;
border: 1px solid #cccccc;
background-image: url("../images/logo.svg");
background-image: url('../images/logo.svg');
background-position: 10px 8px;
background-size: 44px;
background-repeat: no-repeat;
Expand Down Expand Up @@ -93,7 +93,7 @@ input#two_payment:before {
}

.what_is_two_popup img {
content: url("../images/logo.svg");
content: url('../images/logo.svg');
margin: 10px auto 20px auto;
display: block;
width: 40%;
Expand Down Expand Up @@ -148,13 +148,13 @@ input#two_payment:before {
border: 1px solid var(--color-gray89);
}

.mode_selector [data-element="click-element"] {
.mode_selector [data-element='click-element'] {
color: var(--color-blue2);
background-color: var(--color-white);
cursor: pointer;
}

.mode_selector [data-element="selected-element"] {
.mode_selector [data-element='selected-element'] {
color: var(--color-white);
background-color: var(--color-blue2);
}
Expand All @@ -176,18 +176,18 @@ input#two_payment:before {
height: 20px;
}

.sole_trader_note [data-element="click-element"] {
.sole_trader_note [data-element='click-element'] {
color: var(--color-blue2);
text-decoration: underline;
text-underline-offset: 2px;
cursor: pointer;
}

[data-element="error-message"] {
[data-element='error-message'] {
margin-bottom: 24px !important;
}

.popup_message [data-element="click-element"] {
.popup_message [data-element='click-element'] {
color: var(--color-blue2);
text-decoration: underline;
text-underline-offset: 2px;
Expand All @@ -210,9 +210,9 @@ input#two_payment:before {
border-radius: 8px;
border: 1px solid var(--color-gray89);
background-color: var(--color-white);
box-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);
box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);

transition: .65s;
transition: 0.65s;
}

.sole_trader_note iframe {
Expand All @@ -233,9 +233,9 @@ input#two_payment:before {

opacity: 0;
visibility: hidden;
background-color: rgba(0, 0, 0, .7);
background-color: rgba(0, 0, 0, 0.7);

transition: .65s;
transition: 0.65s;
cursor: pointer;
}

Expand Down
21 changes: 9 additions & 12 deletions view/frontend/web/js/action/set-shipping-information-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@
*/
/*jshint browser:true jquery:true*/
/*global alert*/
define([
'jquery',
'mage/utils/wrapper',
'Magento_Checkout/js/model/quote'
], function ($, wrapper, quote) {
define(['jquery', 'mage/utils/wrapper', 'Magento_Checkout/js/model/quote'], function (
$,
wrapper,
quote
) {
'use strict';

return function (setShippingInformationAction) {

return wrapper.wrap(setShippingInformationAction, function (originalAction) {
var shippingAddress = quote.shippingAddress();

Expand All @@ -21,15 +20,13 @@ define([
}

if (shippingAddress.customAttributes !== undefined) {
var attribute = shippingAddress.customAttributes.find(
function (element) {
return element.attribute_code === 'two_telephone';
}
);
var attribute = shippingAddress.customAttributes.find(function (element) {
return element.attribute_code === 'two_telephone';
});
}

shippingAddress['extension_attributes']['two_telephone'] =
(attribute !== undefined) ? attribute.value : '';
attribute !== undefined ? attribute.value : '';

// pass execution to original action ('Magento_Checkout/js/action/set-shipping-information')
return originalAction();
Expand Down
Loading

0 comments on commit 015cd97

Please sign in to comment.