forked from MyPeerformance/peerformance-my-account
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOriginal_AccountSettings.js
More file actions
52 lines (44 loc) · 1.51 KB
/
Copy pathOriginal_AccountSettings.js
File metadata and controls
52 lines (44 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import React, { useState } from "react";
export default function AccountSettings() {
const [isEditing, setIsEditing] = useState(false);
const [name, setName] = useState("Jane Doe");
const [email, setEmail] = useState("jane@company.com");
const label = {
fontSize: "0.85rem",
color: "#cbd5e0",
display: "block",
marginBottom: "0.3rem",
};
const input = {
width: "100%",
padding: "0.6rem",
borderRadius: "8px",
backgroundColor: "#1a202c",
border: "1px solid #4a5568",
color: "#fff",
marginBottom: "1rem",
};
const toggleButton = {
fontSize: "0.9rem",
color: "#63b3ed",
cursor: "pointer",
float: "right",
marginBottom: "1rem",
};
return (
<div style={{ padding: "2rem 0", maxWidth: "850px" }}>
<div style={{ marginBottom: "1rem", display: "flex", justifyContent: "space-between" }}>
<h3 style={{ color: "#38d881" }}>Personal Details</h3>
<span style={toggleButton} onClick={() => setIsEditing(!isEditing)}>
{isEditing ? "Cancel" : "Edit"}
</span>
</div>
<label style={label}>Full Name</label>
<input style={input} value={name} onChange={(e) => setName(e.target.value)} disabled={!isEditing} />
<label style={label}>Email Address</label>
<input style={input} value={email} onChange={(e) => setEmail(e.target.value)} disabled={!isEditing} />
<label style={label}>Phone Number</label>
<input style={input} placeholder="e.g. +44 7911 123456" disabled />
</div>
);
}