-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
135 changed files
with
4,131 additions
and
2,113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
@import '../style'; | ||
|
||
#payment .payment_method_woocommerce_payments .testmode-info { | ||
margin-bottom: 0.5em; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,57 @@ | ||
#wcpay-card-element { | ||
border: 1px solid #ddd; | ||
padding: 5px 7px; | ||
min-height: 29px; | ||
margin-bottom: 0.5rem; | ||
#payment .payment_method_woocommerce_payments .woocommerce-error { | ||
margin: 1rem 0; | ||
} | ||
|
||
.wcpay-card-mounted { | ||
background-color: #fff; | ||
} | ||
.js-woopayments-copy-test-number { | ||
line-height: 1.2em; | ||
vertical-align: middle; | ||
border-radius: 0; | ||
border: none !important; | ||
// some themes might override the color on all `button`s - whose selector has higher specificity and our class selector. | ||
background-color: transparent !important; | ||
font-weight: normal; | ||
display: inline-flex; | ||
cursor: pointer; | ||
color: inherit; | ||
font-size: initial; | ||
padding: 2px 1px; | ||
align-items: center; | ||
|
||
#payment .payment_method_woocommerce_payments .woocommerce-error { | ||
margin: 1rem 0; | ||
span { | ||
margin-right: 4px; | ||
} | ||
|
||
i { | ||
order: 1; | ||
display: block; | ||
width: 1.2em; | ||
height: 1.2em; | ||
background: url( 'assets/images/icons/copy.svg?asset' ) no-repeat center; | ||
background-size: contain; | ||
} | ||
|
||
&:hover { | ||
background-color: transparent; | ||
filter: invert( 0.3 ); | ||
|
||
i { | ||
filter: invert( 0.3 ); | ||
} | ||
} | ||
|
||
&:active i { | ||
transform: scale( 0.9 ); | ||
} | ||
|
||
&.state--success { | ||
i { | ||
background-image: url( 'assets/images/icons/check-green.svg?asset' ); | ||
} | ||
} | ||
|
||
.theme--night & { | ||
i { | ||
filter: invert( 100% ) hue-rotate( 180deg ); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { __ } from '@wordpress/i18n'; | ||
|
||
let previousTimeoutRef = null; | ||
|
||
document.addEventListener( | ||
'click', | ||
function ( event ) { | ||
// using "closest", just in case the user clicks on the icon. | ||
const copyNumberButton = event.target?.closest( | ||
'.js-woopayments-copy-test-number' | ||
); | ||
if ( ! copyNumberButton ) { | ||
return; | ||
} | ||
|
||
event.preventDefault(); | ||
const number = copyNumberButton.querySelector( 'span' ).innerText; | ||
|
||
if ( ! navigator.clipboard ) { | ||
prompt( | ||
__( 'Copy the test number:', 'woocommerce-payments' ), | ||
number | ||
); | ||
return; | ||
} | ||
navigator.clipboard.writeText( number ); | ||
|
||
window.wp?.data | ||
?.dispatch( 'core/notices' ) | ||
?.createInfoNotice( | ||
__( | ||
'Test number copied to your clipboard!', | ||
'woocommerce-payments' | ||
), | ||
{ | ||
// the unique `id` prevents the JS from creating multiple notices with the same text before they're dismissed. | ||
id: 'woopayments/test-number-copied', | ||
type: 'snackbar', | ||
context: 'wc/checkout/payments', | ||
} | ||
); | ||
copyNumberButton.classList.add( 'state--success' ); | ||
clearTimeout( previousTimeoutRef ); | ||
previousTimeoutRef = setTimeout( () => { | ||
copyNumberButton.classList.remove( 'state--success' ); | ||
}, 2000 ); | ||
}, | ||
false | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.