Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/dev' into feat/notification-sy…
Browse files Browse the repository at this point in the history
…stem-clean
  • Loading branch information
callmestiles committed Aug 1, 2024
2 parents 7696d98 + 812c67a commit 72e2474
Show file tree
Hide file tree
Showing 107 changed files with 958 additions and 710 deletions.
17 changes: 17 additions & 0 deletions public/user-dashboard/svg/credit-card.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions public/user-dashboard/svg/paypal-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions public/user-dashboard/svg/stripe-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 9 additions & 7 deletions src/app/(auth-routes)/login/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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 {
Expand Down Expand Up @@ -101,7 +106,6 @@ const Login = () => {
Welcome back, you've been missed!
</p>
</div>

<div className="flex flex-col justify-center space-y-4 sm:flex-row sm:space-x-6 sm:space-y-0">
<CustomButton
variant="outline"
Expand Down Expand Up @@ -167,15 +171,13 @@ const Login = () => {
Continue with Facebook
</CustomButton>
</div>

<div className="flex items-center justify-center">
<hr className="w-full border-t border-gray-300" />
<span className="font-inter text-neutralColor-dark-1 px-3 text-xs font-normal leading-tight">
OR
</span>
<hr className="w-full border-t border-gray-300" />
</div>

<Form {...form}>
<form onSubmit={form.handleSubmit(onSubmit)} className="space-y-6">
<FormField
Expand Down
20 changes: 12 additions & 8 deletions src/app/(auth-routes)/register/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import { zodResolver } from "@hookform/resolvers/zod";
import { Eye, EyeOff } 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 { useRouter } from "next/navigation";
import { useEffect, useState, useTransition } from "react";
import { useForm } from "react-hook-form";
import * as z from "zod";
Expand All @@ -27,12 +27,16 @@ import { getApiUrl } from "~/utils/getApiUrl";
import { registerUser } from "~/utils/register";

const Register = () => {
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 {
Expand Down Expand Up @@ -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({
Expand Down Expand Up @@ -93,7 +97,9 @@ const Register = () => {
<CustomButton
variant="outline"
isLeftIconVisible={true}
onClick={() => signIn("google", { callbackUrl: "/dashboard" })}
onClick={() =>
signIn("google", { callbackUrl: "/register/organisation" })
}
icon={
<svg
width="25"
Expand Down Expand Up @@ -153,15 +159,13 @@ const Register = () => {
Continue with Facebook
</CustomButton>
</div>

<div className="flex items-center justify-center">
<hr className="w-full border-t border-gray-300" />
<span className="font-inter text-neutralColor-dark-1 px-3 text-xs font-normal leading-tight">
OR
</span>
<hr className="w-full border-t border-gray-300" />
</div>

<Form {...form}>
<form onSubmit={form.handleSubmit(onSubmit)} className="space-y-6">
<FormField
Expand Down
Loading

0 comments on commit 72e2474

Please sign in to comment.