-
-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: Add the Newsletter feature to the website. #308
Changes from 9 commits
d9162a4
acd00e8
d8976e6
2d81616
18406f1
cb8e606
95ce601
c2428ba
5250509
27ff58e
f313f77
f933741
5854389
46c1b31
31dfed6
e711443
be054b4
3661714
562b313
47db7d7
5796e8a
2c91cc9
a363438
c186192
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import React, { useState } from 'react' | ||
import classnames from 'classnames' | ||
|
||
interface NewsletterFormProps { | ||
wrapperClassName?: string | ||
className?: string | ||
} | ||
const NewsletterForm: React.FC<NewsletterFormProps> = ({ wrapperClassName = '', className = '' }) => { | ||
const [email, setEmail] = useState('') | ||
const [username, setUsername] = useState('') | ||
|
||
// const handleSubmit = (e: any) => { | ||
// e.preventDefault() | ||
// // Handle form submission here, such as sending a request to subscribe the user | ||
// } | ||
|
||
// const handleFileChange = (e: any) => { | ||
|
||
// } | ||
|
||
return ( | ||
<section | ||
benjagm marked this conversation as resolved.
Show resolved
Hide resolved
|
||
className={classnames('w-[100vw] mx-auto flex items-center justify-center bg-[#090A11]', wrapperClassName)}> | ||
<div className={classnames('w-full max-w-[900px] text-center px-5 py-9 bg-[#090A11] relative', className)}> | ||
|
||
<h3 className=' font-bold tracking-heading mb-4 text-h3 px-5'> | ||
Subscribe to our newsletter to receive news about Json Schema. | ||
</h3> | ||
<p | ||
className='text-lg mb-8' | ||
> | ||
We respect your inbox. No spam, promise ✌️ | ||
</p> | ||
<form className='flex flex-col md:flex-row gap-4'> | ||
<input | ||
type='text' | ||
name='username' | ||
placeholder='Your Name' | ||
className='form-input block w-full py-3 text-lg sm:text-lg sm:leading-5 md:flex-1 rounded-md px-5 bg-gray-200' | ||
value={username} | ||
onChange={(e: any) => setUsername(e.target.value)} | ||
/> | ||
<input | ||
type='email' | ||
name='email' | ||
placeholder='Your Email' | ||
className='form-input block w-full py-3 text-lg sm:text-lg sm:leading-5 md:flex-1 rounded-md px-5 bg-gray-200' | ||
value={email} | ||
onChange={(e: any) => setEmail(e.target.value)} | ||
/> | ||
<button | ||
benjagm marked this conversation as resolved.
Show resolved
Hide resolved
|
||
type='submit' | ||
className='bg-primary-500 hover:bg-primary-400 text-white bg-[#445cf4] transition-all duration-500 ease-in-out rounded-md px-4 py-3 text-md font-semibold tracking-heading w-full md:mt-0 md:flex-1' | ||
> | ||
<span className='inline-block'>Subscribe</span> | ||
</button> | ||
</form> | ||
</div> | ||
|
||
</section> | ||
) | ||
} | ||
|
||
export default NewsletterForm |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -320,7 +320,7 @@ const Home = (props: any) => { | |
<section className='w-full h-[300px] lg:h-[367px] bg-gradient-to-r from-primary from-1.95% to-endBlue clip-both'> | ||
<div className='lg:w-full mx-auto text-center mt-28 '> | ||
<h2 className='text-h3mobile lg:text-h3 text-white mb-6'>Start contributing to JSON Schema</h2> | ||
<button className='w-[170px] h-[45px] mx-auto rounded border-2 bg-primary text-white font-semibold'><a href='https://github.com/json-schema-org#-contributing-to-json-schema'>Contribute</a></button> | ||
<button className='w-[170px] h-[45px] mx-auto rounded border-2 bg-primary text-white font-semibold'><a href='/newsletter'>Subscribe</a></button> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wha we need here is to show the component itself, no a button to navigate to the newsletter page. We need here to remove that extra step. Make it is easy for the user to subscribe. See my first comment regarding how to make the component use different fonts/colours depending on the context. My expectation is to implement the same approach than asyncapi. They show component in the landing page with white fonts: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added. |
||
</div> | ||
</section> | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React from 'react' | ||
import NewsletterForm from '~/components/Newsletter' | ||
import Layout from '~/components/Layout' | ||
|
||
const index = () => { | ||
return ( | ||
<> | ||
<Layout> | ||
<NewsletterForm className='pt-[100px] bg-white text-black' wrapperClassName='h-[calc(100vh-340px)] bg-white' /> | ||
</Layout> | ||
|
||
</> | ||
) | ||
} | ||
|
||
export default index |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This component is going to be presented in two scenarios:
With that in mind you will need to define an input parameter allowing to define what of those 2 behaviours the component will render.