@@ -1,35 +1,17 @@
|
|||||||
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 { SolidButton } from '../shared/styledComponents'
|
||||||
import { StyledHeading, StyledDesc, InputStyled, StyledAnchor } from './style'
|
import { StyledHeading, StyledDesc, InputStyled, StyledAnchor } from './style'
|
||||||
|
|
||||||
const Footer = () => {
|
const anchorStyles = {
|
||||||
const [email, setEmail] = useState('')
|
color: '#888'
|
||||||
const [emailError, setEmailError] = useState('')
|
|
||||||
|
|
||||||
const handleEmailChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
||||||
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) => {
|
const Footer = () => (
|
||||||
if (emailError) {
|
|
||||||
e.preventDefault()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Section bottomArrow={false}>
|
<Section bottomArrow={false}>
|
||||||
<div className="row">
|
<div className="row">
|
||||||
<div className="col-md-3 me-md-5">
|
<div className="col-md-3 me-md-5">
|
||||||
@@ -47,7 +29,6 @@ const Footer = () => {
|
|||||||
className="kwes-form"
|
className="kwes-form"
|
||||||
method="POST"
|
method="POST"
|
||||||
action="https://kwes.io/api/foreign/forms/mxKuyK4lxZWnG2WNH3ga"
|
action="https://kwes.io/api/foreign/forms/mxKuyK4lxZWnG2WNH3ga"
|
||||||
onSubmit={handleSubmit}
|
|
||||||
>
|
>
|
||||||
<div className="mb-3">
|
<div className="mb-3">
|
||||||
<InputStyled
|
<InputStyled
|
||||||
@@ -56,21 +37,8 @@ const Footer = () => {
|
|||||||
className="form-control"
|
className="form-control"
|
||||||
aria-describedby="emailHelp"
|
aria-describedby="emailHelp"
|
||||||
placeholder="Email Address*"
|
placeholder="Email Address*"
|
||||||
value={email}
|
|
||||||
onChange={handleEmailChange}
|
|
||||||
required
|
required
|
||||||
/>
|
/>
|
||||||
{emailError && (
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
color: 'red',
|
|
||||||
fontSize: '0.875rem',
|
|
||||||
marginTop: '0.25rem'
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{emailError}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
<div className="mb-3">
|
<div className="mb-3">
|
||||||
<InputStyled
|
<InputStyled
|
||||||
@@ -96,13 +64,12 @@ const Footer = () => {
|
|||||||
<StyledHeading>Other Resources</StyledHeading>
|
<StyledHeading>Other Resources</StyledHeading>
|
||||||
<StyledDesc>
|
<StyledDesc>
|
||||||
Visit our educational and fun SAS® software quiz{' '}
|
Visit our educational and fun SAS® software quiz{' '}
|
||||||
<StyledAnchor href="https://sasensei.com">Sasensei</StyledAnchor>{' '}
|
<StyledAnchor href="https://sasensei.com">Sasensei</StyledAnchor> and
|
||||||
and test your knowledge of SAS topics.
|
test your knowledge of SAS topics.
|
||||||
</StyledDesc>
|
</StyledDesc>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Section>
|
</Section>
|
||||||
)
|
)
|
||||||
}
|
|
||||||
|
|
||||||
export default Footer
|
export default Footer
|
||||||
|
|||||||
Reference in New Issue
Block a user