big_glist #5
10
package-lock.json
generated
10
package-lock.json
generated
@ -19,6 +19,7 @@
|
|||||||
"qrcode.react": "^4.0.1",
|
"qrcode.react": "^4.0.1",
|
||||||
"react": "^18.3.1",
|
"react": "^18.3.1",
|
||||||
"react-dom": "^18.3.1",
|
"react-dom": "^18.3.1",
|
||||||
|
"react-image-crop": "^11.0.7",
|
||||||
"react-leaflet": "^4.2.1",
|
"react-leaflet": "^4.2.1",
|
||||||
"react-router-dom": "^6.26.2",
|
"react-router-dom": "^6.26.2",
|
||||||
"react-scripts": "5.0.1",
|
"react-scripts": "5.0.1",
|
||||||
@ -16529,6 +16530,15 @@
|
|||||||
"integrity": "sha512-/6UZ2qgEyH2aqzYZgQPxEnz33NJ2gNsnHA2o5+o4wW9bLM/JYQitNP9xPhsXwC08hMMovfGe/8retsdDsczPRg==",
|
"integrity": "sha512-/6UZ2qgEyH2aqzYZgQPxEnz33NJ2gNsnHA2o5+o4wW9bLM/JYQitNP9xPhsXwC08hMMovfGe/8retsdDsczPRg==",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
"node_modules/react-image-crop": {
|
||||||
|
"version": "11.0.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/react-image-crop/-/react-image-crop-11.0.7.tgz",
|
||||||
|
"integrity": "sha512-ZciKWHDYzmm366JDL18CbrVyjnjH0ojufGDmScfS4ZUqLHg4nm6ATY+K62C75W4ZRNt4Ii+tX0bSjNk9LQ2xzQ==",
|
||||||
|
"license": "ISC",
|
||||||
|
"peerDependencies": {
|
||||||
|
"react": ">=16.13.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/react-is": {
|
"node_modules/react-is": {
|
||||||
"version": "17.0.2",
|
"version": "17.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
"qrcode.react": "^4.0.1",
|
"qrcode.react": "^4.0.1",
|
||||||
"react": "^18.3.1",
|
"react": "^18.3.1",
|
||||||
"react-dom": "^18.3.1",
|
"react-dom": "^18.3.1",
|
||||||
|
"react-image-crop": "^11.0.7",
|
||||||
"react-leaflet": "^4.2.1",
|
"react-leaflet": "^4.2.1",
|
||||||
"react-router-dom": "^6.26.2",
|
"react-router-dom": "^6.26.2",
|
||||||
"react-scripts": "5.0.1",
|
"react-scripts": "5.0.1",
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
work correctly both with client-side routing and a non-root public URL.
|
work correctly both with client-side routing and a non-root public URL.
|
||||||
Learn how to configure a non-root public URL by running `npm run build`.
|
Learn how to configure a non-root public URL by running `npm run build`.
|
||||||
-->
|
-->
|
||||||
<title>React App</title>
|
<title>YANDEX ZAKLADKI</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 15 KiB |
Binary file not shown.
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 15 KiB |
@ -1,87 +1,140 @@
|
|||||||
.user-account {
|
.user-account {
|
||||||
padding: 20px;
|
padding: 40px;
|
||||||
background-color: #f4f4f4;
|
background-color: #ffffff;
|
||||||
border-radius: 10px;
|
border-radius: 15px;
|
||||||
max-width: 400px;
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
||||||
margin: 0 auto;
|
max-width: 600px;
|
||||||
|
margin: 60px auto;
|
||||||
h1 {
|
font-family: 'Arial', sans-serif;
|
||||||
text-align: center;
|
|
||||||
|
h1 {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 28px;
|
||||||
|
color: #333;
|
||||||
|
margin-bottom: 30px;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.user-info, .edit-form {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 20px;
|
||||||
|
|
||||||
|
.avatar-container {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-start;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
|
|
||||||
|
.avatar {
|
||||||
|
width: 100px;
|
||||||
|
height: 100px;
|
||||||
|
border-radius: 50%;
|
||||||
|
object-fit: cover;
|
||||||
|
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.avatar-placeholder {
|
||||||
|
width: 100px;
|
||||||
|
height: 100px;
|
||||||
|
background-color: #3498db;
|
||||||
|
color: white;
|
||||||
|
font-size: 36px;
|
||||||
|
border-radius: 50%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.user-info, .edit-form {
|
p, input {
|
||||||
|
font-size: 18px;
|
||||||
|
color: #333;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
padding: 10px 15px;
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
border-radius: 8px;
|
||||||
|
background-color: #f9f9f9;
|
||||||
|
outline: none;
|
||||||
|
transition: border-color 0.3s ease;
|
||||||
|
|
||||||
|
&:focus {
|
||||||
|
border-color: #3498db;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
label {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 10px;
|
font-size: 16px;
|
||||||
|
color: #666;
|
||||||
label {
|
margin-bottom: 15px;
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
input[type="text"], input[type="email"], input[type="tel"], input[type="file"] {
|
||||||
|
padding: 10px;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
|
border-radius: 8px;
|
||||||
|
background-color: #f9f9f9;
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
margin-top: 10px;
|
||||||
|
transition: border-color 0.3s ease;
|
||||||
|
|
||||||
|
&:focus {
|
||||||
|
border-color: #3498db;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
input {
|
|
||||||
padding: 8px;
|
.buttons {
|
||||||
font-size: 14px;
|
display: flex;
|
||||||
border: 1px solid #ccc;
|
justify-content: space-between;
|
||||||
border-radius: 5px;
|
|
||||||
}
|
button {
|
||||||
|
padding: 14px 30px;
|
||||||
p {
|
font-size: 16px;
|
||||||
font-size: 18px;
|
cursor: pointer;
|
||||||
margin: 10px 0;
|
border: none;
|
||||||
}
|
border-radius: 8px;
|
||||||
|
background-color: #3498db;
|
||||||
.buttons {
|
color: white;
|
||||||
display: flex;
|
transition: background-color 0.3s ease, transform 0.2s ease;
|
||||||
justify-content: space-between;
|
|
||||||
|
&:hover {
|
||||||
button {
|
background-color: #2980b9;
|
||||||
padding: 10px 20px;
|
transform: scale(1.03);
|
||||||
font-size: 14px;
|
}
|
||||||
cursor: pointer;
|
|
||||||
border: none;
|
&:last-child {
|
||||||
border-radius: 5px;
|
background-color: #e74c3c;
|
||||||
background-color: #3498db;
|
|
||||||
color: white;
|
|
||||||
transition: background-color 0.3s ease;
|
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: #2980b9;
|
background-color: #c0392b;
|
||||||
}
|
|
||||||
|
|
||||||
&:last-child {
|
|
||||||
background-color: #e74c3c;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
background-color: #c0392b;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
.edit-button {
|
|
||||||
margin-top: 20px;
|
.edit-button {
|
||||||
padding: 10px 25px;
|
margin-top: 30px;
|
||||||
font-size: 16px;
|
padding: 14px 35px;
|
||||||
font-weight: bold;
|
font-size: 18px;
|
||||||
cursor: pointer;
|
font-weight: 600;
|
||||||
background-color: #2ecc71; /* Зелёный цвет */
|
cursor: pointer;
|
||||||
color: white;
|
background-color: #2ecc71;
|
||||||
border: none;
|
color: white;
|
||||||
border-radius: 5px;
|
border: none;
|
||||||
transition: background-color 0.3s ease, transform 0.2s ease;
|
border-radius: 8px;
|
||||||
|
transition: background-color 0.3s ease, transform 0.3s ease;
|
||||||
&:hover {
|
|
||||||
background-color: #27ae60;
|
&:hover {
|
||||||
transform: scale(1.05); /* Небольшой зум при наведении */
|
background-color: #27ae60;
|
||||||
}
|
transform: scale(1.05);
|
||||||
|
|
||||||
&:active {
|
|
||||||
background-color: #1e8449;
|
|
||||||
transform: scale(0.98); /* Легкий уменьшенный эффект при нажатии */
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
&:active {
|
||||||
|
background-color: #1e8449;
|
||||||
|
transform: scale(0.98);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -6,6 +6,7 @@ const UserAccount = () => {
|
|||||||
username: 'Мамут Рахал',
|
username: 'Мамут Рахал',
|
||||||
email: 'yatupoidayn@mail.ru',
|
email: 'yatupoidayn@mail.ru',
|
||||||
phone: '+666',
|
phone: '+666',
|
||||||
|
avatar: '', // Новое поле для аватара
|
||||||
});
|
});
|
||||||
|
|
||||||
const [isEditing, setIsEditing] = useState(false);
|
const [isEditing, setIsEditing] = useState(false);
|
||||||
@ -19,6 +20,21 @@ const UserAccount = () => {
|
|||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Функция для загрузки аватара
|
||||||
|
const handleAvatarChange = (e) => {
|
||||||
|
const file = e.target.files[0];
|
||||||
|
if (file) {
|
||||||
|
const reader = new FileReader();
|
||||||
|
reader.onloadend = () => {
|
||||||
|
setFormData((prevData) => ({
|
||||||
|
...prevData,
|
||||||
|
avatar: reader.result,
|
||||||
|
}));
|
||||||
|
};
|
||||||
|
reader.readAsDataURL(file);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const handleSave = () => {
|
const handleSave = () => {
|
||||||
setUserData(formData);
|
setUserData(formData);
|
||||||
setIsEditing(false);
|
setIsEditing(false);
|
||||||
@ -62,6 +78,14 @@ const UserAccount = () => {
|
|||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
|
<label>
|
||||||
|
Загрузить аватар:
|
||||||
|
<input
|
||||||
|
type="file"
|
||||||
|
accept="image/*"
|
||||||
|
onChange={handleAvatarChange}
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
<div className="buttons">
|
<div className="buttons">
|
||||||
<button onClick={handleSave}>Сохранить</button>
|
<button onClick={handleSave}>Сохранить</button>
|
||||||
<button onClick={handleCancel}>Отмена</button>
|
<button onClick={handleCancel}>Отмена</button>
|
||||||
@ -69,6 +93,13 @@ const UserAccount = () => {
|
|||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="user-info">
|
<div className="user-info">
|
||||||
|
<div className="avatar-container">
|
||||||
|
{userData.avatar ? (
|
||||||
|
<img src={userData.avatar} alt="User Avatar" className="avatar" />
|
||||||
|
) : (
|
||||||
|
<div className="avatar-placeholder">A</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
<p><strong>Имя:</strong> {userData.username}</p>
|
<p><strong>Имя:</strong> {userData.username}</p>
|
||||||
<p><strong>Email:</strong> {userData.email}</p>
|
<p><strong>Email:</strong> {userData.email}</p>
|
||||||
<p><strong>Телефон:</strong> {userData.phone}</p>
|
<p><strong>Телефон:</strong> {userData.phone}</p>
|
||||||
|
Loading…
Reference in New Issue
Block a user