Changed to camel case
This commit is contained in:
1 parent
73801fa6cc
commit
c5b56dbc2b
6 files changed
+23
-23
No files matched your search
@@ -30,7 +30,7 @@ const Avatar = ({ src, small, sx }) => {
|
||||
|
||||
return (
|
||||
<MuiAvatar
|
||||
alt={`${user?.firstname} ${user?.lastname}`}
|
||||
alt={`${user?.firstName} ${user?.lastName}`}
|
||||
src={
|
||||
src ? src : user?.avatarImage ? image : "/static/images/avatar/2.jpg"
|
||||
}
|
||||
@@ -51,7 +51,7 @@ const Avatar = ({ src, small, sx }) => {
|
||||
...sx,
|
||||
}}
|
||||
>
|
||||
{user.firstname?.charAt(0)}{user.lastname?.charAt(0)}
|
||||
{user.firstName?.charAt(0)}{user.lastName?.charAt(0)}
|
||||
</MuiAvatar>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -150,7 +150,7 @@ function NavBar() {
|
||||
<div className="icon-button-toggle">
|
||||
<Avatar small={true} sx={{ mr: "8px" }} />
|
||||
<div className="icon-button-toggle-title">
|
||||
{authState.user.firstname} {authState.user.lastname}
|
||||
{authState.user.firstName} {authState.user.lastName}
|
||||
</div>
|
||||
<img
|
||||
className="icon-button-toggle-pic"
|
||||
|
||||
@@ -36,16 +36,16 @@ const ProfilePanel = () => {
|
||||
const { user, authToken, isLoading } = useSelector((state) => state.auth);
|
||||
|
||||
const idToName = {
|
||||
"edit-first-name": "firstname",
|
||||
"edit-last-name": "lastname",
|
||||
"edit-first-name": "firstName",
|
||||
"edit-last-name": "lastName",
|
||||
// Disabled for now, will revisit in the future
|
||||
// "edit-email": "email",
|
||||
};
|
||||
|
||||
// Local state for form data, errors, and file handling
|
||||
const [localData, setLocalData] = useState({
|
||||
firstname: user.firstname,
|
||||
lastname: user.lastname,
|
||||
firstName: user.firstName,
|
||||
lastName: user.lastName,
|
||||
// email: user.email, // Disabled for now
|
||||
});
|
||||
const [errors, setErrors] = useState({});
|
||||
@@ -156,8 +156,8 @@ const ProfilePanel = () => {
|
||||
const handleSaveProfile = async (event) => {
|
||||
event.preventDefault();
|
||||
if (
|
||||
localData.firstname === user.firstname &&
|
||||
localData.lastname === user.lastname &&
|
||||
localData.firstName === user.firstName &&
|
||||
localData.lastName === user.lastName &&
|
||||
localData.deleteProfileImage === undefined &&
|
||||
localData.file === undefined
|
||||
) {
|
||||
@@ -223,7 +223,7 @@ const ProfilePanel = () => {
|
||||
</Stack>
|
||||
<Field
|
||||
id="edit-first-name"
|
||||
value={localData.firstname}
|
||||
value={localData.firstName}
|
||||
placeholder="Enter your first name"
|
||||
autoComplete="given-name"
|
||||
onChange={handleChange}
|
||||
@@ -238,7 +238,7 @@ const ProfilePanel = () => {
|
||||
id="edit-last-name"
|
||||
placeholder="Enter your last name"
|
||||
autoComplete="family-name"
|
||||
value={localData.lastname}
|
||||
value={localData.lastName}
|
||||
onChange={handleChange}
|
||||
error={errors[idToName["edit-last-name"]]}
|
||||
/>
|
||||
|
||||
Reference in new issue
Block a user