Skip to content

Commit 9f5833b

Browse files
authored
Merge pull request #78 from CS3219-AY2425S1/titus/remove-update-for-username
fix: remove update for username
2 parents fbafcdd + 9b0c302 commit 9f5833b

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

apps/frontend/src/app/profile/page.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ import {
44
Avatar,
55
Button,
66
Col,
7-
Divider,
87
Form,
98
Input,
109
Layout,
1110
message,
1211
Row,
12+
Tooltip,
1313
} from "antd";
1414
import { Content } from "antd/es/layout/layout";
1515
import "./styles.scss";
1616
import { EditOutlined, SaveOutlined } from "@ant-design/icons";
17-
import { useEffect, useState, useLayoutEffect } from "react";
17+
import { useEffect, useState } from "react";
1818
import {
1919
UpdateUser,
2020
ValidateUser,
@@ -117,14 +117,14 @@ const ProfilePage = (props: ProfilePageProps): JSX.Element => {
117117
<Form.Item
118118
name="username"
119119
label="Username"
120+
tooltip="Unmodifable to prevent confusion in other users history when your username changes"
120121
rules={[
121122
{
122-
required: true,
123123
message: "Please enter valid username!",
124124
},
125125
]}
126126
>
127-
<Input name="username" />
127+
<Input name="username" disabled />
128128
</Form.Item>
129129
</Col>
130130
<Col span={12}>
@@ -144,7 +144,11 @@ const ProfilePage = (props: ProfilePageProps): JSX.Element => {
144144
</Row>
145145
<Row gutter={16}>
146146
<Col span={12}>
147-
<Form.Item name="password" label="Password">
147+
<Form.Item
148+
name="password"
149+
label="Password"
150+
tooltip="Password is not updated if this field is left empty"
151+
>
148152
<Input.Password
149153
name="password"
150154
type="password"

0 commit comments

Comments
 (0)