react-code-dataset / wp-calypso /client /my-sites /checkout /src /components /CheckoutMoneyBackGuarantee.tsx
react-code-dataset / wp-calypso /client /my-sites /checkout /src /components /CheckoutMoneyBackGuarantee.tsx
Download wp-calypso/client/my-sites/checkout/src/components/CheckoutMoneyBackGuarantee.tsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 983 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/my-sites/checkout/src/components/CheckoutMoneyBackGuarantee.tsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/my-sites/checkout/src/components/CheckoutMoneyBackGuarantee.tsx
-
curl -L -o CheckoutMoneyBackGuarantee.tsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/my-sites/checkout/src/components/CheckoutMoneyBackGuarantee.tsx
983 Bytes
| import { isChargeback, isCredits } from '@automattic/calypso-products'; | |
| import { ResponseCart } from '@automattic/shopping-cart'; | |
| import styled from '@emotion/styled'; | |
| import { CheckoutSummaryRefundWindows } from './wp-checkout-order-summary'; | |
| const CheckoutMoneyBackGuaranteeWrapper = styled.div` | |
| display: flex; | |
| justify-content: center; | |
| align-items: center; | |
| margin: 1.5em 0 0; | |
| & p { | |
| font-size: 14px; | |
| margin: 0 0 0 0.5rem; | |
| padding: 0; | |
| } | |
| `; | |
| export function CheckoutMoneyBackGuarantee( { cart }: { cart: ResponseCart } ) { | |
| // Return early if the cart is only Chargebacks fees | |
| if ( cart.products.every( isChargeback || isCredits ) ) { | |
| return null; | |
| } | |
| const allCartItemsAreDomains = cart.products.every( | |
| ( product ) => product.is_domain_registration === true | |
| ); | |
| return ( | |
| ! allCartItemsAreDomains && ( | |
| <CheckoutMoneyBackGuaranteeWrapper> | |
| <CheckoutSummaryRefundWindows cart={ cart } includeRefundIcon /> | |
| </CheckoutMoneyBackGuaranteeWrapper> | |
| ) | |
| ); | |
| } | |