Your password is incorrect or this account doesn't exist.
) : (
@@ -93,9 +93,9 @@ const Login = observer(() => {
Login
Don't have an account?{" "}
diff --git a/frontend/src/Profile.tsx b/frontend/src/Profile.tsx
deleted file mode 100644
index 641db377..00000000
--- a/frontend/src/Profile.tsx
+++ /dev/null
@@ -1,175 +0,0 @@
-import React, { useState } from "react";
-import { observer } from "mobx-react-lite";
-import { useAuthContext } from "./context/auth/authContext";
-import { updateUserProfile } from "./external/bcanSatchel/actions";
-import { toJS } from 'mobx';
-import { Link } from "react-router-dom";
-import { api } from "./api";
-import { UserStatus } from "../../middle-layer/types/UserStatus";
-
-/**
- * Current logged in user's profile
- * Information can be updated for the profile here.
- */
-const Profile = observer(() => {
- const { user } = useAuthContext();
- const [email, setEmail] = useState(user?.email || "");
- const [position, setPosition] = useState(user?.position || "");
-
- console.log(toJS(user))
-
- const handleSubmit = async (e: React.FormEvent) => {
- e.preventDefault();
-
- try {
- const response = await api("/auth/update-profile", {
- method: "POST",
- headers: {
- "Content-Type": "application/json",
- // TODO: Bearer token guarded by Auth
- // Authorization: `Bearer ${user?.accessToken ?? ""}`,
- },
- body: JSON.stringify({
- username: user?.userId,
- email,
- position: position,
- }),
- });
-
- if (!response.ok) {
- const errorData = await response.json();
- alert(errorData.message || "Failed to update profile.");
- return;
- }
-
- // Optionally parse the updated item returned
- // const updatedData = await response.json();
-
- // Update local store so changes reflect immediately in the UI
- // Conditional update semantics based on valid non-null 'User' object available
- // eslint-disable-next-line @typescript-eslint/no-unused-expressions
- user && updateUserProfile({
- ...user,
- email,
- position: position as UserStatus,
- });
-
- alert("Profile updated successfully.");
- } catch (error) {
- console.error("Error updating profile:", error);
- alert("An error occurred while updating your profile.");
- }
- };
-
- return (
-
- );
-});
-
-export default Profile;
-
-// Style objects
-const styles: { [key: string]: React.CSSProperties } = {
- formContainer: {
- width: "500px",
- padding: "2rem",
- backgroundColor: "#ffffff",
- borderRadius: "8px",
- boxShadow: "0 2px 10px rgba(0,0,0,0.15)",
- display: "flex",
- flexDirection: "column",
- margin: "0 auto",
- },
- heading: {
- marginBottom: "1.5rem",
- fontSize: "2rem",
- fontWeight: 500,
- textAlign: "center",
- },
- field: {
- marginBottom: "1.5rem",
- },
- label: {
- display: "block",
- marginBottom: "0.5rem",
- fontSize: "1.2rem",
- fontWeight: 500,
- },
- readonlyValue: {
- marginLeft: "0.5rem",
- fontSize: "1.2rem",
- },
- input: {
- width: "100%",
- padding: "1rem",
- fontSize: "1.2rem",
- border: "1px solid #ccc",
- borderRadius: "4px",
- boxSizing: "border-box",
- color: "lightgray",
- },
- textarea: {
- width: "100%",
- padding: "1rem",
- fontSize: "1.2rem",
- border: "1px solid #ccc",
- borderRadius: "4px",
- boxSizing: "border-box",
- minHeight: "120px",
- color: "lightgray",
- },
- button: {
- padding: "1rem",
- fontSize: "1.1rem",
- backgroundColor: "#0b303b",
- color: "#fff",
- border: "none",
- borderRadius: "4px",
- cursor: "pointer",
- alignSelf: "flex-start",
- },
- actionButtons: {
- display: "flex",
- justifyContent: "space-between",
- alignItems: "center"
- }
-};
diff --git a/frontend/src/Register.tsx b/frontend/src/Register.tsx
index 771c7a9a..aebb88b3 100644
--- a/frontend/src/Register.tsx
+++ b/frontend/src/Register.tsx
@@ -200,9 +200,9 @@ const Register = observer(() => {
Register
Have an account?{" "}
@@ -246,14 +246,14 @@ const styles: { [key: string]: React.CSSProperties } = {
textAlign: "start",
},
warning: {
- color: "#616161",
- backgroundColor: "#E7E7E7",
+ color: "gray",
+ backgroundColor: "var(--color-light-gray-2)",
},
error: {
- color: "#D33221",
- backgroundColor: "#FFA399",
+ color: "var(--color-warning)",
+ backgroundColor: "var(--color-light-warning)",
},
errorItem: {
- borderColor: "#D33221",
+ borderColor: "var(--color-warning)",
},
};
diff --git a/frontend/src/RegisterLanding.tsx b/frontend/src/RegisterLanding.tsx
index 3562e756..39797bbe 100644
--- a/frontend/src/RegisterLanding.tsx
+++ b/frontend/src/RegisterLanding.tsx
@@ -36,7 +36,7 @@ const RegisterLanding = () => {
color: 'black',
borderStyle: 'solid', borderColor: 'black', borderWidth: '1px'
}}
- className="py-2 px-4 rounded"
+ className="py-2 mt-8 px-4 rounded-md"
onClick={() => {
logout()
}}
diff --git a/frontend/src/custom/ActionConfirmation.tsx b/frontend/src/custom/ActionConfirmation.tsx
index 0c1abda5..3c8fb9c6 100644
--- a/frontend/src/custom/ActionConfirmation.tsx
+++ b/frontend/src/custom/ActionConfirmation.tsx
@@ -51,13 +51,13 @@ import { IoIosWarning } from "react-icons/io";
-
-
+
+
-
+
{warningMessage}
@@ -70,12 +70,11 @@ import { IoIosWarning } from "react-icons/io";