diff --git a/public/user-dashboard/svg/credit-card.svg b/public/user-dashboard/svg/credit-card.svg new file mode 100644 index 000000000..c2d867778 --- /dev/null +++ b/public/user-dashboard/svg/credit-card.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/public/user-dashboard/svg/paypal-logo.svg b/public/user-dashboard/svg/paypal-logo.svg new file mode 100644 index 000000000..90822257e --- /dev/null +++ b/public/user-dashboard/svg/paypal-logo.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/public/user-dashboard/svg/stripe-logo.svg b/public/user-dashboard/svg/stripe-logo.svg new file mode 100644 index 000000000..fddde7b63 --- /dev/null +++ b/public/user-dashboard/svg/stripe-logo.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/src/app/(auth-routes)/login/page.tsx b/src/app/(auth-routes)/login/page.tsx index c7a60c352..bb8a68d2d 100644 --- a/src/app/(auth-routes)/login/page.tsx +++ b/src/app/(auth-routes)/login/page.tsx @@ -2,7 +2,7 @@ import { zodResolver } from "@hookform/resolvers/zod"; import { Eye, EyeOff, ShieldCheck } from "lucide-react"; -import { signIn } from "next-auth/react"; +import { signIn, useSession } from "next-auth/react"; import { useRouter } from "next-nprogress-bar"; import Link from "next/link"; import { useEffect, useState, useTransition } from "react"; @@ -28,11 +28,16 @@ import { getApiUrl } from "~/utils/getApiUrl"; import { loginUser } from "~/utils/login"; const Login = () => { - const [showPassword, setShowPassword] = useState(false); const router = useRouter(); - const [isLoading, startTransition] = useTransition(); - const [apiUrl, setApiUrl] = useState(""); const { toast } = useToast(); + const { status } = useSession(); + const [apiUrl, setApiUrl] = useState(""); + const [isLoading, startTransition] = useTransition(); + const [showPassword, setShowPassword] = useState(false); + + if (status === "authenticated") { + router.push("/dashboard"); + } useEffect(() => { const fetchApiUrl = async () => { try { @@ -101,7 +106,6 @@ const Login = () => { Welcome back, you've been missed!

-
{ Continue with Facebook
-

@@ -175,7 +178,6 @@ const Login = () => {
-
{ - const [apiUrl, setApiUrl] = useState(""); + const router = useRouter(); const { toast } = useToast(); + const { status } = useSession(); + const [apiUrl, setApiUrl] = useState(""); const [isLoading, startTransition] = useTransition(); const [showPassword, setShowPassword] = useState(false); - const router = useRouter(); + if (status === "authenticated") { + router.push("/dashboard"); + } useEffect(() => { const fetchApiUrl = async () => { try { @@ -64,7 +68,7 @@ const Register = () => { startTransition(async () => { await registerUser(values).then(async (data) => { if (data.status === 201) { - router.push("/login"); + router.push("/register/organisation"); } toast({ @@ -93,7 +97,9 @@ const Register = () => { signIn("google", { callbackUrl: "/dashboard" })} + onClick={() => + signIn("google", { callbackUrl: "/register/organisation" }) + } icon={ { Continue with Facebook -

@@ -161,7 +166,6 @@ const Register = () => {
- { - const [post, setPost] = useState(); - const [isLoading, setIsLoading] = useState(true); - const [newComment, setNewComment] = useState(""); - - const [comments, setComments] = - useState[]>(sampleComments); - - const searchParameters = useSearchParams(); - const id = searchParameters.get("id"); - - useEffect(() => { - const fetchPost = () => { - setTimeout(() => { - const storedPost = localStorage.getItem("currentBlogPost"); - if (storedPost) { - try { - const parsedPost = JSON.parse(storedPost) as BlogPost; - if (parsedPost.id === Number.parseInt(id as string, 10)) { - setPost(parsedPost); - } else { - setPost(undefined); - } - } catch (error) { - throw new Error("Error parsing stored blog post", { cause: error }); - } - } else { - setPost(undefined); - } - setIsLoading(false); - }, 1000); - }; - - if (typeof window !== "undefined") { - fetchPost(); - } - }, [id]); - - if (isLoading || !post) { - return ( -
-
- {isLoading ? ( - <> - Loading ... - - - ) : ( - "Blog post not found" - )} -
-
- ); - } - - const handleSubmit = () => { - if (newComment.trim()) { - const comment: Omit = { - id: (comments.length + 1).toString(), - avatar: "", - name: mockSession.user?.name || "Anonymous", - username: - mockSession.user?.name?.toLowerCase().replace(" ", "") || "anonymous", - content: newComment, - timestamp: new Date().toISOString(), - likes: 0, - dislikes: 0, - }; - setComments([comment, ...comments]); - setNewComment(""); - } - }; - - const handleKeyDown = (event_: React.KeyboardEvent) => { - if (event_.key === "Enter" && !event_.shiftKey) { - event_.preventDefault(); - handleSubmit(); - } - }; - return ( - <> -
-
-
- - {post.category} - -
- -

- {post.title} -

- -
- Nora Nora -
-

- {post.author} -

-

- {post.readTime} mins Read • {post.date} -

-
-
- -
-
- - 77k -
-
- - 44 -
-
-
-
- -
-
- ENIAC computer, one of the first general-purpose electronic digital computers -
-

- Image: {post.title} -

- -
-

- “In the 1930s, John Atanasoff and Clifford Berry built the - Atanasoff-Berry Computer (ABC), considered the first electronic - digital computer, using vacuum tubes to perform calculations. - “ -

-
- -
-

- We often hear about the ENIAC, hailed as the first computer, but its - story is just one thread in a rich tapestry woven by brilliant minds - across generations. The true journey to the digital age is - fascinating, filled with visionaries who dared to dream of machines - that could think and calculate. In the 1830s, Charles Babbage - conceived the Analytical Engine, a mechanical marvel that could - perform complex calculations and even store data. It was a blueprint - for the modern computer, with a central processing unit, memory, and - input/output capabilities. Unfortunately, his vision was ahead of - its time, and the Analytical Engine was never fully built due to - funding constraints and the limitations of the technology at the - time. -
- But Babbage wasn't alone. Ada Lovelace, a brilliant - mathematician and daughter of Lord Byron, recognized the potential - of his machine. She collaborated with Babbage, writing detailed - notes on the Analytical Engine's capabilities. Her work, - considered the first computer program, demonstrated how the machine - could be used to solve complex mathematical problems, laying the - foundation for the field of software development. -

-

- {" "} - The world needed a practical solution for data processing, and - Herman Hollerith stepped up. In the late 19th century, he developed - a tabulating machine that used punched cards to store and process - data. This machine was a game-changer, proving crucial in the 1890 - US Census. Hollerith's invention paved the way for the - development of data processing systems, which would later become - essential for modern computing. -
While Babbage's vision was mechanical, the 20th century - saw a shift towards electronic computing. In the 1930s, John - Atanasoff and Clifford Berry built the Atanasoff-Berry Computer - (ABC), considered the first electronic digital computer, using - vacuum tubes to perform calculations. Though not programmable, the - ABC demonstrated the potential of electronics in computing, paving - the way for the ENIAC. -
The Electronic Numerical Integrator and Computer (ENIAC), - built in the 1940s, was a programmable machine designed for military - calculations. It was a massive, room-sized computer that used vacuum - tubes to perform complex operations. The ENIAC marked a significant - milestone in the development of general-purpose computers, but it - was built upon the groundwork laid by Babbage, Lovelace, Hollerith, - and Atanasoff. -

-

- {" "} - This is just the beginning. There are countless other stories of - pioneers who contributed to the development of the first computers. - Women like Grace Hopper, a pioneer in computer programming and the - development of COBOL, played vital roles, often overlooked in the - history books. The story of the first computer is not a singular - event, but a tapestry woven by brilliant minds across generations. - It's a testament to human ingenuity, perseverance, and the - relentless pursuit of innovation. -

-
- -
-

- Add Comments -

-