'my change '

component_ui
sonali 2024-10-03 17:44:26 +05:30
parent 33d5b93a9c
commit 544705f96a
2 changed files with 12 additions and 8 deletions

View File

@ -1,7 +1,7 @@
import React, { useEffect, useState } from "react";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faArrowLeft } from "@fortawesome/free-solid-svg-icons";
import { useNavigate } from "react-router-dom";
import { useNavigate , useLocation } from "react-router-dom";
import { Player } from "@lottiefiles/react-lottie-player";
import successAnimation from "../Common/Animation - 1727464749500.json";
import "../ExpenseSuccessfully/ExpenseSuccessfully.css"
@ -9,6 +9,8 @@ import "../ExpenseSuccessfully/ExpenseSuccessfully.css"
function ExpenseSuccessfully() {
const [currentDate, setCurrentDate] = useState(new Date());
const navigate = useNavigate();
const location = useLocation();
const entryType = location.state?.entryType;
useEffect(() => {
const timer = setInterval(() => {
@ -19,15 +21,15 @@ function ExpenseSuccessfully() {
}, []);
const handleBackClick = () => {
navigate("/expense-editPage");
navigate("/expense-editPage" , { state: { entryType } });
};
const handleBackToHome = () => {
navigate("/");
navigate("/" , { state: { entryType } });
};
const handleBackToRecord = () => {
navigate("/expense-records")
navigate("/expense-records" , { state: { entryType } })
}
const options = { hour: "2-digit", minute: "2-digit", hour12: true };

View File

@ -1,7 +1,7 @@
import React, { useEffect, useState } from "react";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faArrowLeft } from "@fortawesome/free-solid-svg-icons";
import { useNavigate } from "react-router-dom";
import { useNavigate , useLocation } from "react-router-dom";
import { Player } from "@lottiefiles/react-lottie-player";
import successAnimation from "../Common/Animation - 1727464749500.json";
import "../Income/IncomeSuccessfully.css";
@ -9,6 +9,8 @@ import "../Income/IncomeSuccessfully.css";
function IncomeSuccessfully() {
const [currentDate, setCurrentDate] = useState(new Date());
const navigate = useNavigate();
const location = useLocation();
const entryType = location.state?.entryType;
useEffect(() => {
const timer = setInterval(() => {
@ -19,15 +21,15 @@ function IncomeSuccessfully() {
}, []);
const handleBackClick = () => {
navigate("/editPage");
navigate("/editPage" , { state: { entryType } });
};
const handleBackToHome = () => {
navigate("/");
navigate("/" , { state: { entryType } });
};
const handleBackToRecord = () => {
navigate("/records")
navigate("/records" , { state: { entryType } })
}
const options = { hour: "2-digit", minute: "2-digit", hour12: true };