Skip to content

Commit

Permalink
fix(frontend): 🐛 remove modifiability of username
Browse files Browse the repository at this point in the history
Removes the ability to change username, which fixes the problem in the submission history, as records are queried based on username. This design also is more consistent for users as their matched users usernames in their history remains consistent.
  • Loading branch information
tituschewxj committed Nov 12, 2024
1 parent 31a6bd1 commit 9b0c302
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions apps/frontend/src/app/profile/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ import {
Avatar,
Button,
Col,
Divider,
Form,
Input,
Layout,
message,
Row,
Tooltip,
} from "antd";
import { Content } from "antd/es/layout/layout";
import "./styles.scss";
import { EditOutlined, SaveOutlined } from "@ant-design/icons";
import { useEffect, useState, useLayoutEffect } from "react";
import { useEffect, useState } from "react";
import {
UpdateUser,
ValidateUser,
Expand Down Expand Up @@ -117,14 +117,14 @@ const ProfilePage = (props: ProfilePageProps): JSX.Element => {
<Form.Item
name="username"
label="Username"
tooltip="Unmodifable to prevent confusion in other users history when your username changes"
rules={[
{
required: true,
message: "Please enter valid username!",
},
]}
>
<Input name="username" />
<Input name="username" disabled />
</Form.Item>
</Col>
<Col span={12}>
Expand All @@ -144,7 +144,11 @@ const ProfilePage = (props: ProfilePageProps): JSX.Element => {
</Row>
<Row gutter={16}>
<Col span={12}>
<Form.Item name="password" label="Password">
<Form.Item
name="password"
label="Password"
tooltip="Password is not updated if this field is left empty"
>
<Input.Password
name="password"
type="password"
Expand Down

0 comments on commit 9b0c302

Please sign in to comment.