Compare commits

..

No commits in common. "component_ui" and "new_01" have entirely different histories.

29 changed files with 904 additions and 1235 deletions

View File

@ -0,0 +1,38 @@
.App {
text-align: center;
}
.App-logo {
height: 40vmin;
pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
.App-logo {
animation: App-logo-spin infinite 20s linear;
}
}
.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}
.App-link {
color: #61dafb;
}
@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}

View File

@ -4,36 +4,32 @@
justify-content: center;
align-items: center;
height: 100vh;
overflow: hidden;
position: relative;
font-family: 'Montserrat', sans-serif;
}
.backIcon {
position: absolute;
top: 10px;
margin: 35px;
left: 10px;
top: 20px;
left: 20px;
}
.arrow-icon {
font-size: 18px;
font-size: 24px;
cursor: pointer;
}
.edit-content {
padding: 30px;
margin-bottom: 30px;
padding: 20px;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
/* box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3); */
width: 100%;
max-width: 400px;
}
.edit-titles h1 {
color: #fff;
margin-bottom: 30px;
font-size: 30px;
margin: 0px 0;
text-align: center;
@ -41,7 +37,6 @@
.edit-datetime {
color: #fff;
margin-bottom: 30px;
font-size: 18px;
text-align: center;
margin-bottom: 10px;
@ -49,7 +44,6 @@
.edit-fields {
color: #fff;
padding: 10px 10px;
margin-bottom: 15px;
width: 93%;
}
@ -57,15 +51,14 @@
.edit-fields label {
display: block;
margin-bottom: 9px;
}
.edit-fields input {
width: 100%;
padding: 10px;
/* border: 1px solid #555; */
border: 1px solid #555;
border-radius: 4px;
/* background-color: #3A3A3A; */
background-color: #3A3A3A;
color: #fff;
font-size: 16px;
}
@ -75,14 +68,14 @@
display: flex;
justify-content: center;
margin-top: 30px;
gap: 5px;
width: 100%;
}
.edit-btn {
position: relative;
width: 130px;
height: 50px;
width: 150px;
height: 60px;
color: #fff;
justify-content: center;
align-items: center;
@ -97,8 +90,8 @@
.edit-btn-2 {
position: relative;
width: 130px;
height: 50px;
width: 150px;
height: 60px;
color: #fff;
justify-content: center;
align-items: center;
@ -113,26 +106,14 @@
@media (max-width: 768px) {
.edit-titles h1 {
font-size: 24px;
}
.edit-datetime {
font-size: 16px;
}
.edit-buttons div {
font-size: 14px;
}
}
@media (min-width: 1024px) {
.edit-btn, .edit-btn-2 {
width: 250px;
height: 50px;
font-size: 20px;
}
}

View File

@ -2,7 +2,7 @@ import React, { useEffect, useState } from "react";
import { useLocation, useNavigate } from "react-router-dom";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faArrowLeft } from "@fortawesome/free-solid-svg-icons";
import "../Common/ExpenseEditPage.css";
import "../Common/ExpenseEditPage.css"
function ExpenseEditPage() {
const location = useLocation();
@ -17,20 +17,7 @@ function ExpenseEditPage() {
const now = new Date();
const formattedDateTime = now.toLocaleString();
setCurrentDateTime(formattedDateTime);
if (!location.state?.id) {
const storedEntries = JSON.parse(localStorage.getItem("entries")) || [];
const entryToEdit = storedEntries.find(
(entry) => entry.id === location.state?.id
);
if (entryToEdit) {
setAmount(entryToEdit.amount);
setCategory(entryToEdit.category);
}
}
}, [location.state]);
}, []);
const handleBackClick = () => {
navigate("/expense-records");
@ -47,14 +34,16 @@ function ExpenseEditPage() {
category: category,
};
const storedEntries = JSON.parse(localStorage.getItem("entries")) || [];
const updatedEntries = storedEntries.map((entry) =>
entry.id === updatedEntry.id ? updatedEntry : entry
);
localStorage.setItem("entries", JSON.stringify(updatedEntries));
// console.log("Entry updated in local storage:", updatedEntry);
navigate("/expense-successfully", { state: updatedEntry });
console.log("Entry updated in local storage:", updatedEntry);
navigate("/expense-successfully");
setIsLoading(false);
};

View File

@ -1,7 +1,7 @@
.layout-container {
/* display: flex;
display: flex;
flex-direction: column;
min-height: 100vh; */
min-height: 100vh;
font-family: 'Montserrat', sans-serif;
}

View File

