Skip to content

Feat: Add the Newsletter feature to the website. #489

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

Merged
merged 24 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
9e711dc
initialize the Test directory.
AyushNautiyalDeveloper Feb 12, 2024
2a29731
Added the subscribe button.
AyushNautiyalDeveloper Feb 13, 2024
4ea10ac
Added the subscribe page.
AyushNautiyalDeveloper Feb 13, 2024
d5c2852
Added the newsletter page.
AyushNautiyalDeveloper Feb 15, 2024
f5fb68c
changed name to newsletter.
AyushNautiyalDeveloper Feb 15, 2024
3b99522
removed the unwated code.
AyushNautiyalDeveloper Feb 15, 2024
95e9ead
removed the unwated components.
AyushNautiyalDeveloper Feb 15, 2024
b14d1d8
decreased the horizontal width and changed the color.
AyushNautiyalDeveloper Feb 20, 2024
ae97a6b
decreased the font size.
AyushNautiyalDeveloper Feb 20, 2024
23b9956
Added the changes for the newsletter banner.
AyushNautiyalDeveloper Feb 22, 2024
35e41e2
Added the newletter component to landing page.
AyushNautiyalDeveloper Feb 22, 2024
a6627ce
added the color for input.
AyushNautiyalDeveloper Feb 22, 2024
fd4d377
Added the required horizontal padding.
AyushNautiyalDeveloper Feb 24, 2024
c11ed82
Added the required horizontal padding. for newsletter page.
AyushNautiyalDeveloper Feb 24, 2024
4502abb
Add changes to make it work with mailchimp
benjagm Feb 24, 2024
6590b4d
added the yarn file back.
AyushNautiyalDeveloper Mar 9, 2024
d6b6b8a
Added yarn.lock file.
AyushNautiyalDeveloper Mar 9, 2024
768573c
Update yarn.lock
ayushnau Mar 9, 2024
ec281d3
linted the newsletter.tsx
AyushNautiyalDeveloper Mar 9, 2024
286b955
linted newsletter
AyushNautiyalDeveloper Mar 9, 2024
cf17a9c
fix the index.page
AyushNautiyalDeveloper Mar 9, 2024
bacca00
Small improvement in page layout.
benjagm Mar 20, 2024
ed6e854
Fix dark theme behavior
benjagm Mar 20, 2024
120b710
.
benjagm Mar 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 92 additions & 0 deletions components/Newsletter.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
import React, { useState } from 'react';
import classnames from 'classnames';

interface NewsletterFormProps {
wrapperClassName?: string;
className?: string;
background?: 'white' | 'black';
}

const NewsletterForm: React.FC<NewsletterFormProps> = ({
wrapperClassName = '',
className = '',
background = 'white',
}) => {
const [email, setEmail] = useState('');
const [username, setUsername] = useState('');
const formAction =
'https://json-schema.us8.list-manage.com/subscribe/post?u=ef8789d5789a6aff8113a701d&amp;id=11103c248b&amp;f_id=00822be0f0';

return (
<section
className={classnames(
'w-[100vw] mx-auto flex items-center justify-center ',
background === 'white'
? 'bg-white dark:bg-transparent text-black'
: 'bg-transparent text-white',
wrapperClassName,
)}
>
<div
className={classnames(
'w-full max-w-[900px] text-center px-5 py-9 relative',
background === 'white'
? 'bg-white dark:bg-transparent'
: 'bg-transparent',
className,
)}
>
<h3 className=' font-bold tracking-heading mb-4 text-h4 md:text-h3 px-5 dark:text-slate-50'>
Subscribe to our newsletter to receive news about Json Schema.
</h3>
<p className='text-lg mb-8 dark:text-slate-50'>
We respect your inbox. No spam, promise ✌️
</p>
<form
action={formAction}
method='post'
className='flex flex-col md:flex-row gap-4'
>
<input
type='text'
name='FNAME'
placeholder='Your Name'
className={classnames(
'form-input block w-full py-3 text-lg h-[38px] sm:h-[45px] sm:text-lg sm:leading-5 border-2 md:flex-1 rounded px-5 bg-gray-200 text-black',
background == 'black' ? 'bg-white' : '',
)}
value={username}
onChange={(e: any) => setUsername(e.target.value)}
/>
<input
type='email'
name='EMAIL'
placeholder='Your Email'
className={classnames(
'form-input block w-full py-3 text-lg sm:text-lg border-2 sm:leading-5 h-[38px] sm:h-[45px] md:flex-1 rounded px-5 bg-gray-200 text-black',
background == 'black' ? 'bg-white' : '',
)}
value={email}
onChange={(e: any) => setEmail(e.target.value)}
/>
<button
type='submit'
className=' h-[40px] sm:h-[45px] mx-auto rounded border-2 bg-primary w-full font-semibold md:mt-0 md:flex-1 text-white'
// 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>
<div className='display: hidden'>
<input
type='text'
name='b_ef8789d5789a6aff8113a701d_11103c248b'
value=''
/>
</div>
</form>
</div>
</section>
);
};

export default NewsletterForm;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@
"tailwindcss": "^3.3.5",
"typescript": "5.2.2"
}
}
}
25 changes: 25 additions & 0 deletions pages/newsletter/index.page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React from 'react';
import Head from 'next/head';
import { getLayout } from '~/components/SiteLayout';
import NewsletterForm from '~/components/Newsletter';
import { SectionContext } from '~/context';

export default function StaticMarkdownPage() {
const newTitle = 'JSON Schema Newsletter';
return (
<SectionContext.Provider value={null}>
<Head>
<title>{newTitle}</title>
</Head>
<div className='flex flex-col items-center justify-center'>
<div className='max-w-[1400px] mx-auto'>
<NewsletterForm
className='pt-[100px] text-black'
wrapperClassName='h-full sm:h-[calc(100vh-312px)] py-[50px] sm:py-0 px-5 sm:px-10 lg:w-full'
/>
</div>
</div>
</SectionContext.Provider>
);
}
StaticMarkdownPage.getLayout = getLayout;