From 64f174fedaed132b0c6abb69b4d2370d2b55c878 Mon Sep 17 00:00:00 2001 From: Audrey Kadjar Date: Tue, 14 Jun 2022 09:57:59 +0200 Subject: [PATCH] [#3246] fix contacts details view on third column (#3280) * contact column collapse and highlight selected * fixes * small fixes * small type fix --- .../ContactDetails/ContactIcon.tsx | 0 .../ContactDetails/ContactInfoPoint.tsx | 0 .../ConversationsForContact.tsx | 2 +- .../ContactDetails/Expandable.tsx | 0 .../ContactDetails/index.module.scss | 0 .../ContactDetails/index.tsx | 4 ++-- .../ContactDetails/util/fillContactInfo.ts | 0 .../util/getInfoDetailPayload.ts | 0 .../ContactDetails/util/index.ts | 0 .../ContactDetails/util/infoPointUtil.ts | 0 .../ContactInformation/index.module.scss | 18 +++++++++++++++ .../Contacts/ContactInformation/index.tsx | 15 ++++++++++-- .../ContactListItem/index.module.scss | 4 ++++ .../pages/Contacts/ContactListItem/index.tsx | 23 +++++++++++++++---- .../src/pages/Contacts/index.module.scss | 10 +++++++- frontend/inbox/src/pages/Contacts/index.tsx | 16 +++++++++++-- .../Messenger/ConversationMetadata/index.tsx | 2 +- .../images/icons/collapseRightArrows.svg | 3 +++ .../assets/images/icons/googleLogo.svg | 2 +- lib/typescript/assets/scss/animations.scss | 13 +++++++++++ 20 files changed, 98 insertions(+), 14 deletions(-) rename frontend/inbox/src/{pages/Inbox/Messenger/ConversationMetadata => components}/ContactDetails/ContactIcon.tsx (100%) rename frontend/inbox/src/{pages/Inbox/Messenger/ConversationMetadata => components}/ContactDetails/ContactInfoPoint.tsx (100%) rename frontend/inbox/src/{pages/Inbox/Messenger/ConversationMetadata => components}/ContactDetails/ConversationsForContact.tsx (96%) rename frontend/inbox/src/{pages/Inbox/Messenger/ConversationMetadata => components}/ContactDetails/Expandable.tsx (100%) rename frontend/inbox/src/{pages/Inbox/Messenger/ConversationMetadata => components}/ContactDetails/index.module.scss (100%) rename frontend/inbox/src/{pages/Inbox/Messenger/ConversationMetadata => components}/ContactDetails/index.tsx (98%) rename frontend/inbox/src/{pages/Inbox/Messenger/ConversationMetadata => components}/ContactDetails/util/fillContactInfo.ts (100%) rename frontend/inbox/src/{pages/Inbox/Messenger/ConversationMetadata => components}/ContactDetails/util/getInfoDetailPayload.ts (100%) rename frontend/inbox/src/{pages/Inbox/Messenger/ConversationMetadata => components}/ContactDetails/util/index.ts (100%) rename frontend/inbox/src/{pages/Inbox/Messenger/ConversationMetadata => components}/ContactDetails/util/infoPointUtil.ts (100%) create mode 100644 lib/typescript/assets/images/icons/collapseRightArrows.svg diff --git a/frontend/inbox/src/pages/Inbox/Messenger/ConversationMetadata/ContactDetails/ContactIcon.tsx b/frontend/inbox/src/components/ContactDetails/ContactIcon.tsx similarity index 100% rename from frontend/inbox/src/pages/Inbox/Messenger/ConversationMetadata/ContactDetails/ContactIcon.tsx rename to frontend/inbox/src/components/ContactDetails/ContactIcon.tsx diff --git a/frontend/inbox/src/pages/Inbox/Messenger/ConversationMetadata/ContactDetails/ContactInfoPoint.tsx b/frontend/inbox/src/components/ContactDetails/ContactInfoPoint.tsx similarity index 100% rename from frontend/inbox/src/pages/Inbox/Messenger/ConversationMetadata/ContactDetails/ContactInfoPoint.tsx rename to frontend/inbox/src/components/ContactDetails/ContactInfoPoint.tsx diff --git a/frontend/inbox/src/pages/Inbox/Messenger/ConversationMetadata/ContactDetails/ConversationsForContact.tsx b/frontend/inbox/src/components/ContactDetails/ConversationsForContact.tsx similarity index 96% rename from frontend/inbox/src/pages/Inbox/Messenger/ConversationMetadata/ContactDetails/ConversationsForContact.tsx rename to frontend/inbox/src/components/ContactDetails/ConversationsForContact.tsx index 7e36c1ee19..d842731b5e 100644 --- a/frontend/inbox/src/pages/Inbox/Messenger/ConversationMetadata/ContactDetails/ConversationsForContact.tsx +++ b/frontend/inbox/src/components/ContactDetails/ConversationsForContact.tsx @@ -1,6 +1,6 @@ import React, {useEffect, useState} from 'react'; import {Link} from 'react-router-dom'; -import {INBOX_CONVERSATIONS_ROUTE} from '../../../../../routes/routes'; +import {INBOX_CONVERSATIONS_ROUTE} from '../../routes/routes'; import {Source} from 'model'; import {ConnectorAvatar} from 'components'; import {useTranslation} from 'react-i18next'; diff --git a/frontend/inbox/src/pages/Inbox/Messenger/ConversationMetadata/ContactDetails/Expandable.tsx b/frontend/inbox/src/components/ContactDetails/Expandable.tsx similarity index 100% rename from frontend/inbox/src/pages/Inbox/Messenger/ConversationMetadata/ContactDetails/Expandable.tsx rename to frontend/inbox/src/components/ContactDetails/Expandable.tsx diff --git a/frontend/inbox/src/pages/Inbox/Messenger/ConversationMetadata/ContactDetails/index.module.scss b/frontend/inbox/src/components/ContactDetails/index.module.scss similarity index 100% rename from frontend/inbox/src/pages/Inbox/Messenger/ConversationMetadata/ContactDetails/index.module.scss rename to frontend/inbox/src/components/ContactDetails/index.module.scss diff --git a/frontend/inbox/src/pages/Inbox/Messenger/ConversationMetadata/ContactDetails/index.tsx b/frontend/inbox/src/components/ContactDetails/index.tsx similarity index 98% rename from frontend/inbox/src/pages/Inbox/Messenger/ConversationMetadata/ContactDetails/index.tsx rename to frontend/inbox/src/components/ContactDetails/index.tsx index 25276e1b4a..4cc407cdf1 100644 --- a/frontend/inbox/src/pages/Inbox/Messenger/ConversationMetadata/ContactDetails/index.tsx +++ b/frontend/inbox/src/components/ContactDetails/index.tsx @@ -1,7 +1,7 @@ import React, {useState, useEffect, SetStateAction} from 'react'; import _, {connect, ConnectedProps} from 'react-redux'; -import {getContactDetails, updateContactDetails} from '../../../../../actions'; -import {StateModel} from '../../../../../reducers'; +import {getContactDetails, updateContactDetails} from '../../actions'; +import {StateModel} from '../../reducers'; import {getInfoDetailsPayload, fillContactInfo} from './util'; import {UpdateContactDetailsRequestPayload} from 'httpclient/src'; import {Contact} from 'model'; diff --git a/frontend/inbox/src/pages/Inbox/Messenger/ConversationMetadata/ContactDetails/util/fillContactInfo.ts b/frontend/inbox/src/components/ContactDetails/util/fillContactInfo.ts similarity index 100% rename from frontend/inbox/src/pages/Inbox/Messenger/ConversationMetadata/ContactDetails/util/fillContactInfo.ts rename to frontend/inbox/src/components/ContactDetails/util/fillContactInfo.ts diff --git a/frontend/inbox/src/pages/Inbox/Messenger/ConversationMetadata/ContactDetails/util/getInfoDetailPayload.ts b/frontend/inbox/src/components/ContactDetails/util/getInfoDetailPayload.ts similarity index 100% rename from frontend/inbox/src/pages/Inbox/Messenger/ConversationMetadata/ContactDetails/util/getInfoDetailPayload.ts rename to frontend/inbox/src/components/ContactDetails/util/getInfoDetailPayload.ts diff --git a/frontend/inbox/src/pages/Inbox/Messenger/ConversationMetadata/ContactDetails/util/index.ts b/frontend/inbox/src/components/ContactDetails/util/index.ts similarity index 100% rename from frontend/inbox/src/pages/Inbox/Messenger/ConversationMetadata/ContactDetails/util/index.ts rename to frontend/inbox/src/components/ContactDetails/util/index.ts diff --git a/frontend/inbox/src/pages/Inbox/Messenger/ConversationMetadata/ContactDetails/util/infoPointUtil.ts b/frontend/inbox/src/components/ContactDetails/util/infoPointUtil.ts similarity index 100% rename from frontend/inbox/src/pages/Inbox/Messenger/ConversationMetadata/ContactDetails/util/infoPointUtil.ts rename to frontend/inbox/src/components/ContactDetails/util/infoPointUtil.ts diff --git a/frontend/inbox/src/pages/Contacts/ContactInformation/index.module.scss b/frontend/inbox/src/pages/Contacts/ContactInformation/index.module.scss index eb1b32662b..7a2aa603c5 100644 --- a/frontend/inbox/src/pages/Contacts/ContactInformation/index.module.scss +++ b/frontend/inbox/src/pages/Contacts/ContactInformation/index.module.scss @@ -199,3 +199,21 @@ fill: var(--color-text-gray); } } + +.contactsDetailsCollapseIcon { + position: absolute; + left: 20px; + top: 20px; + width: 20px; + background: transparent; + border: none; + cursor: pointer; + transition: opacity 0.3s; + svg { + fill: var(--color-airy-blue); + } +} + +.contactsDetailsCollapseIcon:hover { + opacity: 0.5; +} diff --git a/frontend/inbox/src/pages/Contacts/ContactInformation/index.tsx b/frontend/inbox/src/pages/Contacts/ContactInformation/index.tsx index df8b31ac5f..c1034e4d06 100644 --- a/frontend/inbox/src/pages/Contacts/ContactInformation/index.tsx +++ b/frontend/inbox/src/pages/Contacts/ContactInformation/index.tsx @@ -3,7 +3,7 @@ import React, {useEffect, useState} from 'react'; import {useTranslation} from 'react-i18next'; import {connect, ConnectedProps} from 'react-redux'; import styles from './index.module.scss'; -import ContactDetails from '../../Inbox/Messenger/ConversationMetadata/ContactDetails'; +import ContactDetails from '../../../components/ContactDetails'; import {useAnimation} from 'render'; import {Contact} from 'model'; import {Avatar} from 'components/message/Avatar'; @@ -13,6 +13,7 @@ import {ReactComponent as CloseIcon} from 'assets/images/icons/close.svg'; import {ReactComponent as CheckmarkCircleIcon} from 'assets/images/icons/checkmark.svg'; import {ReactComponent as EditIcon} from 'assets/images/icons/pen.svg'; import {ReactComponent as CancelIcon} from 'assets/images/icons/cancelCross.svg'; +import {ReactComponent as CollapseRightArrowsIcon} from 'assets/images/icons/collapseRightArrows.svg'; import {StateModel} from '../../../reducers'; import { cyCancelEditContactIcon, @@ -40,6 +41,8 @@ type ContactInformationProps = { editModeOn: boolean; cancelEdit: boolean; setEditModeOn: (editing: boolean) => void; + setContactInformationVisible: React.Dispatch>; + contactInformationVisible: boolean; } & ConnectedProps; const ContactInformation = (props: ContactInformationProps) => { @@ -52,6 +55,8 @@ const ContactInformation = (props: ContactInformationProps) => { editModeOn, cancelEdit, setEditModeOn, + setContactInformationVisible, + contactInformationVisible, } = props; const {t} = useTranslation(); const [showEditDisplayName, setShowEditDisplayName] = useState(false); @@ -119,8 +124,14 @@ const ContactInformation = (props: ContactInformationProps) => { return ( <> - {(contact || conversationId) && ( + {(contact || conversationId) && contactInformationVisible && (
+ {!isEditing ? (