Skip to content
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

Feature/newsletter init #9

Merged
merged 3 commits into from
Dec 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion src/app/conferences/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { FaExternalLinkAlt } from 'react-icons/fa';
export default function Conferences() {
return (
<div className='flex flex-col'>
<p className='text-4xl font-bold mb-20 text-center'>Tekintsd meg korábbi konferenciáinkat:</p>
<h2 className='mb-20 text-center'>Tekintsd meg korábbi konferenciáinkat:</h2>
<div className='flex justify-between flex-col md:flex-row gap-10'>
<Link href='https://2023.konferencia.simonyi.bme.hu' target='blank'>
<div className='flex flex-col justify-center items-center'>
Expand Down
4 changes: 2 additions & 2 deletions src/app/contact/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import Link from 'next/link';
export default function Contact() {
return (
<div className='flex flex-col'>
<p className='text-4xl font-bold mb-20 text-center'>Vállalati és sajtómegkeresések, általános kérdések:</p>
<h2 className=' mb-20 text-center'>Vállalati és sajtómegkeresések, általános kérdések:</h2>
<Link
href='mailto:[email protected]'
className='text-2xl md:text-3xl font-semibold text-center hover:text-brand break-all'
className='text-xl sm:text-2xl md:text-3xl font-semibold text-center hover:text-brand'
target='blank'
>
[email protected]
Expand Down
6 changes: 5 additions & 1 deletion src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ img {
}

h1 {
@apply text-4xl font-bold;
@apply text-3xl sm:text-4xl md:text-5xl font-bold;
}

h2 {
@apply text-2xl sm:text-3xl md:text-4xl font-bold;
}

.brand-link:hover {
Expand Down
25 changes: 25 additions & 0 deletions src/components/checkbox.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import clsx from 'clsx';
import { forwardRef } from 'react';
import { TbCheck } from 'react-icons/tb';

interface CheckboxProps extends React.InputHTMLAttributes<HTMLInputElement> {
label: string;
}

export const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(({ label, className, ...rest }, ref) => {
ref = ref as React.MutableRefObject<HTMLInputElement>;
const id = rest.id || Math.random().toString(36);
return (
<label htmlFor={id} className={clsx('gap-3 flex cursor-pointer', className)}>
<input id={id} hidden type='checkbox' ref={ref} {...rest} />
<div
className={clsx('h-5 w-5 flex-shrink-0 border-white border-2 rounded-md flex items-center justify-center', {
'bg-white text-black': rest.checked,
})}
>
{rest.checked && <TbCheck />}
</div>
{label}
</label>
);
});
7 changes: 3 additions & 4 deletions src/components/newsletter/newsletter-modals.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useState } from 'react';
import { FaCheckCircle, FaTimes } from 'react-icons/fa';

import { addToGroup } from '@/app/actions';
import { Checkbox } from '@/components/checkbox';

import { WhiteButton } from '../white-button';

Expand Down Expand Up @@ -66,16 +67,14 @@ export function NewsletterModals() {
hírlevelünkre!
</p>
<div>
<input
<Checkbox
className='mr-2'
type='checkbox'
id='accept'
checked={accepted}
label='Beleegyezem, hogy a konferenciáig havonta maximum két emailt fogok kapni az alábbi email címre.'
onChange={(e) => setAccepted(e.target.checked)}
/>
<label htmlFor='accept'>
Beleegyezem, hogy a konferenciáig havonta maximum két emailt fogok kapni az alábbi email címre.
</label>
</div>

<input
Expand Down