mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-17 18:21:28 +10:00
update to react-router v7
This commit is contained in:
@ -16,7 +16,7 @@ import {
|
||||
import { useRef } from "react";
|
||||
import { Helmet } from "react-helmet-async";
|
||||
import { useForm } from "react-hook-form";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { useNavigate } from "react-router";
|
||||
import { z } from "zod";
|
||||
|
||||
import { useBackupOtp } from "@/client/services/auth";
|
||||
@ -39,7 +39,7 @@ export const BackupOtpPage = () => {
|
||||
try {
|
||||
await backupOtp(data);
|
||||
|
||||
navigate("/dashboard");
|
||||
void navigate("/dashboard");
|
||||
} catch {
|
||||
form.reset();
|
||||
}
|
||||
@ -92,7 +92,7 @@ export const BackupOtpPage = () => {
|
||||
variant="link"
|
||||
className="px-5"
|
||||
onClick={() => {
|
||||
navigate(-1);
|
||||
void navigate(-1);
|
||||
}}
|
||||
>
|
||||
<ArrowLeft size={14} className="mr-2" />
|
||||
|
||||
@ -17,7 +17,7 @@ import {
|
||||
import { useState } from "react";
|
||||
import { Helmet } from "react-helmet-async";
|
||||
import { useForm } from "react-hook-form";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { useNavigate } from "react-router";
|
||||
import { z } from "zod";
|
||||
|
||||
import { useForgotPassword } from "@/client/services/auth";
|
||||
@ -93,7 +93,7 @@ export const ForgotPasswordPage = () => {
|
||||
variant="link"
|
||||
className="px-5"
|
||||
onClick={() => {
|
||||
navigate(-1);
|
||||
void navigate(-1);
|
||||
}}
|
||||
>
|
||||
<ArrowLeft size={14} className="mr-2" />
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { t } from "@lingui/macro";
|
||||
import { cn } from "@reactive-resume/utils";
|
||||
import { useMemo } from "react";
|
||||
import { Link, matchRoutes, Outlet, useLocation } from "react-router-dom";
|
||||
import { Link, matchRoutes, Outlet, useLocation } from "react-router";
|
||||
|
||||
import { LocaleSwitch } from "@/client/components/locale-switch";
|
||||
import { Logo } from "@/client/components/logo";
|
||||
|
||||
@ -20,7 +20,7 @@ import { cn } from "@reactive-resume/utils";
|
||||
import { useRef } from "react";
|
||||
import { Helmet } from "react-helmet-async";
|
||||
import { useForm } from "react-hook-form";
|
||||
import { Link } from "react-router-dom";
|
||||
import { Link } from "react-router";
|
||||
import { z } from "zod";
|
||||
|
||||
import { useLogin } from "@/client/services/auth";
|
||||
|
||||
@ -20,7 +20,7 @@ import { cn } from "@reactive-resume/utils";
|
||||
import { useRef } from "react";
|
||||
import { Helmet } from "react-helmet-async";
|
||||
import { useForm } from "react-hook-form";
|
||||
import { Link, useNavigate } from "react-router-dom";
|
||||
import { Link, useNavigate } from "react-router";
|
||||
import { z } from "zod";
|
||||
|
||||
import { useRegister } from "@/client/services/auth";
|
||||
@ -51,7 +51,7 @@ export const RegisterPage = () => {
|
||||
try {
|
||||
await register(data);
|
||||
|
||||
navigate("/auth/verify-email");
|
||||
void navigate("/auth/verify-email");
|
||||
} catch {
|
||||
form.reset();
|
||||
}
|
||||
|
||||
@ -16,7 +16,7 @@ import {
|
||||
import { useEffect, useRef } from "react";
|
||||
import { Helmet } from "react-helmet-async";
|
||||
import { useForm } from "react-hook-form";
|
||||
import { useNavigate, useSearchParams } from "react-router-dom";
|
||||
import { useNavigate, useSearchParams } from "react-router";
|
||||
import { z } from "zod";
|
||||
|
||||
import { useResetPassword } from "@/client/services/auth";
|
||||
@ -42,7 +42,7 @@ export const ResetPasswordPage = () => {
|
||||
try {
|
||||
await resetPassword(data);
|
||||
|
||||
navigate("/auth/login");
|
||||
void navigate("/auth/login");
|
||||
} catch {
|
||||
form.reset();
|
||||
}
|
||||
@ -50,7 +50,7 @@ export const ResetPasswordPage = () => {
|
||||
|
||||
// Redirect the user to the forgot password page if the token is not present.
|
||||
useEffect(() => {
|
||||
if (!token) navigate("/auth/forgot-password");
|
||||
if (!token) void navigate("/auth/forgot-password");
|
||||
}, [token, navigate]);
|
||||
|
||||
return (
|
||||
|
||||
@ -3,7 +3,7 @@ import { ArrowRight, Info, SealCheck } from "@phosphor-icons/react";
|
||||
import { Alert, AlertDescription, AlertTitle, Button } from "@reactive-resume/ui";
|
||||
import { useEffect } from "react";
|
||||
import { Helmet } from "react-helmet-async";
|
||||
import { Link, useNavigate, useSearchParams } from "react-router-dom";
|
||||
import { Link, useNavigate, useSearchParams } from "react-router";
|
||||
|
||||
import { useToast } from "@/client/hooks/use-toast";
|
||||
import { queryClient } from "@/client/libs/query-client";
|
||||
@ -28,7 +28,7 @@ export const VerifyEmailPage = () => {
|
||||
title: t`Your email address has been verified successfully.`,
|
||||
});
|
||||
|
||||
navigate("/dashboard/resumes", { replace: true });
|
||||
void navigate("/dashboard/resumes", { replace: true });
|
||||
};
|
||||
|
||||
if (!token) return;
|
||||
|
||||
@ -16,7 +16,7 @@ import {
|
||||
import { useRef } from "react";
|
||||
import { Helmet } from "react-helmet-async";
|
||||
import { useForm } from "react-hook-form";
|
||||
import { Link, useNavigate } from "react-router-dom";
|
||||
import { Link, useNavigate } from "react-router";
|
||||
import { z } from "zod";
|
||||
|
||||
import { useVerifyOtp } from "@/client/services/auth";
|
||||
@ -39,7 +39,7 @@ export const VerifyOtpPage = () => {
|
||||
try {
|
||||
await verifyOtp(data);
|
||||
|
||||
navigate("/dashboard");
|
||||
void navigate("/dashboard");
|
||||
} catch {
|
||||
form.reset();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user