Skip to content

Commit 0e04824

Browse files
authored
Merge pull request #156 from risk-first/movement
Added build the movement automation
2 parents b35aa52 + 54b05dd commit 0e04824

File tree

10 files changed

+1939
-13
lines changed

10 files changed

+1939
-13
lines changed

docs/books/Build-The-Movement.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
title: "Build The Movement!"
3+
description: "Read to find out how to get hold of a free copy of RF2E!"
4+
slug: /Build-The-Movement
5+
featured:
6+
class: bg1
7+
element: '<big-image imgsrc="/public/templates/risk-first/posts/Cover_Image_Second_Edition.jpg" />'
8+
tags:
9+
- Books
10+
sidebar_position: 2
11+
---
12+
13+
<Movement />

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ It also contains two entirely new chapters dealing with technological change, re
3838

3939
In essence, this is the post-agile, AI-aware manual for understanding and harnessing the forces of innovation in play when developing software systems.
4040

41-
## Getting Involved
41+
## What's A Beta?
4242

4343
<BoxOut title="What's A Beta For A Book, Anyway?">
4444

@@ -50,6 +50,10 @@ Once the book is declared "finished", it'll get published proper and you'll get
5050

5151
</BoxOut>
5252

53+
## Amplify!
54+
55+
<Movement />
56+
5357
<BoxOut title="Join The Risk-First GitHub Organisation">
5458

5559
If you [Add Your Star on GitHub](https://github.com/risk-first/website) you'll be sent an email invite to join the [Risk-First GitHub Organisation](https://github.com/risk-first/website/discussions) and the associated discussion group!

docs/books/The-Menagerie.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ tags:
88
featured:
99
class: bg1
1010
element: '<big-image imgsrc="/public/templates/risk-first/posts/book-grey.png" />'
11-
sidebar_position: 2
11+
sidebar_position: 3
1212
---
1313

1414
# The Menagerie

src/components/Movement/index.js

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
import React, { useState } from 'react';
2+
import styles from './styles.module.css';
3+
4+
export default function Movement() {
5+
const [formData, setFormData] = useState({
6+
email: '',
7+
socialLink: '',
8+
});
9+
const [isSubmitted, setIsSubmitted] = useState(false);
10+
11+
const handleInputChange = (e) => {
12+
const { name, value } = e.target;
13+
setFormData(prev => ({
14+
...prev,
15+
[name]: value
16+
}));
17+
};
18+
19+
const handleSubmit = async (e) => {
20+
e.preventDefault();
21+
22+
try {
23+
const response = await fetch('http://automation.riskfirst.org:8080/api/movement/submit', {
24+
method: 'POST',
25+
headers: {
26+
'Content-Type': 'application/json',
27+
},
28+
body: JSON.stringify(formData),
29+
});
30+
31+
if (response.ok) {
32+
setIsSubmitted(true);
33+
} else {
34+
console.error('Form submission failed');
35+
alert('There was an error submitting the form. Please try again.');
36+
}
37+
} catch (error) {
38+
console.error('Error submitting form:', error);
39+
alert('There was an error submitting the form. Please try again.');
40+
}
41+
};
42+
43+
const shareLinks = {
44+
linkedin: 'https://www.linkedin.com/sharing/share-offsite/?url=' + encodeURIComponent(window.location.href),
45+
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!'),
46+
facebook: 'https://www.facebook.com/sharer/sharer.php?u=' + encodeURIComponent(window.location.href)
47+
};
48+
49+
if (isSubmitted) {
50+
return (
51+
<section className={styles.movementSection}>
52+
<div className={styles.container}>
53+
<div className={styles.content}>
54+
<h2 className={styles.title}>Thank You! 🎉</h2>
55+
<p className={styles.message}>
56+
Thanks for helping spread the Risk-First movement! Check your email for your special discount code.
57+
</p>
58+
<button
59+
className={styles.button}
60+
onClick={() => setIsSubmitted(false)}
61+
>
62+
Share Again
63+
</button>
64+
</div>
65+
</div>
66+
</section>
67+
);
68+
}
69+
70+
return (
71+
<section className={styles.movementSection}>
72+
<div className={styles.container}>
73+
<div className={styles.content}>
74+
<h2 className={styles.title}>Let's Create a Movement 🚀</h2>
75+
<div className={styles.text}>
76+
<p>
77+
Risk-First is more than just a book — it's a different way to think about how software really gets built.
78+
And movements only grow when people share them.
79+
</p>
80+
<p>
81+
Here's how you can get in on the ground floor of a new movement and help spread the word and get rewarded:
82+
</p>
83+
<ol className={styles.steps}>
84+
<li>Share this page on LinkedIn, X (Twitter), or your favorite platform.</li>
85+
<li>Fill out this quick form with your email address and a link to your post.</li>
86+
<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>
87+
</ol>
88+
</div>
89+
90+
<div className={styles.shareButtons}>
91+
<a
92+
href={shareLinks.linkedin}
93+
target="_blank"
94+
rel="noopener noreferrer"
95+
className={styles.shareButton}
96+
>
97+
Share on LinkedIn
98+
</a>
99+
<a
100+
href={shareLinks.twitter}
101+
target="_blank"
102+
rel="noopener noreferrer"
103+
className={styles.shareButton}
104+
>
105+
Share on X (Twitter)
106+
</a>
107+
<a
108+
href={shareLinks.facebook}
109+
target="_blank"
110+
rel="noopener noreferrer"
111+
className={styles.shareButton}
112+
>
113+
Share on Facebook
114+
</a>
115+
</div>
116+
117+
<form className={styles.form} onSubmit={handleSubmit}>
118+
<h3 className={styles.formTitle}>👉 Share the Page & Claim Your Free Copy</h3>
119+
120+
<div className={styles.formGroup}>
121+
<label htmlFor="email" className={styles.label}>
122+
Email Address *
123+
</label>
124+
<input
125+
type="email"
126+
id="email"
127+
name="email"
128+
value={formData.email}
129+
onChange={handleInputChange}
130+
className={styles.input}
131+
required
132+
placeholder="[email protected]"
133+
/>
134+
</div>
135+
136+
<div className={styles.formGroup}>
137+
<label htmlFor="socialLink" className={styles.label}>
138+
Link to Your Post *
139+
</label>
140+
<input
141+
type="url"
142+
id="socialLink"
143+
name="socialLink"
144+
value={formData.socialLink}
145+
onChange={handleInputChange}
146+
className={styles.input}
147+
required
148+
placeholder="https://linkedin.com/posts/..."
149+
/>
150+
</div>
151+
152+
<button type="submit" className={styles.submitButton}>
153+
Claim My Discount Code
154+
</button>
155+
</form>
156+
157+
<p className={styles.footerText}>
158+
Together, we can build a community that puts risk where it belongs: at the center of how we understand software.
159+
</p>
160+
</div>
161+
</div>
162+
</section >
163+
);
164+
}

0 commit comments

Comments
 (0)