From 70bede9bb02ffa77a8121740d5fe4cedacdb7149 Mon Sep 17 00:00:00 2001 From: Ilya Oleshko Date: Mon, 5 Aug 2019 13:22:17 +0300 Subject: [PATCH 1/2] Web: People: Profile: Render optimization --- .../pages/Profile/Section/Body/index.js | 35 +++++++++++-------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/products/ASC.People/Client/src/components/pages/Profile/Section/Body/index.js b/products/ASC.People/Client/src/components/pages/Profile/Section/Body/index.js index f8b8fc53cf..2a02d83c64 100644 --- a/products/ASC.People/Client/src/components/pages/Profile/Section/Body/index.js +++ b/products/ASC.People/Client/src/components/pages/Profile/Section/Body/index.js @@ -126,6 +126,13 @@ const createContacts = (contacts) => { const SectionBodyContent = (props) => { const { profile, history, isSelf, settings } = props; const contacts = profile.contacts && getContacts(profile.contacts); + const role = getUserRole(profile); + const workFrom = getFormattedDate(profile.workFrom); + const birthDay = getFormattedDate(profile.birthday); + const formatedSex = capitalizeFirstLetter(profile.sex); + const formatedDepartments = getFormattedDepartments(profile.department); + const socialContacts = createContacts(contacts.social); + const infoContacts = createContacts(contacts.contact); const onEmailClick = useCallback( () => window.open('mailto:' + profile.email), @@ -147,17 +154,10 @@ const SectionBodyContent = (props) => { [history, settings.homepage, profile.userName] ); - console.log(profile); - return (
- +
@@ -176,13 +176,18 @@ const SectionBodyContent = (props) => {
{profile.isVisitor ? "Guest" : "Employee"} - {profile.email}{profile.activationStatus === 2 && ' (Pending)'} - {getFormattedDepartments(profile.department)} + + + {profile.email} + + {profile.activationStatus === 2 && ' (Pending)'} + + {formatedDepartments} {profile.title} {profile.mobilePhone} - {capitalizeFirstLetter(profile.sex)} - {getFormattedDate(profile.workFrom)} - {getFormattedDate(profile.birthday)} + {formatedSex} + {workFrom} + {birthDay} {profile.location} {isSelf && {profile.cultureName}} {isSelf &&