From 55337ebd4d3587da4823da2205f1b98e0808c2b4 Mon Sep 17 00:00:00 2001 From: William Grant Date: Fri, 20 Oct 2023 11:32:08 +1100 Subject: [PATCH] feat: improved dotmenu --- stylesheets/_modules.scss | 59 ------------------- .../header/ConversationHeaderSubtitle.tsx | 33 +++++------ .../components/AttachmentCarousel.tsx | 2 +- ts/state/ducks/conversations.ts | 1 - 4 files changed, 17 insertions(+), 78 deletions(-) diff --git a/stylesheets/_modules.scss b/stylesheets/_modules.scss index 23be75a35..a640b19de 100644 --- a/stylesheets/_modules.scss +++ b/stylesheets/_modules.scss @@ -365,65 +365,6 @@ } } -// Module: Message Detail - -.module-message-detail { - max-width: 650px; - margin-inline-start: auto; - margin-inline-end: auto; - padding: 20px; -} - -.module-message-detail__message-container { - padding-top: 20px; - padding-bottom: 20px; - - &:after { - content: '.'; - visibility: hidden; - display: block; - height: 0; - clear: both; - } -} - -.module-message-detail__label { - font-weight: 300; - padding-inline-end: 5px; -} - -.module-message-detail__delete-button-container { - text-align: center; - margin-top: 10px; - - .session-button { - width: 160px; - margin: 1rem auto; - } -} - -.module-message-detail__contact-container { - margin: 20px 0 20px 0; -} - -.module-message-detail__contact { - margin-bottom: 8px; - display: flex; - flex-direction: row; - align-items: center; -} - -.module-message-detail__contact__text { - margin-inline-start: 10px; - flex-grow: 1; - min-width: 0; -} - -.module-message-detail__contact__error { - color: var(--danger-color); - font-weight: 300; -} - // Module: Media Gallery .module-media-gallery { diff --git a/ts/components/conversation/header/ConversationHeaderSubtitle.tsx b/ts/components/conversation/header/ConversationHeaderSubtitle.tsx index 6552eafc8..90d632be7 100644 --- a/ts/components/conversation/header/ConversationHeaderSubtitle.tsx +++ b/ts/components/conversation/header/ConversationHeaderSubtitle.tsx @@ -41,28 +41,26 @@ const StyledSubtitleDot = styled.span<{ active: boolean }>` export const SubtitleDotMenu = ({ id, - options, selectedOptionIndex, + optionsCount, style, }: { - id?: string; - options: Array; + id: string; selectedOptionIndex: number; + optionsCount: number; style: CSSProperties; }) => ( - - {options.map((option, index) => { - if (!option) { - return null; - } - - return ( - - ); - })} + + {Array(optionsCount) + .fill(0) + .map((_, index) => { + return ( + + ); + })} ); @@ -158,8 +156,9 @@ export const ConversationHeaderSubtitle = (props: ConversationHeaderSubtitleProp /> diff --git a/ts/components/conversation/right-panel/overlay/message-info/components/AttachmentCarousel.tsx b/ts/components/conversation/right-panel/overlay/message-info/components/AttachmentCarousel.tsx index 49a50c491..7b644bc4d 100644 --- a/ts/components/conversation/right-panel/overlay/message-info/components/AttachmentCarousel.tsx +++ b/ts/components/conversation/right-panel/overlay/message-info/components/AttachmentCarousel.tsx @@ -113,7 +113,7 @@ export const AttachmentCarousel = (props: Props) => { ; sender: string; - contacts: Array; convoId: string; messageId: string; direction: MessageModelType;