@ -5,21 +5,17 @@
justify-content: center;
align-items: center;
height: 100vh;
font-family: 'Montserrat', sans-serif;
color: white;
position: relative;
}
.arrows {
position: absolute;
top: 10px;
margin: 35px;
left: 10px;
top: 20px;
left: 20px;
}
.arrow-icon-1 {
font-size: 18px;
font-size: 24px;
cursor: pointer;
}
@ -34,13 +30,13 @@
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 0px;
margin-bottom: 10px;
}
.success-title h1 {
color: #fff;
font-size: 30px;
margin-top: 0px;
margin-top: 10px;
text-align: center;
}
@ -56,14 +52,14 @@
.success-button {
display: flex;
justify-content: center;
gap: 10px;
margin-top: 10px;
gap: 20px;
margin-top: 20px;
}
.btn-view {
position: relative;
width: 100px;
height: 30px;
width: 120px;
height: 40px;
color: #fff;
justify-content: center;
align-items: center;
@ -77,8 +73,8 @@
}
.btn-back {
position: relative;
width: 100px;
height: 30px;
width: 120px;
height: 40px;
color: #fff;
justify-content: center;
align-items: center;
@ -92,11 +88,24 @@
}
.success-date-time{
color: #fff;
}
/* Mobile responsiveness */
@media (max-width: 768px) {
.btn-view, .btn-back {
padding: 12px 20px;
font-size: 16px;
}
}
/* Mobile responsiveness */
@media (max-width: 768px) {
.success-message h2 {
font-size: 20px;
@ -105,21 +114,4 @@
.success-title h1 {
font-size: 24px;
}
}
@media (min-width: 1024px) {
.btn-view, .btn-back {
width: 200px;
height: 50px;
font-size: 20px;
}
.success-title h1 {
font-size: 32px;
}
.success-message h2 {
font-size: 26px;
}
}

View File

@ -22,7 +22,7 @@ function TotalExpenseSuccessfully() {
const dataToStore = {
incomeRecord: {
dateTime: formattedDateTime,
entryId: entryId || "Not provided",
entryId: entryId || "Not provided", // Fallback in case entryId is undefined
},
};
console.log(JSON.stringify(dataToStore));
@ -33,7 +33,7 @@ function TotalExpenseSuccessfully() {
};
const handleViewRecordsClick = () => {
// Pass entryId to the /records route when navigating
navigate("/expense-records", { state: { entryId } });
console.log(entryId);
};

View File

@ -1,233 +1,191 @@
.amount-container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 10px;
margin: 0 auto;
max-width: 90vw;
background-color: #1e1e1e;
border-radius: 10px;
text-align: center;
}
.backarrow {
/* position: absolute; */
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 10px;
margin: 0 auto;
max-width: 500px;
background-color: #1e1e1e;
border-radius: 10px;
text-align: center;
}
}
.backarrow {
position: relative;
width: 100%;
text-align: center;
margin-bottom: 50px;
}
.arrowbtn {
position: absolute;
left: 0;
top: 50%;
margin: 20px 10px;
font-size: 4vw; /* Responsive font-size */
margin: 30px 10px;
/* transform: translateY(-50%); */
font-size: 24px;
color: #333;
cursor: pointer;
}
.amount-titles {
font-size: 24px;
width: 100%;
color: #fff;
margin: 0 auto;
text-align: center;
flex-grow: 1;
}
.amount-display {
display: flex;
width: 150px;
height: 30px;
align-items: center;
justify-content: center;
background: #1E1E1E;
box-shadow: 0px 0px 22.3px #E335DC, 0px 0px 2.9px #FFFFFF, inset -2px -2px 2px rgba(4, 4, 4, 0.64), inset 2px 2px 2px rgba(39, 39, 44, 0.56);
border-radius: 24px;
padding: 10px;
border-radius: 8px;
margin-bottom: 20px;
}
.total-amount {
font-size: 36px;
color: #fff;
margin-right: 10px;
}
.Rupeesicon {
width: 30px;
height: 30px;
}
.rupess_section {
display: flex;
justify-content: center;
flex-wrap: wrap;
gap: 15px;
margin-top: 20px;
}
.coin {
width: 50px;
height: 50px;
background: #E335DC;
box-shadow: -10px -10px 12px rgba(50, 50, 51, 0.66), 10px 10px 16px #040404, inset -2px -2px 2px rgba(111, 0, 121, 0.64), inset 2px 2px 2px rgba(102, 0, 98, 0.56);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: background-color 0.3s ease;
/* border: 2px solid #fff; */
}
.coin-value {
font-size: 24px;
font-weight: bold;
color: #fff;
}
@media (max-width: 600px) {
.amount-container {
padding: 10px;
max-width: 100%;
}
.backarrow {
justify-content: space-between;
}
.arrowbtn {
position: absolute;
/* left: 3%; */
top: 50%;
margin: 17px 30px;
/* transform: translateX(-20%); */
font-size: 18px;
color: #333;
cursor: pointer;
}
.amount-titles {
font-size: 20px;
font-size: 24px;
width: 100px;
color: #fff;
margin: 0 auto;
text-align: center;
flex-grow: 1;
}
.rupess_section {
gap: 20px;
.amount-display {
display: flex;
align-items: center;
justify-content: center;
background: #1E1E1E;
box-shadow: 0px 0px 22.3px #E335DC, 0px 0px 2.9px #FFFFFF, inset -2px -2px 2px rgba(4, 4, 4, 0.64), inset 2px 2px 2px rgba(39, 39, 44, 0.56);
border-radius: 24px;
padding: 10px;
border-radius: 8px;
margin-bottom: 20px;
}
.total-amount {
font-size: 36px;
color: #fff;
margin-right: 10px;
}
.Rupeesicon {
width: 30px;
height: 30px;
}
.rupess_section {
display: flex;
justify-content: center;
flex-wrap: wrap;
gap: 15px;
margin-top: 20px;
}
.coin {
width: 50px;
height: 50px;
padding: 15px;
background: #E335DC;
box-shadow: -10px -10px 12px rgba(50, 50, 51, 0.66), 10px 10px 16px #040404, inset -2px -2px 2px rgba(111, 0, 121, 0.64), inset 2px 2px 2px rgba(102, 0, 98, 0.56);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: background-color 0.3s ease;
/* border: 2px solid #fff; */
}
.coin-value {
font-size: 26px;
font-size: 24px;
font-weight: bold;
color: #fff;
}
.Rupeesicon {
width: 33px;
height: 33px;
}
.total-amount {
font-size: 28px;
}
@media (max-width: 600px) {
.amount-container {
padding: 10px;
max-width: 100%;
}
.backarrow {
justify-content: space-between;
}
.arrowbtn {
position: absolute;
left: 0;
top: 50%;
margin: 30px 10px;
/* transform: translateX(-20%); */
font-size: 24px;
color: #333;
cursor: pointer;
}
.amount-titles {
font-size: 20px;
}
.rupess_section {
gap: 10px;
}
.coin {
width: 50px;
height: 50px;
padding: 15px;
}
.coin-value {
font-size: 26px;
}
.Rupeesicon {
width: 20px;
height: 20px;
}
.total-amount {
font-size: 28px;
}
.coin:hover {
background-color: #4caf50;
}
}
@media (min-width: 1024px) {
.amount-container {
max-width: 800px;
padding: 20px;
}
.coin {
width: 100px;
height: 100px;
@media (min-width: 1024px) {
.amount-container {
max-width: 800px;
padding: 20px;
}
.coin {
width: 100px;
height: 100px;
}
.coin-value {
font-size: 20px;
}
.Rupeesicon {
width: 30px;
height: 30px;
padding: 10px;
}
.total-amount {
font-size: 40px;
}
}
.arrowbtn {
font-size: 18px;
margin: 27px 21px;
}
.coin-value {
font-size: 20px;
}
.Rupeesicon {
width: 30px;
height: 30px;
padding: 10px;
}
.total-amount {
font-size: 40px;
}
}
@media (max-width: 375px) {
.amount-container {
padding: 0px;
max-width: 90%;
}
.backarrow {
justify-content: space-between;
}
.arrowbtn {
font-size: 18px;
margin: 27px 21px;
}
.amount-titles {
font-size: 18px;
}
.rupess_section {
gap: 20px;
margin-top: 10px;
}
.coin {
width: 40px;
height: 35px;
}
.coin-value {
font-size: 20px;
}
.Rupeesicon {
width: 25px;
height: 25px;
}
.total-amount {
font-size: 26px;
}
}

View File

@ -1,28 +1,21 @@
body {
margin: 0;
overflow: hidden;
}
.total-amount-container {
display: flex;
flex-direction: column;
position: fixed;
width: 80%;
max-width: 500px;
height: 340px;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: white;
font-family: 'Montserrat', sans-serif;
background: #1e1e1e;
box-shadow: -8px -8px 12px rgba(50, 50, 51, 0.66), 8px 8px 16px #040404,
inset -2px -2px 2px rgba(255, 255, 255, 0.64),
inset 2px 2px 2px rgba(39, 39, 44, 0.56);
padding: 8px;
box-sizing: border-box;
}
flex-direction: column;
position: absolute;
width: 80%;
max-width: 500px;
height: auto;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: white;
font-family: 'Montserrat', sans-serif;
background: #1e1e1e;
box-shadow: -8px -8px 12px rgba(50, 50, 51, 0.66), 8px 8px 16px #040404,
inset -2px -2px 2px rgba(255, 255, 255, 0.64),
inset 2px 2px 2px rgba(39, 39, 44, 0.56);
padding: 20px;
box-sizing: border-box;
}
.input-group {
display: flex;
@ -89,7 +82,7 @@ body {
@media (max-width: 768px) {
.total-amount-container {
width: 90%;
top: 65%;
top: 60%;
}
.input-group {
@ -117,7 +110,7 @@ body {
@media (max-width: 480px) {
.total-amount-container {
/* padding: 15px; */
margin: 20px 0px 0px 0px ;
margin: 40px 0px ;
}
.add-entry-1,

View File

@ -1,233 +1,158 @@
.category-container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-start;
background-color: #1e1e1e;
color: white;
width: 100%;
padding: 10px;
}
.arrow {
position: absolute;
top: 10px;
left: 30px;
}
.arrow-icon {
font-size: 24px;
}
/*
.category-header {
display: flex;
align-items: center;
justify-content: center;
margin: 20px 0;
width: 100%;
text-align: center;
} */
.category-titles {
font-size: 20px;
margin-right: 4px;
color: #fff;
margin-bottom: 20px; /* Add 10px space below category titles */
}
.category-display {
margin: 35px 0 10px 0; /* 10px space below the display box */
width: 150px;
height: 30px;
background: #1E1E1E;
box-shadow: 0px 0px 22.3px #00D092, 0px 0px 2.9px #FFFFFF, inset -2px -2px 2px rgba(4, 4, 4, 0.64), inset 2px 2px 2px rgba(39, 39, 44, 0.56);
border-radius: 24px;
display: flex;
align-items: center;
justify-content: center;
padding: 10px;
border-radius: 8px;
}
.category01 {
width: 30px;
/* top: 10px; */
justify-content: center;
align-items: center;
margin: 2px;
height: 30px;
}
.category-list {
display: flex;
flex-wrap: wrap;
justify-content: center;
width: 100%;
margin-top: 0px;
}
.cat-item {
background-color: #2a2a2a;
border-radius: 10px;
padding: 10px;
margin: 10px;
min-width: 120px;
text-align: center;
font-size: 18px;
transition: background-color 0.3s ease;
cursor: pointer;
}
.cat-item.selected {
background-color: #007BFF;
color: white;
border-radius: 5px;
}
.cat-item.selected {
background-color: #007bff;
color: #fff;
}
.texts {
width: 50%;
padding: 10px;
margin: 20px 0;
font-size: 16px;
border-bottom: 1px solid #fafafa;
outline: none;
color: #ffffff;
border-radius: 8px;
transition: border-color 0.3s ease, background-color 0.3s ease;
}
.add-category {
display: flex;
align-items: center;
margin-top: 10px;
}
.texts {
flex: 1;
padding: 5px;
margin-right: 10px;
}
.add-button {
padding: 10px 14px;
margin: 15px;
background-color: #2a2a2a;
color: white;
border: none;
border-radius: 3px;
cursor: pointer;
}
.add-button:hover {
background-color: #2a2a2a;
}
@media (max-width: 768px) {
.category-titles {
font-size: 20px;
}
.category01 {
width: 35px;
margin: 10px;
height: 3px;
}
.cat-item {
min-width: 100px;
font-size: 16px;
}
}
@media (max-width: 480px) {
.arrow {
top: 40px;
left: 40px;
}
.category-titles {
font-size: 18px;
color: #fff;
}
.category01 {
width: 30px;
margin: 7px;
height: 30px;
}
.cat-item {
min-width: 80px;
font-size: 14px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-start;
background-color: #1e1e1e;
color: white;
width: 100%;
padding: 10px;
margin: 8px;
}
.category-container {
padding: 0px;
}
}
@media (max-width: 375px) {
.category-container {
padding: 0;
.arrow {
position: absolute;
top: 10px;
left: 30px;
}
.arrow-icon {
font-size: 18px;
margin: 27px 21px;
}
.arrow {
top: 30px;
left: 30px;
font-size: 24px;
}
/*
.category-header {
display: flex;
align-items: center;
justify-content: center;
margin: 20px 0;
width: 100%;
text-align: center;
} */
.category-display {
width: 120px;
height: 25px;
margin: 35px auto;
font-size: 14px;
margin: 30px;
width: 150px;
height: 30px;
/* left: calc(50% - 207px / 2 - 0.5px); */
top: 90px;
background: #1E1E1E;
box-shadow: 0px 0px 22.3px #00D092, 0px 0px 2.9px #FFFFFF, inset -2px -2px 2px rgba(4, 4, 4, 0.64), inset 2px 2px 2px rgba(39, 39, 44, 0.56);
border-radius: 24px;
display: flex;
align-items: center;
justify-content: center;
padding: 10px;
border-radius: 8px;
}
.category-titles {
font-size: 14px;
margin-right: 2px;
font-size: 24px;
margin-right: 4px;
}
.category01 {
width: 25px;
height: 25px;
margin: 5px;
.category-icon {
width: 30px;
/* top: 10px; */
justify-content: center;
align-items: center;
/* margin: 2px; */
height: 30px;
}
.category-list {
display: flex;
flex-wrap: wrap;
justify-content: center;
width: 100%;
margin-top: 20px;
}
.cat-item {
min-width: 50px;
font-size: 10px;
padding: 8px;
margin: 6px;
background-color: #2a2a2a;
border-radius: 10px;
padding: 15px;
margin: 10px;
min-width: 120px;
text-align: center;
font-size: 18px;
transition: background-color 0.3s ease;
cursor: pointer;
}
.cat-item.selected {
background-color: #007BFF;
color: white;
border-radius: 5px;
}
.cat-item.selected {
background-color: #007bff;
color: #fff;
}
.texts {
width: 50%;
padding: 10px;
margin: 20px 0;
font-size: 16px;
border-bottom: 1px solid #fafafa;
outline: none;
color: #ffffff;
border-radius: 8px;
transition: border-color 0.3s ease, background-color 0.3s ease;
}
@media (max-width: 768px) {
.category-titles {
font-size: 20px;
}
.category-icon {
width: 35px;
margin: 10px;
height: 35px;
}
.cat-item {
min-width: 100px;
font-size: 16px;
}
}
.texts {
width: 50%;
font-size: 10px;
padding: 8px;
margin: 15px 0;
@media (max-width: 480px) {
.arrow {
top: 40px;
left: 40px;
}
.category-titles {
font-size: 18px;
}
.category-icon {
width: 30px;
margin: 7px;
height: 30px;
}
.cat-item {
min-width: 80px;
font-size: 14px;
padding: 10px;
margin: 8px;
}
.category-container {
padding: 0px;
}
}
}

View File

@ -8,18 +8,21 @@ import '../ExpenseCategory/ExpenseCategory.css';
function ExpenseCategory() {
const navigate = useNavigate();
const [totalAmount, setTotalAmount, category, setCategory] = useOutletContext();
const [categories, setCategories] = useState(["Hair", "Clothing", "Food", "Books", "Electronics", "Other"]);
const [selectedCategories, setSelectedCategories] = useState([]);
const [customCategoryCount, setCustomCategoryCount] = useState(0);
const [newCategory, setNewCategory] = useState('');
const location = useLocation();
const entryType = location.state?.entryType;
const handleBackClick = () => {
navigate("/income", { state: { entryType } });
navigate("/expense", { state: { entryType } });
console.log(entryType);
}
@ -35,8 +38,7 @@ function ExpenseCategory() {
}
};
const handleAddCategory = () => {
if (newCategory.trim() === '') return;
const handleAddCategory = (newCategory) => {
if (!categories.includes(newCategory)) {
if (customCategoryCount < 3) {
const updatedCategories = [...categories, newCategory];
@ -44,7 +46,6 @@ function ExpenseCategory() {
setCustomCategoryCount(customCategoryCount + 1);
localStorage.setItem('categories', JSON.stringify(updatedCategories));
alert(`Category "${newCategory}" added!`);
setNewCategory(''); // Clear input field after adding
} else {
alert('You can only add up to three custom categories!');
}
@ -74,7 +75,7 @@ function ExpenseCategory() {
<div className='category-display'>
<h3 className="category-titles">Categories</h3>
<img src={categoryImage} alt="categoryIcon" className="category01" />
<img src={categoryImage} alt="categoryIcon" className="category-icon" />
</div>
<section className='category-list'>
@ -89,25 +90,20 @@ function ExpenseCategory() {
))}
</section>
{/* Input and button for adding new category */}
{customCategoryCount < 3 && (
<div className="add-category">
<input
className='texts'
type="text"
placeholder="Add New Category"
value={newCategory}
onChange={(e) => setNewCategory(e.target.value)}
/>
<button
className="add-button"
onClick={handleAddCategory}
>
Add
</button>
</div>
<input className='texts'
type="text"
placeholder="Add New Category"
onKeyDown={(e) => {
if (e.key === 'Enter') {
handleAddCategory(e.target.value);
e.target.value = '';
}
}}
/>
)}
</div>
);
}
export default ExpenseCategory;

View File

@ -1,6 +1,6 @@
.expense-container {
max-width: 100%;
max-width: 800px;
margin: 0 auto;
padding: 20px;
justify-content: center;
@ -140,7 +140,7 @@
padding: 10px;
}
.amount-icon, .category{
.amount-icon, .category-icon {
width: 40px;
height: 40px;
margin: 2px;
@ -158,35 +158,3 @@
}
}
/* Styles for screens with a width of 375px */
@media (max-width: 375px) {
.arrow-icon {
font-size: 12px;
}
.expense-title {
font-size: 18px;
}
.expense-date {
font-size: 12px;
}
.button-container {
flex-direction: row;
align-items: center;
}
.amount-btn, .category-btn {
width: 90%;
font-size: 14px;
padding: 12px;
}
.category{
width: 25px;
height: 25px;
margin-bottom: 5px;
}
}

View File

@ -1,23 +1,23 @@
.container {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100vh;
color: white;
position: relative;
}
.back_arrows {
position: absolute;
top: 10px;
margin: 35px;
left: 10px;;
top: 20px;
left: 20px;
}
.arrow-icon {
font-size: 18px;
margin: 9px 0px 0px 0px;
font-size: 24px;
cursor: pointer;
}
@ -29,9 +29,9 @@
}
.success-titles h1 {
color: #4CAF50;
color: #fff;
font-size: 30px;
margin: 0 0;
margin: 10px 0;
text-align: center;
}
@ -45,37 +45,35 @@
text-align: center;
font-size: 24px;
color: #4CAF50;
margin: 0px 0;
padding: 30px;
margin: 10px 0;
}
.categories {
margin-top: 0px;
.categories {
margin-top: 10px;
display: flex;
justify-content: space-between;
align-items: center;
}
.categories h3 {
.categories h3 {
font-size: 15px;
color: #9e9696;
/* margin: 0px 0px 0px 0px; */
/* padding: 5px; */
}
.categories ul {
.categories ul {
list-style-type: none;
padding: 5px;
}
}
.categories li {
.categories li {
font-size: 16px;
color: #deb1b1;
border-bottom: 1px solid #e0e0e0;
padding: 8px 0;
}
}
/* Mobile responsiveness */
@media (max-width: 768px) {
@ -86,32 +84,31 @@
.success-datetime {
font-size: 16px;
}
}
.total-amount {
color: #4CAF50;
font-size: 12px;
margin: 0px 0;
}
.total-amount {
color: #fff;
font-size: 12px;
margin: 20px 0;
}
.categories {
color: #fff;
font-size: 10px;
margin: 10px 0;
}
.categories {
color: #fff;
font-size: 10px;
margin: 10px 0;
}
.success-buttons {
display: flex;
justify-content: center;
gap: 10px;
margin-top: 0px;
gap: 20px;
margin-top: 20px;
}
.btn-home,
.btn-edit {
.btn-home {
position: relative;
width: 140px;
height: 50px;
width: 150px;
height: 60px;
color: #fff;
justify-content: center;
align-items: center;
@ -122,82 +119,23 @@
justify-content: center;
align-items: center;
margin-right: 10px;
}
@media (min-width: 1024px) {
.btn-edit, .btn-home {
width: 200px;
height: 50px;
font-size: 20px;
}
.total-amount {
color: #4CAF50;
font-size: 12px;
margin: 0px 0;
}
}
/* Screen size 375px */
@media screen and (max-width: 375px) {
.success-titles h1 {
font-size: 20px;
}
.success-datetime {
font-size: 14px;
}
.total-amount {
font-size: 18px;
/* padding: 20px; */
}
.categories li {
font-size: 14px;
}
.btn-edit {
position: relative;
width: 150px;
height: 60px;
color: #fff;
justify-content: center;
align-items: center;
background: #1E1E1E;
box-shadow: -8px -8px 12px rgba(50, 50, 51, 0.66), 8px 8px 16px #040404, inset -2px -2px 2px rgba(4, 4, 4, 0.64), inset 2px 2px 2px rgba(39, 39, 44, 0.56);
border-radius: 24px;
display: flex;
justify-content: center;
align-items: center;
margin-right: 10px;
}
/* Screen size 687px */
@media screen and (max-width: 687px) {
.success-titles h1 {
font-size: 22px;
}
.success-datetime {
font-size: 16px;
}
.total-amount {
font-size: 20px;
padding: 25px;
}
.categories li {
font-size: 15px;
}
}
/* Screen size 745px */
@media screen and (max-width: 745px) {
.success-titles h1 {
font-size: 24px;
}
.success-datetime {
font-size: 16px;
}
.total-amount {
font-size: 12px;
}
.categories li {
font-size: 16px;
}
}

View File

@ -45,11 +45,9 @@ function ExpenseRecords() {
}, [entry, lastEntry]);
const handleBackClick = () => {
navigate("/expense-totalsuccessfully");
navigate("/");
};
const handleBackHomeClick = () => {
navigate("/")
}
const handleEditClick = () => {
const idToEdit = entryId || (lastEntry ? lastEntry.id : null);
@ -96,7 +94,7 @@ function ExpenseRecords() {
</div>
<div className="success-buttons">
<div className="btn-home" onClick={handleBackHomeClick}>Home</div>
<div className="btn-home" onClick={handleBackClick}>Home</div>
<div className="btn-edit" onClick={handleEditClick}>Edit</div>
</div>
</div>

View File

@ -1,3 +1,10 @@
body {
background-color: #1E1E1E;
margin: 20px;
padding: 0;
font-family: Arial, sans-serif;
}
.Payment-container {
display: flex;
@ -9,35 +16,40 @@
}
.arrow {
font-size: 18px;
font-size: 24px;
cursor: pointer;
}
.arr {
position: absolute;
top: 10px;
left: 0px;
top: 20px;
left: 20px;
}
.expense-date {
.income-date {
color: #fff;
font-size: 18px;
text-align: center;
margin-bottom: 0px;
margin-bottom: 10px;
}
.payment-title {
text-align: center;
margin-bottom: 30px;
margin-bottom: 10px;
}
.payment-title h1 {
color: #fff;
font-size: 30px;
margin: 0px 0;
margin: 10px 0;
text-align: center;
}
.payment-content {
display: flex;
flex-direction: column;
@ -45,6 +57,7 @@
justify-content: center;
}
.payment-animation {
display: flex;
justify-content: center;
@ -52,6 +65,7 @@
margin-bottom: 10px;
}
.payment-message h2 {
color: #fff;
font-size: 24px;
@ -59,6 +73,7 @@
margin-bottom: 20px;
}
.payment-buttons {
display: flex;
justify-content: center;
@ -66,10 +81,11 @@
margin-top: 20px;
}
.btn1, .bt_11 {
.btn1 {
position: relative;
width: 130px;
height: 40px;
width: 150px;
height: 60px;
color: #fff;
justify-content: center;
align-items: center;
@ -82,64 +98,82 @@
margin-right: 10px;
}
/* Small screens (up to 600px) */
.bt_11 {
position: relative;
width: 150px;
height: 60px;
color: #fff;
justify-content: center;
align-items: center;
background: #1E1E1E;
box-shadow: -8px -8px 12px rgba(50, 50, 51, 0.66), 8px 8px 16px #040404, inset -2px -2px 2px rgba(4, 4, 4, 0.64), inset 2px 2px 2px rgba(39, 39, 44, 0.56);
border-radius: 24px;
display: flex;
justify-content: center;
align-items: center;
margin-right: 10px;
}
@media (max-width: 600px) {
.payment-title h1 {
font-size: 24px;
}
.income-date {
font-size: 16px;
}
.expense-date {
font-size: 12px;
}
.payment-message h2 {
font-size: 14px;
font-size: 20px;
}
.btn1, .bt_11 {
width: 120px;
height: 40px;
font-size: 14px;
height: 50px;
font-size: 16px;
}
.arr {
top: 0px;
left: 0px;
top: 10px;
left: 10px;
}
}
@media (max-width: 1024px) {
.payment-title h1 {
font-size: 22px;
font-size: 28px;
}
.expense-date {
font-size: 14px;
.income-date {
font-size: 16px;
}
.payment-message h2 {
font-size: 18px;
font-size: 22px;
}
.btn1, .bt_11 {
width: 140px;
height: 50px;
font-size: 16px;
height: 55px;
font-size: 18px;
}
.arr {
top: 0;
left: 0px;
margin: 5px;
top: 15px;
left: 15px;
}
}
/* Large screens (1025px and up) */
@media (min-width: 1025px) {
.btn1, .bt_11 {
width: 190px;
height: 50px;
width: 160px;
height: 60px;
font-size: 18px;
}

View File

@ -1,16 +1,14 @@
import React, { useEffect, useState } from "react";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faArrowLeft } from "@fortawesome/free-solid-svg-icons";
import { useNavigate, useLocation } from "react-router-dom";
import { useNavigate } from "react-router-dom";
import { Player } from "@lottiefiles/react-lottie-player";
import successAnimation from "../Common/Animation - 1727464749500.json";
import "../ExpenseSuccessfully/ExpenseSuccessfully.css";
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(() => {
@ -21,32 +19,28 @@ function ExpenseSuccessfully() {
}, []);
const handleBackClick = () => {
const updatedEntry = {
id: location.state?.id,
amount: location.state?.amount,
category: location.state?.category,
dateTime: location.state?.dateTime,
};
navigate("/expense-editPage", { state: updatedEntry });
navigate("/expense-edit");
};
const handleBackToHome = () => {
navigate("/", { state: { entryType } });
navigate("/");
};
const handleBackToRecord = () => {
navigate("/expense-records", { state: { entryType } });
};
navigate("/expense-records")
}
const options = { hour: "2-digit", minute: "2-digit", hour12: true };
const formattedDate = `on ${currentDate.toLocaleDateString()} - ${currentDate.toLocaleTimeString([], options)}`;
const formattedDate = `on ${currentDate.toLocaleDateString()} - ${currentDate.toLocaleTimeString(
[],
options
)}`;
return (
<div className="Payment-container">
<div className="payment-title">
<h1>Expense</h1>
<p className="expense-date">{formattedDate}</p>
<p className="income-date">{formattedDate}</p>
<div className="arr">
<FontAwesomeIcon
icon={faArrowLeft}

View File

@ -18,7 +18,7 @@
position: relative;
width: 100%;
text-align: center;
margin-bottom: 30px;
margin-bottom: 50px;
}
@ -27,7 +27,7 @@
left: 0;
top: 50%;
margin: 30px 10px;
transform: translateY(90%);
/* transform: translateY(-50%); */
font-size: 24px;
color: #333;
cursor: pointer;

View File

@ -51,7 +51,7 @@ function EntriesList() {
id: new Date().getTime(),
amount: repeatEntry.amount,
category: repeatEntry.category,
type: repeatEntry.type,
type: repeatEntry.type, // Ensure type is included
};
const updatedEntries = [...entries, newEntry];

View File

@ -1,12 +1,6 @@
body {
margin: 0;
overflow: hidden;
}
.total-amount-container {
display: flex;
flex-direction: column;
position: relative;
position: absolute;
width: 80%;
max-width: 500px;
height: auto;
@ -81,14 +75,14 @@ input:focus {
align-items: center;
cursor: pointer;
}
.error-message {
.error-message{
color: red;
}
@media (max-width: 768px) {
.total-amount-container {
width: 90%;
top: auto;
top: 60%;
}
.input-group {
@ -125,24 +119,3 @@ input:focus {
height: 40px;
}
}
@media (max-width: 375px) {
.total-amount-container {
padding: 15px;
margin: 20px;
width: 95%;
}
.amount-input,
.category-input {
min-width: 150px;
}
.add-entry-1,
.add-entry-2 {
font-size: 12px;
height: 35px;
}
}

View File

@ -1,233 +1,166 @@
.category-container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-start;
background-color: #1e1e1e;
color: white;
width: 100%;
padding: 10px;
}
.arrow {
position: absolute;
top: 10px;
left: 30px;
}
.arrow-icon {
font-size: 24px;
}
/*
.category-header {
display: flex;
align-items: center;
justify-content: center;
margin: 20px 0;
width: 100%;
text-align: center;
} */
.category-titles {
font-size: 20px;
margin-right: 4px;
color: #fff;
margin-bottom: 20px; /* Add 10px space below category titles */
}
.category-display {
margin: 35px 0 10px 0; /* 10px space below the display box */
width: 150px;
height: 30px;
background: #1E1E1E;
box-shadow: 0px 0px 22.3px #00D092, 0px 0px 2.9px #FFFFFF, inset -2px -2px 2px rgba(4, 4, 4, 0.64), inset 2px 2px 2px rgba(39, 39, 44, 0.56);
border-radius: 24px;
display: flex;
align-items: center;
justify-content: center;
padding: 10px;
border-radius: 8px;
}
.category-icon {
width: 30px;
/* top: 10px; */
justify-content: center;
align-items: center;
margin: 2px;
height: 30px;
}
.category-list {
display: flex;
flex-wrap: wrap;
justify-content: center;
width: 100%;
margin-top: 0px;
}
.cat-item {
background-color: #2a2a2a;
border-radius: 10px;
padding: 10px;
margin: 10px;
min-width: 120px;
text-align: center;
font-size: 18px;
transition: background-color 0.3s ease;
cursor: pointer;
}
.cat-item.selected {
background-color: #007BFF;
color: white;
border-radius: 5px;
}
.cat-item.selected {
background-color: #007bff;
color: #fff;
}
.texts {
width: 50%;
padding: 10px;
margin: 20px 0;
font-size: 16px;
border-bottom: 1px solid #fafafa;
outline: none;
color: #ffffff;
border-radius: 8px;
transition: border-color 0.3s ease, background-color 0.3s ease;
}
.add-category {
display: flex;
align-items: center;
margin-top: 10px;
}
.texts {
flex: 1;
padding: 5px;
margin-right: 10px;
}
.add-button {
padding: 10px 14px;
margin: 15px;
background-color: #2a2a2a;
color: white;
border: none;
border-radius: 3px;
cursor: pointer;
}
.add-button:hover {
background-color: #2a2a2a;
}
@media (max-width: 768px) {
.category-titles {
font-size: 20px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-start;
background-color: #1e1e1e;
color: white;
width: 100%;
font-family: 'Montserrat', sans-serif;
padding: 10px;
}
.category01 {
width: 28px;
height: 28px;
margin: 5px;
}
.category-icon {
width: 35px;
margin: 10px;
height: 3px;
}
.cat-item {
min-width: 100px;
font-size: 16px;
}
}
@media (max-width: 480px) {
.arrow {
top: 40px;
left: 40px;
position: absolute;
top: 10px;
left: 30px;
}
.arrow-icon {
font-size: 24px;
right: 85px;
bottom: 40px;
}
/*
.category-header {
display: flex;
align-items: center;
justify-content: center;
margin: 20px 0;
width: 100%;
text-align: center;
} */
.category-display {
margin: 40px;
width: 10px;
height: 30px;
/* left: calc(50% - 207px / 2 - 0.5px); */
top: 90px;
background: #1E1E1E;
box-shadow: 0px 0px 22.3px #00D092, 0px 0px 2.9px #FFFFFF, inset -2px -2px 2px rgba(4, 4, 4, 0.64), inset 2px 2px 2px rgba(39, 39, 44, 0.56);
border-radius: 24px;
display: flex;
align-items: center;
justify-content: center;
padding: 10px;
border-radius: 8px;
}
.category-titles {
font-size: 18px;
font-size: 24px;
color: #fff;
margin-right: 4px;
}
.category-icon {
width: 30px;
margin: 7px;
/* top: 10px; */
justify-content: center;
align-items: center;
/* margin: 2px; */
height: 30px;
}
.cat-item {
min-width: 80px;
font-size: 14px;
padding: 10px;
margin: 8px;
}
.category-container {
padding: 0px;
}
}
@media (max-width: 375px) {
.category-container {
padding: 0
}
.arrow {
top: 30px;
left: 20px;
}
.category-display {
width: 120px;
height: 25px;
margin: 15px auto;
font-size: 14px;
}
.category-titles {
font-size: 16px;
margin-right: 2px;
}
.category-icon {
width: 25px;
height: 25px;
margin: 5px;
.category-list {
display: flex;
flex-wrap: wrap;
justify-content: center;
width: 100%;
margin-top: 20px;
}
.cat-item {
min-width: 70px;
font-size: 12px;
padding: 8px;
margin: 6px;
background-color: #2a2a2a;
border-radius: 10px;
padding: 15px;
margin: 10px;
min-width: 120px;
text-align: center;
font-size: 18px;
transition: background-color 0.3s ease;
cursor: pointer;
}
.cat-item.selected {
background-color: #007BFF;
color: white;
border-radius: 5px;
}
.cat-item.selected {
background-color: #007bff;
color: #fff;
}
.texts {
width: 50%;
padding: 10px;
margin: 20px 0;
font-size: 16px;
border-bottom: 1px solid #fafafa;
outline: none;
color: #ffffff;
border-radius: 8px;
transition: border-color 0.3s ease, background-color 0.3s ease;
}
/* Mobile responsiveness */
@media (max-width: 768px) {
.category-titles {
font-size: 20px;
}
.category-container {
margin: 10px;
}
.category-icon {
width: 35px;
margin: 10px;
height: 35px;
}
.cat-item {
min-width: 100px;
font-size: 16px;
}
}
.texts {
width: 80%;
font-size: 14px;
padding: 8px;
margin: 15px 0;
@media (max-width: 480px) {
.arrow {
top: 30px;
left: 10px;
}
.category-titles {
font-size: 18px;
}
.category-icon {
width: 30px;
margin: 7px;
height: 30px;
}
.cat-item {
min-width: 80px;
font-size: 14px;
padding: 10px;
margin: 8px;
}
.category-container {
padding: 0px;
}
}
}

View File

@ -11,12 +11,13 @@ function Category() {
const [categories, setCategories] = useState(["Hair", "Clothing", "Food", "Books", "Electronics", "Other"]);
const [selectedCategories, setSelectedCategories] = useState([]);
const [customCategoryCount, setCustomCategoryCount] = useState(0);
const [newCategory, setNewCategory] = useState('');
const location = useLocation();
const entryType = location.state?.entryType;
const handleBackClick = () => {
navigate("/income", { state: { entryType } });
console.log(entryType);
}
@ -33,8 +34,7 @@ function Category() {
}
};
const handleAddCategory = () => {
if (newCategory.trim() === '') return;
const handleAddCategory = (newCategory) => {
if (!categories.includes(newCategory)) {
if (customCategoryCount < 3) {
const updatedCategories = [...categories, newCategory];
@ -42,7 +42,6 @@ function Category() {
setCustomCategoryCount(customCategoryCount + 1);
localStorage.setItem('categories', JSON.stringify(updatedCategories));
alert(`Category "${newCategory}" added!`);
setNewCategory(''); // Clear input field after adding
} else {
alert('You can only add up to three custom categories!');
}
@ -72,7 +71,7 @@ function Category() {
<div className='category-display'>
<h3 className="category-titles">Categories</h3>
<img src={categoryImage} alt="categoryIcon" className="category01" />
<img src={categoryImage} alt="categoryIcon" className="category-icon" />
</div>
<section className='category-list'>
@ -87,23 +86,17 @@ function Category() {
))}
</section>
{/* Input and button for adding new category */}
{customCategoryCount < 3 && (
<div className="add-category">
<input
className='texts'
type="text"
placeholder="Add New Category"
value={newCategory}
onChange={(e) => setNewCategory(e.target.value)}
/>
<button
className="add-button"
onClick={handleAddCategory}
>
Add
</button>
</div>
<input className='texts'
type="text"
placeholder="Add New Category"
onKeyDown={(e) => {
if (e.key === 'Enter') {
handleAddCategory(e.target.value);
e.target.value = '';
}
}}
/>
)}
</div>
);

View File

@ -1,3 +1,5 @@
.incomeedit-containers {
display: flex;
flex-direction: column;
@ -10,8 +12,8 @@
.backIcon {
position: absolute;
top: 0px;
left: 0px;
top: 20px;
left: 20px;
}
.arrow-icon {
@ -21,8 +23,7 @@
.edit-content {
padding: 10px;
margin-bottom: 30px;
padding: 20px;
border-radius: 8px;
/* box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3); */
width: 100%;
@ -31,7 +32,6 @@
.edit-titles h1 {
color: #fff;
margin-bottom: 30px;
font-size: 30px;
margin: 0px 0;
text-align: center;
@ -39,7 +39,6 @@
.edit-datetime {
color: #fff;
margin-bottom: 30px;
font-size: 18px;
text-align: center;
margin-bottom: 10px;
@ -54,33 +53,31 @@
.edit-fields label {
display: block;
margin-bottom: 9px;
}
.edit-fields input {
width: 100%;
padding: 10px;
/* border: 1px solid #555; */
border: 1px solid #555;
border-radius: 4px;
/* background-color: #3A3A3A; */
background-color: #3A3A3A;
color: #fff;
font-size: 16px;
}
/* Button styling */
.edit-buttons {
display: flex;
justify-content: center;
margin-top: 30px;
gap: 5px;
width: 100%;
}
.edit-btn {
/* item */
position: relative;
width: 130px;
height: 50px;
width: 150px;
height: 60px;
color: #fff;
justify-content: center;
align-items: center;
@ -95,8 +92,8 @@
.edit-btn-2 {
position: relative;
width: 130px;
height: 50px;
width: 150px;
height: 60px;
color: #fff;
justify-content: center;
align-items: center;
@ -111,26 +108,17 @@
@media (max-width: 768px) {
.edit-titles h1 {
font-size: 24px;
}
.edit-datetime {
font-size: 16px;
}
.edit-buttons div {
font-size: 14px;
}
}
@media (min-width: 1024px) {
.edit-btn, .edit-btn-2 {
width: 250px;
height: 50px;
font-size: 20px;
}
}

View File

@ -7,27 +7,20 @@ import "../Common/IncomeEdit.css";
function IncomeEdit() {
const location = useLocation();
const navigate = useNavigate();
// Destructure state values passed from previous page
const { id, amount: initialAmount, category: initialCategory, dateTime: initialDateTime } = location.state || {};
const [amount, setAmount] = useState(initialAmount || "");
const [category, setCategory] = useState(initialCategory || "");
const [currentDateTime, setCurrentDateTime] = useState(initialDateTime || "");
const [currentDateTime, setCurrentDateTime] = useState("");
const [amount, setAmount] = useState(location.state?.amount || "");
const [category, setCategory] = useState(location.state?.category || "");
const [error, setError] = useState(null);
const [isLoading, setIsLoading] = useState(false);
useEffect(() => {
if (!initialDateTime) {
const now = new Date();
const formattedDateTime = now.toLocaleString();
setCurrentDateTime(formattedDateTime);
}
}, [initialDateTime]);
const now = new Date();
const formattedDateTime = now.toLocaleString();
setCurrentDateTime(formattedDateTime);
}, []);
const handleBackClick = () => {
navigate("/records"); // Navigate back to records
navigate("/records");
};
const handleSave = () => {
@ -35,22 +28,23 @@ function IncomeEdit() {
setError(null);
const updatedEntry = {
id: id,
id: location.state?.id,
amount: amount,
dateTime: currentDateTime,
category: category,
};
// Save updated entry to localStorage (or backend API if needed)
const storedEntries = JSON.parse(localStorage.getItem("entries")) || [];
const updatedEntries = storedEntries.map((entry) =>
entry.id === updatedEntry.id ? updatedEntry : entry
);
localStorage.setItem("entries", JSON.stringify(updatedEntries));
// Navigate to success page
navigate("/successPage", { state: updatedEntry });
setIsLoading(false);
// Optionally, you can navigate to a success page or display a message here
console.log("Entry updated in local storage:", updatedEntry);
navigate("/successPage");
setIsLoading(false); // End loading
};
return (

View File

@ -123,7 +123,7 @@
}
.buttons {
max-width: 80%;
max-width: 100%;
}
.expense-btn, .income-btn {

View File

@ -1,8 +1,9 @@
/* IncomePage.css */
/* Main container */
.income-container {
max-width: 800px;
margin: 0 auto;
font-family: 'Montserrat', sans-serif;
padding: 20px;
justify-content: center;
border-radius: 10px;
@ -13,15 +14,14 @@
.arrow-container {
position: relative;
width: 100%;
margin: 10px;
text-align: center;
text-align: center; /* Center the title and date */
margin-bottom: 20px;
}
/* Arrow icon */
.arrow-icon {
position: absolute;
left: 0;
left: 0; /* Place the arrow on the left */
top: 50%;
margin: 40px 5px;
transform: translateY(-50%);
@ -30,7 +30,7 @@
cursor: pointer;
}
/* Title */
.income-title {
font-size: 24px;
color: #fff;
@ -40,16 +40,16 @@
margin-top: 10px;
}
/* Date and time */
.income-date {
font-size: 14px;
color: #fff;
font-family: 'Montserrat', sans-serif;
text-align: center;
text-align: center; /* Center the date */
margin: 10px;
}
/* Button container */
.button-container {
display: flex;
font-family: 'Montserrat', sans-serif;
@ -111,21 +111,21 @@
/* Icons in buttons */
.category-icon {
width: 30px;
height: 30px;
margin-bottom: 10px;
}
/* Responsive styling */
/* Mobile-specific styles */
@media (max-width: 600px) {
.arrow-container{
margin: 20px;
}
.arrow-icon {
font-size: 15px;
}
.expense-title {
@ -166,37 +166,3 @@
font-size: 18px;
}
}
/* Styles for screens with a width of 375px */
@media (max-width: 375px) {
.arrow-container {
font-size: 12px;
}
.income-title {
font-size: 18px;
}
.income-date {
font-size: 12px;
}
.button-container {
flex-direction: row;
align-items: center;
}
.amount-btn, .category-btn {
width: 90%;
font-size: 14px;
padding: 12px;
}
.category-icon {
width: 25px;
height: 25px;
margin-bottom: 5px;
}
}

View File

@ -1,10 +1,11 @@
body {
background-color: #1E1E1E;
margin: 20px;
font-family: 'Montserrat', sans-serif;
padding: 0;
font-family: Arial, sans-serif;
}
.Payment-container {
display: flex;
flex-direction: column;
@ -19,31 +20,36 @@ body {
cursor: pointer;
}
.arr {
position: absolute;
top: 10px;
left: 10px;
top: 20px;
left: 20px;
}
.expense-date {
.income-date {
color: #fff;
font-size: 18px;
text-align: center;
margin-bottom: 0px;
margin-bottom: 10px;
}
.payment-title {
text-align: center;
margin-bottom: 30px;
margin-bottom: 10px;
}
.payment-title h1 {
color: #fff;
font-size: 30px; /* Default font size */
margin: 0px 0;
font-size: 30px;
margin: 10px 0;
text-align: center;
}
.payment-content {
display: flex;
flex-direction: column;
@ -51,6 +57,7 @@ body {
justify-content: center;
}
.payment-animation {
display: flex;
justify-content: center;
@ -58,13 +65,15 @@ body {
margin-bottom: 10px;
}
.payment-message h2 {
color: #fff;
font-size: 24px; /* Default font size */
font-size: 24px;
text-align: center;
margin-bottom: 20px;
}
.payment-buttons {
display: flex;
justify-content: center;
@ -72,10 +81,11 @@ body {
margin-top: 20px;
}
.btn1, .bt_11 {
.btn1 {
position: relative;
width: 130px; /* Default width */
height: 40px; /* Default height */
width: 150px;
height: 60px;
color: #fff;
justify-content: center;
align-items: center;
@ -88,50 +98,69 @@ body {
margin-right: 10px;
}
/* Small screens (up to 600px) */
.bt_11 {
position: relative;
width: 150px;
height: 60px;
color: #fff;
justify-content: center;
align-items: center;
background: #1E1E1E;
box-shadow: -8px -8px 12px rgba(50, 50, 51, 0.66), 8px 8px 16px #040404, inset -2px -2px 2px rgba(4, 4, 4, 0.64), inset 2px 2px 2px rgba(39, 39, 44, 0.56);
border-radius: 24px;
display: flex;
justify-content: center;
align-items: center;
margin-right: 10px;
}
@media (max-width: 600px) {
.payment-title h1 {
font-size: 16px; /* Smaller font size */
font-size: 24px;
}
.expense-date {
font-size: 12px; /* Smaller font size */
.income-date {
font-size: 16px;
}
.payment-message h2 {
font-size: 14px; /* Smaller font size */
font-size: 20px;
}
.btn1, .bt_11 {
width: 120px;
height: 40px;
font-size: 14px;
height: 50px;
font-size: 16px;
}
.arr {
top: 0px;
left: 0px;
top: 10px;
left: 10px;
}
}
/* Medium screens (601px to 1024px) */
@media (max-width: 1024px) {
.payment-title h1 {
font-size: 22px;
font-size: 28px;
}
.expense-date {
font-size: 14px;
.income-date {
font-size: 16px;
}
.payment-message h2 {
font-size: 18px;
font-size: 22px;
}
.btn1, .bt_11 {
width: 140px;
height: 50px;
font-size: 16px;
height: 55px;
font-size: 18px;
}
.arr {
@ -140,11 +169,11 @@ body {
}
}
/* Large screens (1025px and up) */
@media (min-width: 1025px) {
.btn1, .bt_11 {
width: 190px;
height: 50px;
width: 160px;
height: 60px;
font-size: 18px;
}

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, useLocation } from "react-router-dom";
import { useNavigate } from "react-router-dom";
import { Player } from "@lottiefiles/react-lottie-player";
import successAnimation from "../Common/Animation - 1727464749500.json";
import "../Income/IncomeSuccessfully.css";
@ -9,8 +9,6 @@ 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(() => {
@ -21,26 +19,21 @@ function IncomeSuccessfully() {
}, []);
const handleBackClick = () => {
const updatedEntry = {
id: location.state?.id,
amount: location.state?.amount,
category: location.state?.category,
dateTime: location.state?.dateTime,
};
navigate("/editPage", { state: { ...updatedEntry } });
navigate("/editPage");
};
const handleBackToHome = () => {
navigate("/", { state: { entryType } });
navigate("/");
};
const handleBackToRecord = () => {
navigate("/records", { state: { entryType } });
};
navigate("/records")
}
const options = { hour: "2-digit", minute: "2-digit", hour12: true };
const formattedDate = `on ${currentDate.toLocaleDateString()} - ${currentDate.toLocaleTimeString(
[], options
[],
options
)}`;
return (
@ -73,10 +66,10 @@ function IncomeSuccessfully() {
<div className="payment-buttons">
<div className="btn1" onClick={handleBackToHome}>
Home
Home
</div>
<div className="bt_11" onClick={handleBackToRecord}>
Records
Records
</div>
</div>
</div>

View File

@ -1,9 +1,11 @@
.container {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
font-family: 'Montserrat', sans-serif;
height: 100vh;
color: white;
position: relative;
@ -11,13 +13,12 @@
.back_arrows {
position: absolute;
top: 0px;
left: 0px;
top: 20px;
left: 20px;
}
.arrow-icon {
font-size: 24px;
margin: 22px 10px 0px 10px;
cursor: pointer;
}
@ -41,12 +42,11 @@
text-align: center;
}
.total-amount {
text-align: center;
.total-amount h2 {
font-size: 24px;
color: #4CAF50;
margin: 10px 0;
}
}
.categories {
margin-top: 10px;
@ -75,7 +75,7 @@
padding: 8px 0;
}
/* Mobile responsiveness */
@media (max-width: 768px) {
.success-titles h1 {
font-size: 24px;
@ -87,11 +87,13 @@
}
.total-amount {
color: #fff;
font-size: 12px;
margin: 20px 0;
text-align: center;
font-size: 24px;
color: #4CAF50;
margin: 10px 0;
}
.categories {
color: #fff;
font-size: 10px;
@ -101,14 +103,14 @@
.success-buttons {
display: flex;
justify-content: center;
gap: 10px;
margin-top: 0px;
gap: 20px;
margin-top: 20px;
}
.btn-home {
position: relative;
width: 140px;
height: 50px;
width: 150px;
height: 60px;
color: #fff;
justify-content: center;
align-items: center;
@ -123,8 +125,8 @@
}
.btn-edit {
position: relative;
width: 140px;
height: 50px;
width: 150px;
height: 60px;
color: #fff;
justify-content: center;
align-items: center;
@ -138,18 +140,4 @@
}
@media (min-width: 1024px) {
.btn-edit, .btn-home {
width: 200px;
height: 50px;
font-size: 20px;
}
.success-title h1 {
font-size: 32px;
}
.success-message h2 {
font-size: 26px;
}
}

View File

@ -48,10 +48,6 @@ function Records() {
navigate("/totalsuccessfully");
};
const handleBackHomeClick = () => {
navigate("/")
}
const handleEditClick = () => {
const idToEdit = entryId || (lastEntry ? lastEntry.id : null);
@ -69,7 +65,6 @@ function Records() {
};
return (
<div className="container">
<div className="back_arrows">
<FontAwesomeIcon
@ -100,7 +95,7 @@ function Records() {
</div>
<div className="success-buttons">
<div className="btn-home" onClick={handleBackHomeClick}>Home</div>
<div className="btn-home" onClick={handleBackClick}>Home</div>
<div className="btn-edit" onClick={handleEditClick}>Edit</div>
</div>
</div>

View File

@ -0,0 +1,13 @@
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
}