Skip to content

Commit

Permalink
implemented about services contact pages
Browse files Browse the repository at this point in the history
  • Loading branch information
aliamerj committed Feb 27, 2024
1 parent 4ba6b69 commit 751a115
Show file tree
Hide file tree
Showing 14 changed files with 395 additions and 72 deletions.
93 changes: 93 additions & 0 deletions app/(main)/about/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
import { AppRouter } from '@/utils/router/app_router';
import { getServerSession } from 'next-auth';
import Link from 'next/link';
import React from 'react';
import { FaRocket, FaUsers, FaCodeBranch, FaTasks, FaRegLightbulb, FaStar, FaClipboardList } from 'react-icons/fa'; // Importing icons
const AboutPage =async () => {
const auth =await getServerSession(authOptions)
return (
<div className="about-page bg-gray-50 text-gray-800">
<div className="container mx-auto px-4 py-12">
<h1 className="text-4xl font-bold text-center mb-6">About Worknify</h1>
<p className="text-md text-center text-gray-600 mb-10">Where Ideas Meet Execution - An Open-Source Revolution</p>

<section className="mb-12">
<div className="text-center mb-8">
<FaRocket className="mx-auto text-primary h-12 w-12" />
<h2 className="text-2xl font-semibold mt-4">Our Mission</h2>
</div>
<p className="text-lg mx-auto leading-relaxed max-w-prose">
Worknify is not just another platform; it's a community-driven powerhouse designed to empower professionals, creators, and dreamers with innovative tools for project management and team collaboration. We believe in the power of connection, innovation, and open-source collaboration to transform the way we work, create, and share.
</p>
</section>

<section className="mb-12">
<div className="text-center mb-8">
<FaUsers className="mx-auto text-primary h-12 w-12" />
<h2 className="text-2xl font-semibold mt-4">Our Community</h2>
</div>
<p className="text-lg mx-auto leading-relaxed max-w-prose">
Worknify is built with the vision of connecting like-minded individuals. Our platform fosters collaboration, allowing you to share ideas, achieve collective success, and contribute to the open-source movement.
</p>
</section>

<section className="features mb-12">
<h2 className="text-3xl font-bold text-center mb-8">Key Features</h2>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
<FeatureCard
icon={<FaRegLightbulb className="text-primary h-8 w-8" />}
title="Innovative Ideas"
description="Capture and develop innovative ideas with our intuitive tools."
/>
<FeatureCard
icon={<FaTasks className="text-primary h-8 w-8" />}
title="Dynamic Project Management"
description="Project management that adapts to your needs, with customizable visibility settings."
/>
<FeatureCard
icon={<FaCodeBranch className="text-primary h-8 w-8" />}
title="Collaborative Coding"
description="Collaborate on code in real-time with integrated version control."
/>
<FeatureCard
icon={<FaStar className="text-primary h-8 w-8" />}
title="Personalized Portfolio Websites"
description="Craft a stunning digital portfolio to showcase your professional journey."
/>
<FeatureCard
icon={<FaClipboardList className="text-primary h-8 w-8" />}
title="Task Management Redefined"
description="Organize your tasks with ease using our intuitive Kanban system."
/>
</div>
</section>

{!auth?.user &&<section className="join-us">
<div className="text-center">
<FaUsers className="mx-auto text-primary h-12 w-12" />
<h2 className="text-2xl font-semibold mt-4">Join Our Community</h2>
<p className="text-lg mx-auto leading-relaxed max-w-prose mt-4 mb-3">
Ready to transform your workflow, connect with like-minded professionals, and bring your projects to life? Join Worknify today and be a part of this exciting journey of innovation and collaboration.
</p>
<Link href={AppRouter.signup} className="mt-6 px-6 py-2 bg-primary text-white font-semibold rounded-lg shadow-md hover:bg-primary-dark transition duration-200">
Get Started
</Link>
</div>
</section>}
</div>
</div>
);
};

// FeatureCard component for reusability and cleaner code
const FeatureCard = ({ icon, title, description }:any) => (
<div className="feature-card bg-white p-6 rounded-lg shadow-lg text-center">
{icon}
<h3 className="text-xl font-semibold mt-4 mb-2">{title}</h3>
<p className="text-md">{description}</p>
</div>
);

