PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.17.0
GiveWP – Donation Plugin and Fundraising Platform v4.17.0
4.17.0 4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 All 256 releases
give / src / Onboarding / Setup / templates / stories / components.stories.js

components.stories.js in GiveWP – Donation Plugin and Fundraising Platform 4.17.0, at src/Onboarding/Setup/templates/stories/components.stories.js

117 lines 2.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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