From 67eabbe55fb14870a701bc8bdc848c8affb8d55b Mon Sep 17 00:00:00 2001 From: s Date: Sat, 13 Dec 2025 17:43:07 +0100 Subject: [PATCH 1/4] revert: contact form fix This reverts commit dc0db8e8f252ce6939823eaf5d7e90762b83e6bc. Wrong form. --- src/components/footer/index.tsx | 169 +++++++++++++------------------- 1 file changed, 68 insertions(+), 101 deletions(-) diff --git a/src/components/footer/index.tsx b/src/components/footer/index.tsx index 5e7c6c8..1bf26cd 100644 --- a/src/components/footer/index.tsx +++ b/src/components/footer/index.tsx @@ -1,108 +1,75 @@ -import React, { useState } from 'react' +import React from 'react' +import { Link } from 'gatsby' -import { Section } from '../shared' +// import dcLogo from "../../images/dclogo.png"; + +import { Container, Section } from '../shared' import { SolidButton } from '../shared/styledComponents' import { StyledHeading, StyledDesc, InputStyled, StyledAnchor } from './style' -const Footer = () => { - const [email, setEmail] = useState('') - const [emailError, setEmailError] = useState('') - - const handleEmailChange = (e: React.ChangeEvent) => { - const value = e.target.value - setEmail(value) - - if ( - value && - (value.toLowerCase().includes('@gmail.com') || - value.toLowerCase().includes('@googlemail.com')) - ) { - setEmailError('Gmail addresses are not allowed.') - } else { - setEmailError('') - } - } - - const handleSubmit = (e: React.FormEvent) => { - if (emailError) { - e.preventDefault() - } - } - - return ( -
-
-
- Data Controller - - Data Controller is a product of 4GL Apps, a brand of Bowe IO Ltd, - which is a UK company with a focus on SAS Software,{' '} - Apps, and - Services. - -
-
- Newsletter -
-
- - {emailError && ( -
- {emailError} -
- )} -
-
- -
-
- -
- Subscribe -
-
-
- Other Resources - - Visit our educational and fun SAS® software quiz{' '} - Sasensei{' '} - and test your knowledge of SAS topics. - -
-
-
- ) +const anchorStyles = { + color: '#888' } +const Footer = () => ( +
+
+
+ Data Controller + + Data Controller is a product of 4GL Apps, a brand of Bowe IO Ltd, + which is a UK company with a focus on SAS Software,{' '} + Apps, and + Services. + +
+
+ Newsletter +
+
+ +
+
+ +
+
+ +
+ Subscribe +
+
+
+ Other Resources + + Visit our educational and fun SAS® software quiz{' '} + Sasensei and + test your knowledge of SAS topics. + +
+
+
+) + export default Footer -- 2.43.0 From f17ab261ce5f34b3b60f4e62a124ae0971b255fb Mon Sep 17 00:00:00 2001 From: s Date: Sat, 13 Dec 2025 17:44:25 +0100 Subject: [PATCH 2/4] fix: add new tab to more external links --- src/components/footer/index.tsx | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/components/footer/index.tsx b/src/components/footer/index.tsx index 1bf26cd..f18f62d 100644 --- a/src/components/footer/index.tsx +++ b/src/components/footer/index.tsx @@ -19,8 +19,14 @@ const Footer = () => ( Data Controller is a product of 4GL Apps, a brand of Bowe IO Ltd, which is a UK company with a focus on SAS Software,{' '} - Apps, and - Services. + + Apps + + , and Services.
@@ -64,8 +70,14 @@ const Footer = () => ( Other Resources Visit our educational and fun SAS® software quiz{' '} - Sasensei and - test your knowledge of SAS topics. + + Sasensei + {' '} + and test your knowledge of SAS topics.
-- 2.43.0 From 6537e3aee102337b87da483b3730a9815c2a9fa6 Mon Sep 17 00:00:00 2001 From: s Date: Sat, 13 Dec 2025 17:45:04 +0100 Subject: [PATCH 3/4] chore: remove unused variables --- src/components/footer/index.tsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/components/footer/index.tsx b/src/components/footer/index.tsx index f18f62d..998e394 100644 --- a/src/components/footer/index.tsx +++ b/src/components/footer/index.tsx @@ -1,9 +1,5 @@ import React from 'react' -import { Link } from 'gatsby' - -// import dcLogo from "../../images/dclogo.png"; - -import { Container, Section } from '../shared' +import { Section } from '../shared' import { SolidButton } from '../shared/styledComponents' import { StyledHeading, StyledDesc, InputStyled, StyledAnchor } from './style' -- 2.43.0 From 8434c781d67958c78afa040978edf5aa7c01681b Mon Sep 17 00:00:00 2001 From: s Date: Sat, 13 Dec 2025 17:53:11 +0100 Subject: [PATCH 4/4] fix: contact form --- src/pages/contact.tsx | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/src/pages/contact.tsx b/src/pages/contact.tsx index 7dede26..0a2139b 100644 --- a/src/pages/contact.tsx +++ b/src/pages/contact.tsx @@ -37,10 +37,28 @@ const Contact: React.FC> = ({ data, location }) => { const [name, setName] = useState() const [email, setEmail] = useState() + const [emailError, setEmailError] = useState(false) const [subject, setSubject] = useState() const [message, setMessage] = useState() const [notification, setNotification] = useState() + const handleEmailChange = (e: React.ChangeEvent) => { + const value = e.target.value + setEmail(value) + + if ( + value && + (value.toLowerCase().includes('@gmail.com') || + value.toLowerCase().includes('@googlemail.com')) + ) { + setEmailError(true) + setNotification('Gmail addresses are not allowed.') + } else { + setEmailError(false) + setNotification(undefined) + } + } + const getBorderStyle = (value: string | undefined) => value === undefined ? {} : value ? {} : { border: '1px solid red' } @@ -66,6 +84,11 @@ const Contact: React.FC> = ({ data, location }) => { onSubmit={async (evt) => { evt.preventDefault() + // Prevent sending if emailError is set + if (emailError) { + return + } + if (name && email && subject && message) { const res = await nostrController .sendDM( @@ -121,10 +144,7 @@ Message: ${message}` name="email" rules="required|email" aria-describedby="emailHelp" - onChange={(evt) => { - setEmail(evt.target.value) - setNotification(undefined) - }} + onChange={handleEmailChange} style={getBorderStyle(email)} />
-- 2.43.0