export default AboutPage;

37 changes: 20 additions & 17 deletions app/(main)/components/footer/footer.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { AppRouter } from "@/utils/router/app_router";
import Image from "next/image";
import Link from "next/link";
import React from "react";
import { FaFacebookF, FaLinkedinIn, FaGithub } from "react-icons/fa";

Expand All @@ -10,9 +12,10 @@ const Footer = () => {
<Image
src="/worknify_main_logo.svg"
alt="Worknify"
className="h-8 w-auto fill-current text-white"
width={190}
height={50}
className="h-auto w-auto fill-current text-white"
width={100}
height={20}
priority={true}
/>

<p className="mt-2 text-sm">
Expand All @@ -22,30 +25,30 @@ const Footer = () => {
</div>
<div className="flex flex-col space-y-4">
<h3 className="text-sm uppercase text-gray-900">Explore</h3>
<a
href="/about"
<Link
href={AppRouter.about}
className="text-sm transition-colors duration-300 hover:text-primary"
>
About Me
</a>
<a
href="/services"
About Us
</Link>
<Link
href={AppRouter.service}
className="text-sm transition-colors duration-300 hover:text-primary"
>
Services
</a>
<a
href="/blog"
</Link>
<Link
href={AppRouter.privacyPolicy}
className="text-sm transition-colors duration-300 hover:text-primary"
>
Blog
</a>
<a
href="/contact"
Privacy Policy
</Link>
<Link
href={AppRouter.contact}
className="text-sm transition-colors duration-300 hover:text-primary"
>
Contact
</a>
</Link>
</div>
<div className="flex flex-col space-y-4">
<h3 className="text-sm uppercase text-gray-900">Follow Me</h3>
Expand Down
26 changes: 14 additions & 12 deletions app/(main)/components/header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@ import hero from "@/public/hero.png";
import styles from "./Header.module.css";
import { Button } from "@nextui-org/button";
import Link from "next/link";
import { ApiRouter } from "@/utils/router/app_router";
import { ApiRouter, AppRouter } from "@/utils/router/app_router";
import { getServerSession } from "next-auth";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";

/**
* Renders the header section of a web page.
* returns JSX element representing the header section.
*/
export const Header =async () => {
const sestions =await getServerSession(authOptions)
export const Header = async () => {
const sestions = await getServerSession(authOptions);
return (
<main className={styles.container}>
<Image
className={styles.heroImage}
src={hero}
alt="hero image"
height={800}
priority={true}
/>
<div className={styles.headerContent}>
<h1>
Expand All @@ -33,16 +33,18 @@ export const Header =async () => {
success under one roof.
</h3>
<div className={styles.buttonContainer}>
{!sestions?.user && <Button
as={Link}
href={ApiRouter.signin}
className={`${styles.button} ${styles.buttonGetStarted}`}
>
Get Started
</Button>}
{!sestions?.user && (
<Button
as={Link}
href={ApiRouter.signin}
className={`${styles.button} ${styles.buttonGetStarted}`}
>
Get Started
</Button>
)}
<Button
as={Link}
href="#"
href={AppRouter.about}
className={`${styles.button} ${styles.buttonLearnMore}`}
>
Learn More
Expand Down
1 change: 1 addition & 0 deletions app/(main)/components/navbar/Navbar.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
border-radius: 10px;
box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
z-index: 1;
height: 5rem;
}

.getStartedBtn {
Expand Down
7 changes: 4 additions & 3 deletions app/(main)/components/navbar/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ export const NavBar = async () => {
<Navbar className={styles.container}>
<NavbarBrand as={Link} href="/">
<Image
className="cursor-pointer"
className="h-auto w-auto cursor-pointer"
src="/worknify_main_logo.svg"
alt="Worknify"
width={190}
height={50}
width={130}
height={20}
priority={true}
/>
</NavbarBrand>

Expand Down
15 changes: 13 additions & 2 deletions app/(main)/components/userAvatar/userAvatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ export const UserAvatar = ({
/>
</DropdownTrigger>
<DropdownMenu aria-label="Profile Actions" variant="flat">
<DropdownItem key="settings" className="h-14 gap-2">
<DropdownItem
key="settings"
className="h-14 gap-2"
textValue="Settings"
>
<p className="font-semibold">Signed in as</p>
<p className="font-semibold">{email}</p>
</DropdownItem>
Expand All @@ -63,13 +67,15 @@ export const UserAvatar = ({
key="profile"
as={Link}
href={AppRouter.myProject + userId}
textValue="Profile"
>
My Projects
</DropdownItem>
<DropdownItem
key="notifications"
as={Link}
href={AppRouter.notification}
textValue="Notifications"
>
<div className="flex justify-between">
<p>Notifications</p>
Expand All @@ -81,7 +87,12 @@ export const UserAvatar = ({
</div>
</DropdownItem>

<DropdownItem key="logout" color="danger" onClick={() => signOut()}>
<DropdownItem
key="logout"
color="danger"
onClick={() => signOut()}
textValue="Logout"
>
Log Out
</DropdownItem>
</DropdownMenu>
Expand Down
103 changes: 103 additions & 0 deletions app/(main)/contact/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
"use client";
import React, { useRef, useState, FormEvent } from "react";
import emailjs from "@emailjs/browser";
import { ToastContainer, toast } from "react-toastify";
import "react-toastify/dist/ReactToastify.css";
import { MdEmail, MdPerson, MdMessage } from "react-icons/md";

export default function ContactUs() {
const form = useRef<HTMLFormElement>(null);
const [loading, setLoading] = useState<boolean>(false);

const sendEmail = (e: FormEvent<HTMLFormElement>) => {
e.preventDefault();
if (!form.current) return;

setLoading(true);

emailjs
.sendForm(
"service_o7dmsmk",
"template_44i8ptx",
form.current,
"M3PNytkF0RPjKCPL5",
)
.then(
() => {
toast.success("Message sent successfully!");
form.current?.reset();
},
(_) => {
toast.error("Failed to send message. Please try again!");
},
);
setLoading(false);
};

return (
<div className="flex h-screen flex-col items-center justify-center bg-gray-50 text-gray-800">
<div className="mb-8 text-center">
<h2 className="text-2xl font-semibold">Let's Get in Touch!</h2>
<p className="text-md mt-2">
We're excited to hear from you. Fill out the form below, and we'll get
back to you as soon as possible.
</p>
</div>
<div className="w-full max-w-lg">
<ToastContainer />
<form
ref={form}
onSubmit={sendEmail}
className="flex flex-col gap-4 rounded-lg bg-white p-8 shadow"
>
<div className="relative">
<MdPerson
className="absolute left-0 top-0 ml-2 mt-3 text-gray-400"
size="24"
/>
<input
type="text"
name="user_name"
placeholder="Name"
className="w-full rounded-md border border-gray-300 py-2 pl-10 pr-4 focus:border-blue-500 focus:ring-blue-500"
required
/>
</div>
<div className="relative">
<MdEmail
className="absolute left-0 top-0 ml-2 mt-3 text-gray-400"
size="24"
/>
<input
type="email"
name="user_email"
placeholder="Email"
className="w-full rounded-md border border-gray-300 py-2 pl-10 pr-4 focus:border-blue-500 focus:ring-blue-500"
required
/>
</div>
<div className="relative">
<MdMessage
className="absolute left-0 top-0 ml-2 mt-3 text-gray-400"
size="24"
/>
<textarea
name="message"
placeholder="Message"
className="w-full rounded-md border border-gray-300 py-2 pl-10 pr-4 focus:border-blue-500 focus:ring-blue-500"
rows={4}
required
></textarea>
</div>
<button
type="submit"
className={`mt-4 rounded-md bg-primary px-4 py-2 font-semibold text-white shadow ${loading ? "bg-primary-300" : "hover:bg-primary-700"}`}
disabled={loading}
>
{loading ? "Sending..." : "Send"}
</button>
</form>
</div>
</div>
);
}
2 changes: 1 addition & 1 deletion app/(main)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default function RootLayout({
}) {
return (
<html lang="en" className="light">
<body className={rubik.className}>
<body suppressHydrationWarning={true} className={rubik.className}>
<Providers>
<ApiCallProvider>
<NavBar />
Expand Down
Loading

0 comments on commit 751a115

Please sign in to comment.