src
5 years ago
badges.stories.js
5 years ago
components.stories.js
5 years ago
examples.stories.js
5 years ago
icons.stories.js
5 years ago
items.stories.js
5 years ago
components.stories.js
88 lines
| 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 = () => Styles + |
| 18 | section |
| 19 | .replace( /{{\s*title\s*}}/gi, 'Connect a payment gateway to begin accepting donations' ) |
| 20 | .replace( /{{\s*badge\s*}}/gi, '<span class="badge badge-complete">Complete</span>' ) |
| 21 | .replace( /{{\s*contents\s*}}/gi, '' ) |
| 22 | .replace( /{{\s*footer\s*}}/gi, '' ); |
| 23 | |
| 24 | export const Footer = () => Styles + |
| 25 | '<section>' + |
| 26 | footer.replace( /{{\s*contents\s*}}/gi, '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>' ) + |
| 27 | '</section>' |
| 28 | ; |
| 29 | |
| 30 | export const Dismiss = () => Styles + |
| 31 | dismiss |
| 32 | .replace( /{{\s*action\s*}}/gi, '' ) |
| 33 | .replace( /{{\s*nonce\s*}}/gi, '' ) |
| 34 | .replace( /{{\s*label\s*}}/gi, 'Dismiss Setup Screen' ); |
| 35 | |
| 36 | export const SectionBasic = () => Styles + ` |
| 37 | <section> |
| 38 | <header> |
| 39 | <h2>Connect a payment gateway to begin accepting donations</h2> |
| 40 | </header> |
| 41 | <main> |
| 42 | ` + paypal() + ` |
| 43 | </main> |
| 44 | </section> |
| 45 | `; |
| 46 | |
| 47 | export const SectionMultiple = () => Styles + ` |
| 48 | <section> |
| 49 | <main> |
| 50 | ` + paypal() + stripe() + ` |
| 51 | </main> |
| 52 | </section> |
| 53 | `; |
| 54 | |
| 55 | export const SectionWithHeader = () => Styles + ` |
| 56 | <section> |
| 57 | <header> |
| 58 | <h2>Connect a payment gateway to begin accepting donations</h2> |
| 59 | </header> |
| 60 | <main> |
| 61 | ` + paypal() + ` |
| 62 | </main> |
| 63 | </section> |
| 64 | `; |
| 65 | |
| 66 | export const SectionWithFooter = () => Styles + ` |
| 67 | <section> |
| 68 | <main> |
| 69 | ` + paypal() + ` |
| 70 | </main> |
| 71 | ` + |
| 72 | footer.replace( /{{\s*contents\s*}}/gi, '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>' ) + |
| 73 | ` |
| 74 | </section> |
| 75 | `; |
| 76 | |
| 77 | export const SectionMarkedComplete = () => Styles + ` |
| 78 | <section> |
| 79 | <header> |
| 80 | <h2>Connect a payment gateway to begin accepting donations</h2> |
| 81 | <span class="badge badge-complete">Complete</span> |
| 82 | </header> |
| 83 | <main> |
| 84 | ` + paypal() + ` |
| 85 | </main> |
| 86 | </section> |
| 87 | `; |
| 88 |