Skip to content

Commit 6988999

Browse files
committed
Fixing movement form
1 parent 465476c commit 6988999

24 files changed

+5343
-2581
lines changed

docs/books/Risk-First-Second-Edition.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ tags:
1010
sidebar_position: 1
1111
---
1212

13-
I'm pleased to announce that the second edition of Risk-First Software Development is [now available in Beta](https://pragprog.com/titles/rmrfsd/risk-first-software-development-second-edition)!
13+
I'm pleased to announce that the second edition of Risk-First Software Development is [now available in Beta](https://pragprog.com/titles/rmrfsd/risk-first-software-development-second-edition)! Read on to find out how to get a free copy.
1414

1515
[![Risk-First Software Development Second Edition](/img/Cover_Image_Second_Edition.jpg)](https://pragprog.com/titles/rmrfsd/risk-first-software-development-second-edition)
1616

17+
## Get Involved!
18+
19+
<Movement />
20+
1721
## About Risk-First Software Development - Second Edition
1822

1923
**Over 20 years ago an "Agile" revolution occurred** in the software development field.  But 20 years later, the very same proponents of the revolution are turning their backs on what they created, arguing that their ideals have been corrupted by zealotry, proscriptive norms, cargo-culting and an "Agile-Industrial Complex" focused on evangelism and certification.
@@ -50,9 +54,7 @@ Once the book is declared "finished", it'll get published proper and you'll get
5054

5155
</BoxOut>
5256

53-
## Please Help!
54-
55-
<Movement />
57+
## Join Us On GitHub!
5658

5759
<BoxOut title="Join The Risk-First GitHub Organisation">
5860

docusaurus.config.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,7 @@ const config = {
6666
blog: false,
6767
theme: {
6868
customCss: './src/css/custom.css',
69-
},
70-
gtag: {
71-
trackingID: 'G-TN9XHX17P8',
72-
anonymizeIP: true,
73-
},
69+
}
7470
}),
7571
],
7672
],

src/components/Movement/index.js

Lines changed: 107 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,72 @@
1-
import React, { useState } from 'react';
1+
import React, { useState, useEffect } from 'react';
22
import BrowserOnly from '@docusaurus/BrowserOnly';
33
import styles from './styles.module.css';
44

