Skip to content
This repository was archived by the owner on Sep 4, 2025. It is now read-only.

Commit 0ca02a9

Browse files
authored
Merge pull request #685 from unitaryfund/673-enhance-footer-submit-button
Updating styling of Mailchimp button.
2 parents e7df515 + b03bc27 commit 0ca02a9

File tree

1 file changed

+46
-1
lines changed

1 file changed

+46
-1
lines changed

src/components/simple-react-footer/SimpleReactFooter.js

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,45 @@ import './SimpleReactFooter.sass'
44
import MailchimpSubscribe from 'react-mailchimp-subscribe'
55
import { FaDiscord, FaGithub, FaPinterestSquare, FaTwitterSquare } from 'react-icons/fa'
66
import { ImFacebook2, ImInstagram, ImLinkedin, ImTwitch, ImYoutube } from 'react-icons/im'
7+
import { Button } from 'react-bootstrap'
78
import logo from './../../images/unitary_fund_logo.png'
89

10+
11+
const CustomMailchimpForm = ({ status, message, onValidated }) => {
12+
let email;
13+
const submit = () =>
14+
email &&
15+
email.value.indexOf("@") > -1 &&
16+
onValidated({
17+
EMAIL: email.value,
18+
});
19+
20+
return (
21+
<div>
22+
{status === "sending" && <div style={{ color: "blue" }}>sending...</div>}
23+
{status === "error" && (
24+
<div
25+
style={{ color: "red" }}
26+
dangerouslySetInnerHTML={{ __html: message }}
27+
/>
28+
)}
29+
{status === "success" && (
30+
<div
31+
style={{ color: "green" }}
32+
dangerouslySetInnerHTML={{ __html: message }}
33+
/>
34+
)}
35+
<input
36+
ref={node => (email = node)}
37+
type="email"
38+
placeholder="Your email"
39+
/>
40+
<Button variant='primary' className='metriq-navbar-button' onClick={submit}>Submit</Button>
41+
</div>
42+
);
43+
};
44+
45+
946
class SimpleReactFooter extends React.Component {
1047
render () {
1148
return (
@@ -50,7 +87,15 @@ class SimpleReactFooter extends React.Component {
5087
<div style={{ color: this.props.copyrightColor || 'grey' }} className='copyright'>Questions? Email: <a href='mailto:[email protected]'>[email protected]</a></div>
5188
<div>
5289
<label>Stay up to date on metriq.info!</label>
53-
<MailchimpSubscribe url='https://fund.us18.list-manage.com/subscribe/post?u=104796c75ced8350ebd01eebd&amp;id=a2c9e5ac2a' />
90+
<MailchimpSubscribe
91+
url='https://fund.us18.list-manage.com/subscribe/post?u=104796c75ced8350ebd01eebd&amp;id=a2c9e5ac2a'
92+
render={({ subscribe, status, message }) => (
93+
<CustomMailchimpForm
94+
status={status}
95+
message={message}
96+
onValidated={formData => subscribe(formData)}
97+
/>
98+
)}/>
5499
</div>
55100
<div style={{ color: this.props.copyrightColor || 'grey' }} className='copyright'>All content on this website is openly licensed under <a href='https://creativecommons.org/licenses/by-sa/4.0/'>CC-BY-SA</a>. Members agree to the <a href='/MetriqTermsofUse' target='_blank'>Metriq Platform Terms of Use</a>.</div>
56101
<div style={{ color: this.props.copyrightColor || 'grey' }} className='copyright'>Copyright &copy; {this.props.copyright}</div>

0 commit comments

Comments
 (0)