Skip to content

Commit

Permalink
feat: added update credentials success page
Browse files Browse the repository at this point in the history
  • Loading branch information
KainNhantumbo committed Sep 29, 2024
1 parent 06c931c commit eccb484
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 178 deletions.
13 changes: 8 additions & 5 deletions src/app-router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ const SignupPage = React.lazy(() => import("./router/public/auth/sign-up"));
const UpdateCredentialsPage = React.lazy(
() => import("./router/public/auth/update-credentials")
);
const UpdateCredentialsSuccessPage = React.lazy(
() => import("./router/public/auth/update-credentials-success")
);
const ForgotPasswordRequestSuccessPage = React.lazy(
() => import("./router/public/auth/forgot-password-request-success")
);
const PasswordRecoveryRequestPage = React.lazy(
() => import("./router/public/auth/password-recovery-request")
);
const SignInOauthLoadingPage = React.lazy(
() => import("./router/public/auth/sign-in-oauth")
);
Expand Down Expand Up @@ -42,9 +42,12 @@ const routes: Array<{ path: string; element: React.JSX.ElementType }> = [
{ element: SignInOauthLoadingPage, path: "/auth/sign-in-oauth" },
{ element: SignupPage, path: "/auth/sign-up" },
{ element: UpdateCredentialsPage, path: "/auth/update-credentials" },
{ element: UpdateCredentialsSuccessPage, path: "/auth/update-credentials-success" },
{ element: ForgotPasswordPage, path: "/auth/forgot-password" },
{ element: ForgotPasswordRequestSuccessPage, path: "/auth/forgot-password-request-success" },
{ element: PasswordRecoveryRequestPage, path: "/auth/password-recovery-request" },
{
element: ForgotPasswordRequestSuccessPage,
path: "/auth/forgot-password-request-success"
},
{ element: ContactUsPage, path: "/contact" },
{ element: PrivacyPolicyPage, path: "/privacy-policy" },
{ element: TermsOfUsePage, path: "/terms-of-use" },
Expand Down
169 changes: 0 additions & 169 deletions src/router/public/auth/password-recovery-request.tsx

This file was deleted.

5 changes: 2 additions & 3 deletions src/router/public/auth/sign-in.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { LockIcon, LockOpen, MailIcon, UserPlus } from "lucide-react";
import * as React from "react";
import { useForm } from "react-hook-form";
import { useDispatch } from "react-redux";
import { Link, useNavigate, useSearchParams } from "react-router-dom";
import { Link, useNavigate } from "react-router-dom";
import { toast } from "sonner";

export default function SigninPage() {
Expand Down Expand Up @@ -56,7 +56,6 @@ export default function SigninPage() {
}
};


const handleRedirectToGitHub = () => {
const queryParams = new URLSearchParams({
client_id: import.meta.env.VITE_GITHUB_CLIENT_ID,
Expand Down Expand Up @@ -164,7 +163,7 @@ export default function SigninPage() {
<Button
variant={"link"}
asChild
className='my-3 w-full text-end text-card-foreground'>
className='my-3 text-end self-end text-card-foreground'>
<Link to={"/auth/forgot-password"}>
<span>Forgot password?</span>
</Link>
Expand Down
37 changes: 37 additions & 0 deletions src/router/public/auth/update-credentials-success.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { Layout } from "@/components/layout";
import { Meteors } from "@/components/meteors-effect";
import { Button } from "@/components/ui/button";
import { useDocumentTitle } from "@uidotdev/usehooks";
import { ArrowRight } from "lucide-react";
import { Link } from "react-router-dom";

export default function UpdateCredentialsSuccessPage() {
useDocumentTitle("Update Credentials Success - Toono Community");

return (
<Layout>
<main className='flex min-h-[80vh] w-full flex-col gap-12 px-4 '>
<section className='m-auto w-full max-w-5xl p-4 mobile-x:p-8'>
<div className=' mx-auto flex w-full flex-col justify-between gap-12 pt-10 md:p-0'>
<div className='relative flex w-full flex-col gap-4'>
<Meteors />
<h1 className='max-w-md font-bold leading-normal sm:text-4xl'>
Congratulations! You have successfully updated your account credentials.
</h1>
<p className='font-sm max-w-2xl'>
Please click the button below to access your account.
</p>

<Button asChild>
<Link to={"/auth/sign-in"} className='flex w-fit items-center gap-2'>
<ArrowRight className='h-auto w-4' />
<span>Finish</span>
</Link>
</Button>
</div>
</div>
</section>
</main>
</Layout>
);
}
2 changes: 1 addition & 1 deletion src/router/public/auth/update-credentials.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default function UpdateCredentialsPage() {
token: searchParams.get("token")
}
});
navigate(`/users/dashboard/password-recovery-success`);
navigate(`/auth/update-credentials-success`);
} catch (error) {
const { message } = errorTransformer(error);
console.error(message);
Expand Down

0 comments on commit eccb484

Please sign in to comment.