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

adding titles to every page #607

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
110 changes: 51 additions & 59 deletions src/components/NewsLetter.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
import { NewsLetterFormType } from '@/lib/types';
import { FaSpinner } from 'react-icons/fa';
import { SettingsContext } from '@/lib/context/settings';

import { zodResolver } from '@hookform/resolvers/zod';
import { useState,useContext } from 'react';
import { useState } from 'react';
import { useForm } from 'react-hook-form';
// import { FaSpinner } from 'react-icons/fa';
import { FaCheckCircle } from 'react-icons/fa';
import { z, ZodType } from 'zod';

const NewsLetter = () => {
const { theme } = useContext(SettingsContext);


const [isLoading, setIsLoading] = useState(false);
const [isLoading, setIsLoading] = useState(false);

const [selectedInput, setSelectedInput] = useState('');
const [isSubscribed, setIsSubscribed] = useState(false);
Expand All @@ -32,30 +29,31 @@ const [isLoading, setIsLoading] = useState(false);
const submit = async (data: NewsLetterFormType) => {
try {
setIsLoading(true);
console.log(data);

const response = await fetch(`${process.env.NEXT_PUBLIC_API_ENDPOINT}/api/newsletter`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(data),
});

// console.log(data);

const response = await fetch(
`${process.env.NEXT_PUBLIC_API_ENDPOINT}/api/newsletter`,
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(data),
}
);

if (!response.ok) {
throw new Error('Failed to send newsletter subscription data.');
}
console.log('Newsletter subscription data sent successfully!');

// console.log('Newsletter subscription data sent successfully!');
setIsSubscribed(true);
} catch (error) {
console.error('Error sending newsletter subscription data:', error);
// console.error('Error sending newsletter subscription data:', error);
} finally {
setIsLoading(false);
}
};



