From a790c2b24f27d3be25b3bba9c2f7dbeccb8fb4a0 Mon Sep 17 00:00:00 2001 From: ErickSkrauch Date: Wed, 22 Jul 2020 18:15:58 +0300 Subject: [PATCH] Rework layout of the profile --- packages/app/components/profile/Profile.tsx | 79 ++++++++++++------- .../app/components/profile/ProfileField.tsx | 4 +- packages/app/components/profile/profile.scss | 8 +- 3 files changed, 61 insertions(+), 30 deletions(-) diff --git a/packages/app/components/profile/Profile.tsx b/packages/app/components/profile/Profile.tsx index 794e9ee..a9090dc 100644 --- a/packages/app/components/profile/Profile.tsx +++ b/packages/app/components/profile/Profile.tsx @@ -2,8 +2,10 @@ import React, { ComponentType, useCallback, useRef } from 'react'; import { FormattedMessage as Message } from 'react-intl'; import { Link } from 'react-router-dom'; import { Helmet } from 'react-helmet-async'; + import { ChangeLanguageLink } from 'app/components/languageSwitcher'; import { RelativeTime } from 'app/components/ui'; +import { Button } from 'app/components/ui/form'; import { User } from 'app/components/user'; import RulesPage from 'app/pages/rules/RulesPage'; @@ -61,7 +63,7 @@ const Profile: ComponentType = ({ user, activeLocale }) => {
-
+

@@ -108,20 +110,6 @@ const Profile: ComponentType = ({ user, activeLocale }) => { value={user.email} /> - } - value={ - , - }} - /> - } - /> - } value={} @@ -150,18 +138,6 @@ const Profile: ComponentType = ({ user, activeLocale }) => { } /> - } - value={ - user.isOtpEnabled ? ( - - ) : ( - - ) - } - /> - } value={ @@ -175,6 +151,55 @@ const Profile: ComponentType = ({ user, activeLocale }) => { } />

+ +
+
+

+ +

+

+ +

+
+ + } + value={ + , + }} + /> + } + /> + + } + value={ + user.isOtpEnabled ? ( + + ) : ( + + ) + } + /> + + + + + } + /> +
diff --git a/packages/app/components/profile/ProfileField.tsx b/packages/app/components/profile/ProfileField.tsx index 417b5e5..194682e 100644 --- a/packages/app/components/profile/ProfileField.tsx +++ b/packages/app/components/profile/ProfileField.tsx @@ -10,7 +10,7 @@ function ProfileField({ link, onChange, }: { - label: React.ReactNode; + label?: React.ReactNode; link?: string; onChange?: () => void; value: React.ReactNode; @@ -29,7 +29,7 @@ function ProfileField({ return (
-
{label}
+ {label ?
{label}
: ''}
{value}
{Action && ( diff --git a/packages/app/components/profile/profile.scss b/packages/app/components/profile/profile.scss index e10aacc..e7651c5 100644 --- a/packages/app/components/profile/profile.scss +++ b/packages/app/components/profile/profile.scss @@ -10,7 +10,6 @@ $formColumnWidth: 416px; .formColumn { width: $formColumnWidth; min-width: $formColumnWidth; // Чтобы flex не ужимал блок, несмотря на фикс ширину выше - border-bottom: 10px solid #ddd8ce; } .descriptionColumn { @@ -30,6 +29,13 @@ $formColumnWidth: 416px; color: #9a9a9a; } +.profilePanel { + composes: form from '~app/components/profile/profileForm.scss'; + + margin-bottom: 30px; + border-bottom: 10px solid #ddd8ce; +} + .item { padding: 30px; border-bottom: 1px solid #eee;