diff --git a/client/package.json b/client/package.json index c929497..7267c75 100644 --- a/client/package.json +++ b/client/package.json @@ -19,6 +19,7 @@ "@emotion/react": "^11.13.0", "@emotion/styled": "^11.13.0", "@hookform/resolvers": "^3.9.0", + "@react-email/components": "^0.0.33", "@react-pdf/renderer": "^4.1.6", "axios": "^1.7.4", "firebase": "10.12.5", diff --git a/client/src/assets/icons/CkEmail.svg b/client/src/assets/icons/CkEmail.svg new file mode 100644 index 0000000..a744ae2 --- /dev/null +++ b/client/src/assets/icons/CkEmail.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/client/src/components/email/SendEmailButton.jsx b/client/src/components/email/SendEmailButton.jsx new file mode 100644 index 0000000..7931dae --- /dev/null +++ b/client/src/components/email/SendEmailButton.jsx @@ -0,0 +1,62 @@ +import React, { useState } from "react"; + +import { + Button, + Flex, + Input, + FormControl, + FormErrorMessage +} from "@chakra-ui/react"; + +import { useBackendContext } from "../../contexts/hooks/useBackendContext"; + +const SendEmailButton = () => { + const { backend } = useBackendContext(); + const [email, setEmail] = useState(""); + const [error, setError] = useState(""); + + const validateEmail = (email) => { + const regex = /\S+@\S+\.\S+/; + return regex.test(email); + }; + + const sendEmail = async () => { + if (!validateEmail(email)) { + setError("Please enter a valid email address."); + return; + } + + const response = await backend.post("/email/send", { + to: email, + subject: "Invoice", + text: "This is a test email.", + html: "

This is a test email.

" + }); + + console.log(response.data); + }; + + return ( + + + { + setEmail(e.target.value); + setError(""); + }} + > + + + + {error} + + ); +} + +export { SendEmailButton }; \ No newline at end of file diff --git a/client/src/components/navbar/Navbar.css b/client/src/components/navbar/Navbar.css index 2591ad1..96ed01f 100644 --- a/client/src/components/navbar/Navbar.css +++ b/client/src/components/navbar/Navbar.css @@ -21,6 +21,14 @@ color: #474849; } +.navTextChosen { + margin-left: 3%; + width: 90%; + font-weight: 500; + font-size: 150%; + color: #4E4AE7; +} + .navLink, .navText, .navIcon, .navItem { color: #474849; } diff --git a/client/src/components/navbar/Navbar.jsx b/client/src/components/navbar/Navbar.jsx index 7541c97..fa0ef6f 100644 --- a/client/src/components/navbar/Navbar.jsx +++ b/client/src/components/navbar/Navbar.jsx @@ -8,7 +8,7 @@ import { Logo } from "../../assets/logo/Logo"; import "./Navbar.css"; -const Navbar = ({ children }) => { +const Navbar = ({ children, notificationsCount, currentPage = "" }) => { const menuItems = [ { name: "Programs", path: "/programs", icon: }, { name: "Invoices", path: "/invoices", icon: }, @@ -16,10 +16,12 @@ const Navbar = ({ children }) => { name: "Notifications", path: "/notifications", icon: , + count: notificationsCount, }, { name: "Settings", path: "/settings", icon: }, ]; + console.log(currentPage) return (