return (
<form
Expand Down Expand Up @@ -95,37 +93,35 @@ const [isLoading, setIsLoading] = useState(false);
*You must enter a valid email!
</div>
)}
<button
className={`mr-2 w-fit rounded-xl ${
theme === 'dark' ? 'bg-zinc-900' : 'bg-neutral-200'
} py-3 px-6 text-center text-color-pink lg:text-lg transition-none`}
type="submit"
disabled={isLoading}
>
{isLoading ? (
<span
className="loader inline-block mr-2"
style={{
width: '48px',
height: '48px',
border: '5px solid #FFF',
borderBottomColor: '#FF3D00',
borderRadius: '50%',
display: 'inline-block',
boxSizing: 'border-box',
animation: 'rotation 1s linear infinite',
}}
></span>
) : isSubscribed ? (
<>
<FaCheckCircle className="inline-block mr-2" />
Subscribed!
</>
) : (
'Subscribe'
)}
<style>
{`
<button
className="mr-2 w-fit rounded-xl bg-neutral-200 dark:bg-zinc-900 py-3 px-6 text-center text-color-pink lg:text-lg transition-none"
type="submit"
disabled={isLoading}
>
{isLoading ? (
<span
className="loader inline-block mr-2"
style={{
width: '48px',
height: '48px',
border: '5px solid #FFF',
borderBottomColor: '#FF3D00',
borderRadius: '50%',
display: 'inline-block',
boxSizing: 'border-box',
animation: 'rotation 1s linear infinite',
}}
></span>
) : isSubscribed ? (
<>
<FaCheckCircle className="inline-block mr-2" />
Subscribed!
</>
) : (
'Subscribe'
)}
<style>
{`
@keyframes rotation {
0% {
transform: rotate(0deg);
Expand All @@ -135,12 +131,8 @@ const [isLoading, setIsLoading] = useState(false);
}
}
`}
</style>
</button>




</style>
</button>
</div>
</form>
);
Expand Down
4 changes: 4 additions & 0 deletions src/pages/about.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import clsxm from '@/lib/clsxm';
import Button from '@/components/Buttons/Button';
import IconLink from '@/components/links/IconLink'; //import { SettingsContext } from '@/lib/context/settings';

import Head from 'next/head';
import Image from 'next/image';
import Link from 'next/link';
import React from 'react';
Expand Down Expand Up @@ -47,6 +48,9 @@ const events = [
const about = () => {
return (
<>
<Head>
<title>About Us - Vibey</title>
</Head>
<div className="justify-content mx-auto w-11/12 gap-14 md:flex ">
<div className=" pt-24 basis-1/2 ">
<Image
Expand Down
108 changes: 57 additions & 51 deletions src/pages/cfps/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import CfpCardPage from '@/components/upcoming/CfpCardPage';

import { GetStaticProps, InferGetStaticPropsType } from 'next';
import { NextPage } from 'next';
import Head from 'next/head';
import { useState } from 'react';
import { BsFillFunnelFill } from 'react-icons/bs';

Expand Down Expand Up @@ -34,63 +35,68 @@ const CfpPage: NextPage<CfpDataType> = ({
};

return (
<div className="relative z-10 rounded-3xl ">
<div className="layout mx-auto flex w-full max-w-6xl flex-col gap-14 px-2 py-10">
<div className="mt-20 rounded-3xl bg-base-100/50 px-6 py-5 text-4xl text-transparent md:pb-20 md:pt-14 md:text-7xl">
<span className="bg-gradient-to-bl from-[rgb(178,15,255)] to-[#ff5100] bg-clip-text">
Upcoming Cfps
</span>
</div>
<div>
<button
className="bg-black-500 flex cursor-pointer items-stretch rounded-xl border border-gray-400 bg-gray-100 px-4 py-2 font-semibold text-gray-800 shadow "
onClick={() => handleShowFilter()}
>
{' '}
<h3>Filter</h3>{' '}
<span className="pl-4 pt-3">
<BsFillFunnelFill />
<>
<Head>
<title>Cfps - Vibey</title>
</Head>
<div className="relative z-10 rounded-3xl ">
<div className="layout mx-auto flex w-full max-w-6xl flex-col gap-14 px-2 py-10">
<div className="mt-20 rounded-3xl bg-base-100/50 px-6 py-5 text-4xl text-transparent md:pb-20 md:pt-14 md:text-7xl">
<span className="bg-gradient-to-bl from-[rgb(178,15,255)] to-[#ff5100] bg-clip-text">
Upcoming Cfps
</span>
</button>

<div className="events mt-5 grid cursor-pointer grid-cols-auto-sm gap-7">
{showFilter &&
cities.map((city, index) => (
<div
key={index}
onClick={() => handleCityCfps(city)}
className="cursor:pointer rounded-xl bg-base-100/70 text-center sm:pb-10 sm:pt-7 "
>
<h3 className="text-sm ">{city}</h3>
</div>
))}
</div>
</div>
<div>
{sortByFilter(cfpsData, chosenCity).length > 0 ? (
<div className="events grid grid-cols-auto-sm gap-7">
{sortByFilter(cfpsData, chosenCity).map((cfp, index) => (
<CfpCardPage
address={{
isOnline: false,
location: '',
}}
tags={[]}
key={index}
{...cfp}
/>
))}
</div>
) : (
<div className="rounded-3xl bg-base-100/70 px-6 py-5 text-center text-xl text-transparent md:pb-20 md:pt-14 ">
<span className="bg-gradient-to-bl from-[rgb(178,15,255)] to-[#ff5100] bg-clip-text ">
No Upcoming Cfp in {chosenCity}
<div>
<button
className="bg-black-500 flex cursor-pointer items-stretch rounded-xl border border-gray-400 bg-gray-100 px-4 py-2 font-semibold text-gray-800 shadow "
onClick={() => handleShowFilter()}
>
{' '}
<h3>Filter</h3>{' '}
<span className="pl-4 pt-3">
<BsFillFunnelFill />
</span>
</button>

<div className="events mt-5 grid cursor-pointer grid-cols-auto-sm gap-7">
{showFilter &&
cities.map((city, index) => (
<div
key={index}
onClick={() => handleCityCfps(city)}
className="cursor:pointer rounded-xl bg-base-100/70 text-center sm:pb-10 sm:pt-7 "
>
<h3 className="text-sm ">{city}</h3>
</div>
))}
</div>
)}
</div>
<div>
{sortByFilter(cfpsData, chosenCity).length > 0 ? (
<div className="events grid grid-cols-auto-sm gap-7">
{sortByFilter(cfpsData, chosenCity).map((cfp, index) => (
<CfpCardPage
address={{
isOnline: false,
location: '',
}}
tags={[]}
key={index}
{...cfp}
/>
))}
</div>
) : (
<div className="rounded-3xl bg-base-100/70 px-6 py-5 text-center text-xl text-transparent md:pb-20 md:pt-14 ">
<span className="bg-gradient-to-bl from-[rgb(178,15,255)] to-[#ff5100] bg-clip-text ">
No Upcoming Cfp in {chosenCity}
</span>
</div>
)}
</div>
</div>
</div>
</div>
</>
);
};

Expand Down
13 changes: 10 additions & 3 deletions src/pages/contributors.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import GetContributor from '@/pages/Contributors/GetContributor';

import Head from 'next/head';

export default function Contributor() {
return (
<div>
<GetContributor />
</div>
<>
<Head>
<title>Contributors - Vibey</title>
</Head>
<div>
<GetContributor />
</div>
</>
);
}
Loading
Loading