| 1 |
import styles from './src/styles'; |
| 2 |
import paypal from './src/paypal.js'; |
| 3 |
import stripe from './src/stripe.js'; |
| 4 |
import section from '../section.html'; |
| 5 |
import footer from '../footer.html'; |
| 6 |
import dismiss from '../dismiss.html'; |
| 7 |
|
| 8 |
import {withA11y} from '@storybook/addon-a11y'; |
| 9 |
|
| 10 |
export default { |
| 11 |
title: 'Setup Page/Components', |
| 12 |
decorators: [withA11y], |
| 13 |
}; |
| 14 |
|
| 15 |
const Styles = '<style>' + styles + '</style>'; |
| 16 |
|
| 17 |
export const header = () => |
| 18 |
Styles + |
| 19 |
section |
| 20 |
.replace(/{{\s*title\s*}}/gi, 'Connect a payment gateway to begin accepting donations') |
| 21 |
.replace(/{{\s*badge\s*}}/gi, '<span class="badge badge-complete">Complete</span>') |
| 22 |
.replace(/{{\s*contents\s*}}/gi, '') |
| 23 |
.replace(/{{\s*footer\s*}}/gi, ''); |
| 24 |
|
| 25 |
export const Footer = () => |
| 26 |
Styles + |
| 27 |
'<section>' + |
| 28 |
footer.replace( |
| 29 |
/{{\s*contents\s*}}/gi, |
| 30 |
'Want to use a different gateway? GiveWP has support for many others including Authorize.net, Square, Razorpay and more!<a href="#">View all gateways</a>' |
| 31 |
) + |
| 32 |
'</section>'; |
| 33 |
|
| 34 |
export const Dismiss = () => |
| 35 |
Styles + |
| 36 |
dismiss |
| 37 |
.replace(/{{\s*action\s*}}/gi, '') |
| 38 |
.replace(/{{\s*nonce\s*}}/gi, '') |
| 39 |
.replace(/{{\s*label\s*}}/gi, 'Dismiss Setup Screen'); |
| 40 |
|
| 41 |
export const SectionBasic = () => |
| 42 |
Styles + |
| 43 |
` |
| 44 |
<section> |
| 45 |
<header> |
| 46 |
<h2>Connect a payment gateway to begin accepting donations</h2> |
| 47 |
</header> |
| 48 |
<main> |
| 49 |
` + |
| 50 |
paypal() + |
| 51 |
` |
| 52 |
</main> |
| 53 |
</section> |
| 54 |
`; |
| 55 |
|
| 56 |
export const SectionMultiple = () => |
| 57 |
Styles + |
| 58 |
` |
| 59 |
<section> |
| 60 |
<main> |
| 61 |
` + |
| 62 |
paypal() + |
| 63 |
stripe() + |
| 64 |
` |
| 65 |
</main> |
| 66 |
</section> |
| 67 |
`; |
| 68 |
|
| 69 |
export const SectionWithHeader = () => |
| 70 |
Styles + |
| 71 |
` |
| 72 |
<section> |
| 73 |
<header> |
| 74 |
<h2>Connect a payment gateway to begin accepting donations</h2> |
| 75 |
</header> |
| 76 |
<main> |
| 77 |
` + |
| 78 |
paypal() + |
| 79 |
` |
| 80 |
</main> |
| 81 |
</section> |
| 82 |
`; |
| 83 |
|
| 84 |
export const SectionWithFooter = () => |
| 85 |
Styles + |
| 86 |
` |
| 87 |
<section> |
| 88 |
<main> |
| 89 |
` + |
| 90 |
paypal() + |
| 91 |
` |
| 92 |
</main> |
| 93 |
` + |
| 94 |
footer.replace( |
| 95 |
/{{\s*contents\s*}}/gi, |
| 96 |
'Want to use a different gateway? GiveWP has support for many others including Authorize.net, Square, Razorpay and more!<a href="#">View all gateways</a>' |
| 97 |
) + |
| 98 |
` |
| 99 |
</section> |
| 100 |
`; |
| 101 |
|
| 102 |
export const SectionMarkedComplete = () => |
| 103 |
Styles + |
| 104 |
` |
| 105 |
<section> |
| 106 |
<header> |
| 107 |
<h2>Connect a payment gateway to begin accepting donations</h2> |
| 108 |
<span class="badge badge-complete">Complete</span> |
| 109 |
</header> |
| 110 |
<main> |
| 111 |
` + |
| 112 |
paypal() + |
| 113 |
` |
| 114 |
</main> |
| 115 |
</section> |
| 116 |
`; |
| 117 |
|