This repository has been archived by the owner on Feb 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'trunk' of github.com:woocommerce/woocommerce-gutenberg-…
…products-block into add/4965-product-title
- Loading branch information
Showing
43 changed files
with
1,158 additions
and
872 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
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,41 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { NumberFormatValues } from 'react-number-format'; | ||
|
||
/** | ||
Check if that the value is minor than the max price and greater than 0. | ||
*/ | ||
export const isValidMaxValue = ( { | ||
maxConstraint, | ||
minorUnit, | ||
}: { | ||
maxConstraint: number; | ||
minorUnit: number; | ||
} ) => ( { floatValue }: NumberFormatValues ): boolean => { | ||
const maxPrice = maxConstraint / 10 ** minorUnit; | ||
|
||
return floatValue !== undefined && floatValue <= maxPrice && floatValue > 0; | ||
}; | ||
|
||
/** | ||
Check if that the value is minor than the max price and greater than 0. | ||
*/ | ||
export const isValidMinValue = ( { | ||
minConstraint, | ||
currentMaxValue, | ||
minorUnit, | ||
}: { | ||
minConstraint: number; | ||
currentMaxValue: number; | ||
minorUnit: number; | ||
} ) => ( { floatValue }: NumberFormatValues ): boolean => { | ||
const minPrice = minConstraint / 10 ** minorUnit; | ||
const currentMaxPrice = currentMaxValue / 10 ** minorUnit; | ||
|
||
return ( | ||
floatValue !== undefined && | ||
floatValue >= minPrice && | ||
floatValue < currentMaxPrice | ||
); | ||
}; |
10 changes: 1 addition & 9 deletions
10
assets/js/blocks/cart-checkout/checkout/inner-blocks/checkout-payment-block/block.tsx
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,22 +1,14 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { StoreNoticesProvider } from '@woocommerce/base-context'; | ||
import { useEmitResponse } from '@woocommerce/base-context/hooks'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import { PaymentMethods } from '../../../payment-methods'; | ||
|
||
const Block = (): JSX.Element | null => { | ||
const { noticeContexts } = useEmitResponse(); | ||
|
||
return ( | ||
<StoreNoticesProvider context={ noticeContexts.PAYMENTS }> | ||
<PaymentMethods /> | ||
</StoreNoticesProvider> | ||
); | ||
return <PaymentMethods />; | ||
}; | ||
|
||
export default Block; |
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
Oops, something went wrong.