5+
const PAGE_URL = 'https://riskfirst.org/Risk-First-Second-Edition';
6+
57
export default function Movement() {
68
const [formData, setFormData] = useState({
79
email: '',
810
socialLink: '',
911
});
1012
const [isSubmitted, setIsSubmitted] = useState(false);
13+
const [linkedInLoaded, setLinkedInLoaded] = useState(false);
14+
15+
// Load platform SDKs
16+
useEffect(() => {
17+
if (typeof window !== 'undefined') {
18+
// Load LinkedIn SDK
19+
if (!window.IN) {
20+
const linkedInScript = document.createElement('script');
21+
linkedInScript.src = 'https://platform.linkedin.com/in.js';
22+
linkedInScript.type = 'text/javascript';
23+
linkedInScript.innerHTML = 'lang: en_US';
24+
linkedInScript.onload = () => {
25+
setLinkedInLoaded(true);
26+
};
27+
document.head.appendChild(linkedInScript);
28+
} else {
29+
setLinkedInLoaded(true);
30+
}
31+
32+
// Load Twitter SDK
33+
if (!window.twttr) {
34+
const twitterScript = document.createElement('script');
35+
twitterScript.src = 'https://platform.twitter.com/widgets.js';
36+
twitterScript.async = true;
37+
document.head.appendChild(twitterScript);
38+
}
39+
40+
// Load Facebook SDK
41+
if (!window.FB) {
42+
const facebookScript = document.createElement('script');
43+
facebookScript.src = 'https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v18.0';
44+
facebookScript.async = true;
45+
document.head.appendChild(facebookScript);
46+
}
47+
}
48+
}, []);
49+
50+
// Reinitialize widgets when SDKs load
51+
useEffect(() => {
52+
if (typeof window !== 'undefined') {
53+
// Reinitialize Twitter widgets
54+
if (window.twttr && window.twttr.widgets) {
55+
window.twttr.widgets.load();
56+
}
57+
58+
// Reinitialize Facebook widgets
59+
if (window.FB && window.FB.XFBML) {
60+
window.FB.XFBML.parse();
61+
}
62+
63+
// Reinitialize LinkedIn widgets
64+
if (window.IN && window.IN.parse) {
65+
window.IN.parse();
66+
}
67+
}
68+
}, [linkedInLoaded]);
69+
1170

1271
const handleInputChange = (e) => {
1372
const { name, value } = e.target;
@@ -27,7 +86,7 @@ export default function Movement() {
2786
console.log('Current hostname:', window.location.hostname);
2887

2988
// Use HTTPS through Cloudflare
30-
const response = await fetch('https://automation.riskfirst.org:8080/api/movement/submit', {
89+
const response = await fetch('https://automation.riskfirst.org/api/movement/submit', {
3190
method: 'POST',
3291
headers: {
3392
'Content-Type': 'application/json',
@@ -79,60 +138,66 @@ export default function Movement() {
79138
<section className={styles.movementSection}>
80139
<BrowserOnly>
81140
{() => {
82-
const shareLinks = {
83-
linkedin: 'https://www.linkedin.com/sharing/share-offsite/?url=' + encodeURIComponent(window.location.href),
84-
twitter: 'https://twitter.com/intent/tweet?url=' + encodeURIComponent(window.location.href) + '&text=' + encodeURIComponent('Check out Risk-First Software Development - a new way of thinking about how software really gets built!'),
85-
facebook: 'https://www.facebook.com/sharer/sharer.php?u=' + encodeURIComponent(window.location.href)
86-
};
87-
88141
return (
89142
<div className={styles.container}>
90143
<div className={styles.content}>
91-
<h2 className={styles.title}>Let's Create a Movement 🚀</h2>
144+
<h2 className={styles.title}>Read It For Free 🚀</h2>
92145
<div className={styles.text}>
93146
<p>
94147
Risk-First is more than just a book — it's a different way to think about how software really gets built.
95-
And movements only grow when people share them.
148+
And movements only grow when people talk about them.
96149
</p>
97150
<p>
98-
If you want in on the ground floor of a new movement, please help spread the word and get rewarded:
151+
If you want in on the ground floor of a new movement, please help spread the word and get rewarded with a free copy.
99152
</p>
100-
<ol className={styles.steps}>
101-
<li>Share this page on LinkedIn, X (Twitter), or your favorite platform.</li>
102-
<li>Fill out this quick form with your email address and a link to your post.</li>
103-
<li>Get rewarded — I'll send you a special discount code to grab a <strong>free</strong> digital copy of Risk-First Software Development, Second Edition (Beta).</li>
104-
</ol>
105153
</div>
106154

107-
<div className={styles.shareButtons}>
108-
<a
109-
href={shareLinks.linkedin}
110-
target="_blank"
111-
rel="noopener noreferrer"
112-
className={styles.shareButton}
113-
>
114-
Share on LinkedIn
115-
</a>
116-
<a
117-
href={shareLinks.twitter}
118-
target="_blank"
119-
rel="noopener noreferrer"
120-
className={styles.shareButton}
121-
>
122-
Share on X (Twitter)
123-
</a>
124-
<a
125-
href={shareLinks.facebook}
126-
target="_blank"
127-
rel="noopener noreferrer"
128-
className={styles.shareButton}
129-
>
130-
Share on Facebook
131-
</a>
155+
<div className={styles.form}>
156+
<h3 className={styles.formTitle}>👉 Step 1: Share the Page</h3>
157+
158+
<p>Share this page on LinkedIn, X (Twitter), or your favorite platform</p>
159+
160+
{/* LinkedIn Share Button */}
161+
162+
<div className={styles.shareButtons}>
163+
<div className={styles.shareWidget}>
164+
<script
165+
type="IN/Share"
166+
data-url={PAGE_URL}
167+
dangerouslySetInnerHTML={{ __html: '' }}
168+
></script>
169+
</div>
170+
171+
{/* Twitter Share Button */}
172+
<div className={styles.shareWidget}>
173+
<a
174+
href="https://twitter.com/share?ref_src=twsrc%5Etfw"
175+
className="twitter-share-button"
176+
data-url={PAGE_URL}
177+
data-text="Check out Risk-First Software Development - a new way of thinking about how software really gets built!"
178+
data-show-count="false"
179+
>
180+
Tweet
181+
</a>
182+
</div>
183+
184+
{/* Facebook Share Button */}
185+
<div className={styles.shareWidget}>
186+
<div
187+
className="fb-share-button"
188+
data-href={PAGE_URL}
189+
data-layout="button"
190+
data-size="large"
191+
>
192+
</div>
193+
</div>
194+
</div>
132195
</div>
133196

134197
<form className={styles.form} onSubmit={handleSubmit}>
135-
<h3 className={styles.formTitle}>👉 Share the Page & Claim Your Free Copy</h3>
198+
<h3 className={styles.formTitle}>👉 Step 2: Claim Your Free Copy</h3>
199+
200+
<p>"Please send me a 109% discount code to get a free copy of Risk-First Software Development, Second Edition."</p>
136201

137202
<div className={styles.formGroup}>
138203
<label htmlFor="email" className={styles.label}>

src/components/Movement/styles.module.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,14 @@
8282
justify-content: center;
8383
margin: 3rem 0;
8484
flex-wrap: wrap;
85+
align-items: center;
86+
}
87+
88+
.shareWidget {
89+
display: flex;
90+
align-items: center;
91+
justify-content: center;
92+
min-height: 40px;
8593
}
8694

8795
.shareButton {
@@ -94,6 +102,10 @@
94102
transition: all 0.3s ease;
95103
border: 2px solid rgba(255, 255, 255, 0.3);
96104
backdrop-filter: blur(10px);
105+
cursor: pointer;
106+
font-size: inherit;
107+
font-family: inherit;
108+
display: inline-block;
97109
}
98110

99111
.shareButton:hover {

src/images/generated/introduction/development_process_1.adl

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,7 @@
44
xmlns="http://www.kite9.org/schema/adl"
55
xmlns:xslt="http://www.kite9.org/schema/xslt" id="dia" style="--kite9-min-width: 600pt;">
66

7-
<container id="c" bordered="true">
8-
9-
<risk id="id_0" class="goal">Feature X</risk>
10-
11-
<label id="id_16">
12-
Internal Model
13-
14-
</label>
15-
</container>
7+
<risk id="id_0" class="goal">Deliver Feature X</risk>
168

179
<action>Specification</action>
1810
<action>Code and Unit Test</action>

src/images/generated/introduction/development_process_2.adl

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,7 @@
55
xmlns:xslt="http://www.kite9.org/schema/xslt" id="dia"
66
name="Development Process 1" style="--kite9-min-width: 600pt;">
77

8-
<container id="c" bordered="true">
9-
10-
<risk id="id_0" class="goal">Feature X</risk>
11-
12-
<label id="id_16">
13-
Internal Model
14-
15-
</label>
16-
</container>
8+
<risk id="id_0" class="goal">Deliver Feature X</risk>
179

1810
<action>Code</action>
1911
<action>Release</action>

src/images/generated/introduction/development_process_3.adl

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,7 @@
44
xmlns="http://www.kite9.org/schema/adl"
55
xmlns:xslt="http://www.kite9.org/schema/xslt" id="dia" style="--kite9-min-width: 600pt;">
66

7-
<container id="c" bordered="true">
8-
9-
<risk id="id_0" class="goal">Feature X</risk>
10-
11-
<label id="id_16">
12-
Internal Model
13-
14-
</label>
15-
</container>
7+
<risk id="id_0" class="goal">Deliver Feature X</risk>
168

179
<action>Code</action>
1810
<action>Release</action>
Lines changed: 12 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,18 @@
11
<diagram xmlns="http://www.kite9.org/schema/adl" xmlns:xslt="http://www.kite9.org/schema/xslt" id="dia" style="--kite9-min-width: 600pt;" xslt:template="/public/templates/risk-first/risk-first-template.xsl">
22
<group id="jeff" style="--kite9-vertical-align: top; ">
3-
<container bordered="true" id="c">
4-
<risk class="goal" id="id_0">Feature X</risk>
5-
<label id="id_16">
6-
Internal Model
7-
8-
</label>
9-
</container>
3+
<risk class="goal" id="id_0">Deliver Feature X</risk>
104
</group>
115
<action id="cat">Write Specification</action>
12-
<group id="bob" style="--kite9-layout: down">
13-
<container id="d">
14-
<hidden>
15-
<risk class="attendant">Incorrect
16-
Implementation
17-
</risk>
18-
</hidden>
19-
<hidden>
20-
<risk class="attendant">Duplicates
21-
Functionality
22-
</risk>
23-
</hidden>
24-
<label id="4">
25-
Internal Model
26-
</label>
27-
</container>
28-
<artifact>Specification</artifact>
6+
<group id="bob" style="--kite9-layout: right">
7+
<hidden>
8+
<risk class="attendant">Incorrect
9+
Implementation
10+
</risk>
11+
</hidden>
12+
<hidden>
13+
<risk class="attendant">Duplicates
14+
Functionality
15+
</risk>
16+
</hidden>
2917
</group>
30-
<align id="2-0" style="--kite9-direction: right; ">
31-
<from id="2-0-0" reference="c"/>
32-
<to id="2-0-1" reference="cat"/>
33-
</align>
34-
<align id="2-1" style="--kite9-direction: right; ">
35-
<from id="2-1-0" reference="cat"/>
36-
<to id="2-1-1" reference="d"/>
37-
</align>
3818
</diagram>

0 commit comments

Comments
 (0)