Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…k-class-frontend into develop
  • Loading branch information
Emil307 committed Aug 19, 2023
2 parents a906506 + e197089 commit ccd98f6
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 88 deletions.
2 changes: 1 addition & 1 deletion src/features/Copy/ui/CopyLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const CopyLink: React.FC = () => {
}

return (
<Tooltip active={tooltipActive}>
<Tooltip active={tooltipActive} message="Ссылка скопирована!">
<Button onClick={copyLink}>
<svg
width="18"
Expand Down
109 changes: 22 additions & 87 deletions src/features/editUser/ui/EditUserForm.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useState } from "react";
import styled from "styled-components";
import styles from "./styles.module.css";
import ProfileFormLayout from "../../../widgets/layout/ProfileFormLayout";
import { useAuth0 } from "@auth0/auth0-react";
import avatarDefault from "../../../../public/icons/avatar.svg";
Expand Down Expand Up @@ -32,78 +33,6 @@ const Form = styled.form`
}
`;

const User = styled.div`
height: 100%;
display: flex;
align-items: center;
gap: 20px;
`;

const Avatar = styled.div`
width: 86px;
height: 86px;
border-radius: 10px;
border: 2px dashed #175ef1;
position: relative;
`;

const InputAvatar = styled.input`
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
color: transparent;
&:hover {
cursor: pointer;
}
&::file-selector-button {
display: none;
}
`;

const Info = styled.div`
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 8px;
`;

const Name = styled.input`
width: 100%;
font-size: 22px;
font-weight: 500;
`;

const Email = styled.div`
display: flex;
align-items: center;
gap: 12px;
`;

const EmailText = styled.div`
font-size: 20px;
font-weight: 300;
line-height: normal;
`;

const AccessEmail = styled.a`
font-size: 20px;
font-weight: 300;
line-height: normal;
`;

const AccessText = styled.a`
color: var(--red, #f95a39);
&:hover {
text-decoration: underline;
cursor: pointer;
}
`;

export const EditUserForm: React.FC = observer(() => {
const { user } = useAuth0();
const [avatar, setAvatar] = useState(user?.picture || avatarDefault);
Expand Down Expand Up @@ -132,44 +61,50 @@ export const EditUserForm: React.FC = observer(() => {
encType="multipart/form-data"
onSubmit={saveChanges}
>
<User>
<Avatar>
<div className={styles.user}>
<div className={styles.avatar}>
<img
src={avatar}
alt=""
style={{ width: "100%", height: "100%", borderRadius: "7px" }}
/>
<InputAvatar type="file" title=" " onChange={onImageChange} />
</Avatar>
<Info>
<Name
<input
className={styles.inputAvatar}
type="file"
title=" "
onChange={onImageChange}
/>
</div>
<div className={styles.info}>
<input
className={styles.name}
type="text"
value={name}
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
setName(e.target.value)
}
autoFocus
/>
<Email>
<EmailText>{user?.email}</EmailText>
<div className={styles.email}>
<div className={styles.emailText}>{user?.email}</div>
{!user?.email_verified ? (
<AccessEmail>
<a className={styles.accessEmail}>
{profileFormState.isEmailConfirmed ? (
<div style={{ color: "var(--green, #5bc259)" }}>
На вашу почту выслано письмо с подтверждением
</div>
) : (
<AccessText onClick={sendAccess}>
<a className={styles.accessText} onClick={sendAccess}>
Подтвердите почту
</AccessText>
</a>
)}
</AccessEmail>
</a>
) : (
""
)}
</Email>
</Info>
</User>
</div>
</div>
</div>
<FormButton>Сохранить</FormButton>
</Form>
</ProfileFormLayout>
Expand Down
71 changes: 71 additions & 0 deletions src/features/editUser/ui/styles.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
.user {
height: 100%;
display: flex;
align-items: center;
gap: 20px;
}

.avatar {
width: 86px;
height: 86px;
border-radius: 10px;
border: 2px dashed #175ef1;
position: relative;
}

.inputAvatar {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
color: transparent;

&:hover {
cursor: pointer;
}

&::file-selector-button {
display: none;
}
}

.info {
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 8px;
}

.name {
width: 100%;
font-size: 22px;
font-weight: 500;
}

.email {
display: flex;
align-items: center;
gap: 12px;
}

.emailText {
font-size: 20px;
font-weight: 300;
line-height: normal;
}

.accessEmail {
font-size: 20px;
font-weight: 300;
line-height: normal;
}

.accessText {
color: var(--red, #f95a39);

&:hover {
text-decoration: underline;
cursor: pointer;
}
}

0 comments on commit ccd98f6

Please sign in to comment.