From 8742f99c4753873fdd64a48d46bf74af4ba708d1 Mon Sep 17 00:00:00 2001 From: Piyush Bhatt <2023kuec2027@iiitkota.ac.in> Date: Sun, 12 Jan 2025 15:16:14 +0530 Subject: [PATCH 01/12] addTime --- .../views/AttachmentHandler/TextAttachment.js | 34 +++++++++++++++++-- packages/react/src/views/Message/Message.js | 17 +++++++--- 2 files changed, 44 insertions(+), 7 deletions(-) diff --git a/packages/react/src/views/AttachmentHandler/TextAttachment.js b/packages/react/src/views/AttachmentHandler/TextAttachment.js index b8477cd8bb..43fb29edb6 100644 --- a/packages/react/src/views/AttachmentHandler/TextAttachment.js +++ b/packages/react/src/views/AttachmentHandler/TextAttachment.js @@ -4,6 +4,8 @@ import PropTypes from 'prop-types'; import { Box, Avatar, useTheme } from '@embeddedchat/ui-elements'; import RCContext from '../../context/RCInstance'; import { Markdown } from '../Markdown'; +import { format } from 'date-fns'; +import { useMemo } from 'react'; const TextAttachment = ({ attachment, type, variantStyles = {} }) => { const { RCInstance } = useContext(RCContext); @@ -15,6 +17,17 @@ const TextAttachment = ({ attachment, type, variantStyles = {} }) => { const { theme } = useTheme(); + const formattedTimestamp = useMemo(() => { + let timestamp; + if (typeof attachment.ts === 'object') { + timestamp = attachment.ts.$date; + } else if (typeof attachment.ts === 'string') { + timestamp = new Date(attachment.ts).getTime(); + } + const formattedTime = format(new Date(timestamp), 'h:mm a'); + return formattedTime; + }, [attachment.ts]); + return ( { alt="avatar" size="1.2em" /> - @{attachment?.author_name} + {attachment?.author_name} + + {formattedTimestamp} + )} @@ -124,7 +154,7 @@ const TextAttachment = ({ attachment, type, variantStyles = {} }) => { alt="avatar" size="1.2em" /> - @{nestedAttachment?.author_name} + {nestedAttachment?.author_name} )} diff --git a/packages/react/src/views/Message/Message.js b/packages/react/src/views/Message/Message.js index fa8c864fec..e95c87debb 100644 --- a/packages/react/src/views/Message/Message.js +++ b/packages/react/src/views/Message/Message.js @@ -10,6 +10,7 @@ import { lighten, darken, } from '@embeddedchat/ui-elements'; +import { css } from '@emotion/react'; import { Attachments } from '../AttachmentHandler'; import { Markdown } from '../Markdown'; import MessageHeader from './MessageHeader'; @@ -255,16 +256,22 @@ const Message = ({ > {message.attachments && message.attachments.length > 0 ? ( <> - +
+ +
) : ( From cfad77ba8dacedf85765d2639b0f79b08f90e520 Mon Sep 17 00:00:00 2001 From: Piyush Bhatt <2023kuec2027@iiitkota.ac.in> Date: Sun, 12 Jan 2025 23:17:34 +0530 Subject: [PATCH 02/12] add_css --- .../views/AttachmentHandler/TextAttachment.js | 20 +++++++++++++++++-- .../src/views/QuoteMessage/QuoteMessage.js | 19 +++++++++++++++++- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/packages/react/src/views/AttachmentHandler/TextAttachment.js b/packages/react/src/views/AttachmentHandler/TextAttachment.js index 43fb29edb6..cb9c6b678a 100644 --- a/packages/react/src/views/AttachmentHandler/TextAttachment.js +++ b/packages/react/src/views/AttachmentHandler/TextAttachment.js @@ -1,11 +1,10 @@ -import React, { useContext } from 'react'; +import React, { useContext, useMemo } from 'react'; import { css } from '@emotion/react'; import PropTypes from 'prop-types'; import { Box, Avatar, useTheme } from '@embeddedchat/ui-elements'; import RCContext from '../../context/RCInstance'; import { Markdown } from '../Markdown'; import { format } from 'date-fns'; -import { useMemo } from 'react'; const TextAttachment = ({ attachment, type, variantStyles = {} }) => { const { RCInstance } = useContext(RCContext); @@ -155,6 +154,23 @@ const TextAttachment = ({ attachment, type, variantStyles = {} }) => { size="1.2em" /> {nestedAttachment?.author_name} + + {formattedTimestamp} + )} diff --git a/packages/react/src/views/QuoteMessage/QuoteMessage.js b/packages/react/src/views/QuoteMessage/QuoteMessage.js index 7fd9634e04..8f0d807131 100644 --- a/packages/react/src/views/QuoteMessage/QuoteMessage.js +++ b/packages/react/src/views/QuoteMessage/QuoteMessage.js @@ -13,6 +13,7 @@ import { useMessageStore } from '../../store'; import getQuoteMessageStyles from './QuoteMessage.styles'; import Attachment from '../AttachmentHandler/Attachment'; import { Markdown } from '../Markdown'; +import { css } from '@emotion/react'; const QuoteMessage = ({ className = '', style = {}, message }) => { const { RCInstance } = useContext(RCContext); @@ -51,7 +52,23 @@ const QuoteMessage = ({ className = '', style = {}, message }) => { size="1.5em" /> {message?.u.username} - {format(new Date(message.ts), 'h:mm a')} + + {format(new Date(message.ts), 'h:mm a')} + {message.file ? ( From 54ffc08038d8ebf885560c3b28817b115b4b53db Mon Sep 17 00:00:00 2001 From: Piyush Bhatt <2023kuec2027@iiitkota.ac.in> Date: Sun, 12 Jan 2025 23:32:19 +0530 Subject: [PATCH 03/12] fix --- packages/react/src/views/AttachmentHandler/TextAttachment.js | 2 +- packages/react/src/views/QuoteMessage/QuoteMessage.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react/src/views/AttachmentHandler/TextAttachment.js b/packages/react/src/views/AttachmentHandler/TextAttachment.js index cb9c6b678a..105afba2ec 100644 --- a/packages/react/src/views/AttachmentHandler/TextAttachment.js +++ b/packages/react/src/views/AttachmentHandler/TextAttachment.js @@ -2,9 +2,9 @@ import React, { useContext, useMemo } from 'react'; import { css } from '@emotion/react'; import PropTypes from 'prop-types'; import { Box, Avatar, useTheme } from '@embeddedchat/ui-elements'; +import { format } from 'date-fns'; import RCContext from '../../context/RCInstance'; import { Markdown } from '../Markdown'; -import { format } from 'date-fns'; const TextAttachment = ({ attachment, type, variantStyles = {} }) => { const { RCInstance } = useContext(RCContext); diff --git a/packages/react/src/views/QuoteMessage/QuoteMessage.js b/packages/react/src/views/QuoteMessage/QuoteMessage.js index 8f0d807131..096e4788e7 100644 --- a/packages/react/src/views/QuoteMessage/QuoteMessage.js +++ b/packages/react/src/views/QuoteMessage/QuoteMessage.js @@ -8,12 +8,12 @@ import { useComponentOverrides, useTheme, } from '@embeddedchat/ui-elements'; +import { css } from '@emotion/react'; import RCContext from '../../context/RCInstance'; import { useMessageStore } from '../../store'; import getQuoteMessageStyles from './QuoteMessage.styles'; import Attachment from '../AttachmentHandler/Attachment'; import { Markdown } from '../Markdown'; -import { css } from '@emotion/react'; const QuoteMessage = ({ className = '', style = {}, message }) => { const { RCInstance } = useContext(RCContext); From 987a6eaa05b226f8e2e2017f2bea6bc01a096213 Mon Sep 17 00:00:00 2001 From: Piyush Bhatt <2023kuec2027@iiitkota.ac.in> Date: Sat, 18 Jan 2025 19:20:18 +0530 Subject: [PATCH 04/12] also fix for nestedAttachment --- .../views/AttachmentHandler/TextAttachment.js | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/react/src/views/AttachmentHandler/TextAttachment.js b/packages/react/src/views/AttachmentHandler/TextAttachment.js index 105afba2ec..89ffec96f2 100644 --- a/packages/react/src/views/AttachmentHandler/TextAttachment.js +++ b/packages/react/src/views/AttachmentHandler/TextAttachment.js @@ -92,19 +92,6 @@ const TextAttachment = ({ attachment, type, variantStyles = {} }) => { white-space: pre-line; `} > - {attachment?.text ? ( - attachment.text[0] === '[' ? ( - attachment.text.match(/\n(.*)/)?.[1] || '' - ) : ( - - ) - ) : ( - '' - )} {attachment?.attachments && attachment.attachments.map((nestedAttachment, index) => ( { font-weight: 400; word-break: break-word; border-inline-start: 3px solid ${theme.colors.border}; - margin-top: 0.75rem; + margin-top: 0rem; padding: 0.5rem; `, (nestedAttachment?.type ? variantStyles.pinnedContainer : '') || @@ -196,6 +183,19 @@ const TextAttachment = ({ attachment, type, variantStyles = {} }) => { ))} + {attachment?.text ? ( + attachment.text[0] === '[' ? ( + attachment.text.match(/\n(.*)/)?.[1] || '' + ) : ( + + ) + ) : ( + '' + )} ); From 5117cfe9126a0c1ce5832a34184d908932051008 Mon Sep 17 00:00:00 2001 From: Piyush Bhatt <2023kuec2027@iiitkota.ac.in> Date: Sat, 18 Jan 2025 19:20:53 +0530 Subject: [PATCH 05/12] format --- packages/react/src/views/AttachmentHandler/TextAttachment.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react/src/views/AttachmentHandler/TextAttachment.js b/packages/react/src/views/AttachmentHandler/TextAttachment.js index 89ffec96f2..c4fed200e2 100644 --- a/packages/react/src/views/AttachmentHandler/TextAttachment.js +++ b/packages/react/src/views/AttachmentHandler/TextAttachment.js @@ -183,7 +183,7 @@ const TextAttachment = ({ attachment, type, variantStyles = {} }) => { ))} - {attachment?.text ? ( + {attachment?.text ? ( attachment.text[0] === '[' ? ( attachment.text.match(/\n(.*)/)?.[1] || '' ) : ( From 3171821c69af6a4ecc742eaa3e886c97fa1eaa2f Mon Sep 17 00:00:00 2001 From: Piyush Bhatt <2023kuec2027@iiitkota.ac.in> Date: Mon, 27 Jan 2025 22:46:58 +0530 Subject: [PATCH 06/12] add @ back before authorName --- packages/react/src/views/AttachmentHandler/TextAttachment.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react/src/views/AttachmentHandler/TextAttachment.js b/packages/react/src/views/AttachmentHandler/TextAttachment.js index c4fed200e2..0f8b4eb9f8 100644 --- a/packages/react/src/views/AttachmentHandler/TextAttachment.js +++ b/packages/react/src/views/AttachmentHandler/TextAttachment.js @@ -65,7 +65,7 @@ const TextAttachment = ({ attachment, type, variantStyles = {} }) => { alt="avatar" size="1.2em" /> - {attachment?.author_name} + @{attachment?.author_name} { alt="avatar" size="1.2em" /> - {nestedAttachment?.author_name} + @{nestedAttachment?.author_name} Date: Thu, 6 Feb 2025 17:50:03 +0530 Subject: [PATCH 07/12] add weeks --- .../AttachmentHandler/AudioAttachment.js | 48 ++++++++++++++++++- .../views/AttachmentHandler/TextAttachment.js | 28 +++++++++-- 2 files changed, 70 insertions(+), 6 deletions(-) diff --git a/packages/react/src/views/AttachmentHandler/AudioAttachment.js b/packages/react/src/views/AttachmentHandler/AudioAttachment.js index 5caf16e760..5804e95ae9 100644 --- a/packages/react/src/views/AttachmentHandler/AudioAttachment.js +++ b/packages/react/src/views/AttachmentHandler/AudioAttachment.js @@ -1,7 +1,8 @@ -import React, { useState, useContext } from 'react'; +import React, { useState, useContext, useMemo } from 'react'; import PropTypes from 'prop-types'; import { css } from '@emotion/react'; import { Box, Avatar, useTheme } from '@embeddedchat/ui-elements'; +import { format, isToday, isThisWeek, isThisMonth, isThisYear } from 'date-fns'; import AttachmentMetadata from './AttachmentMetadata'; import RCContext from '../../context/RCInstance'; @@ -27,6 +28,33 @@ const AudioAttachment = ({ setIsExpanded((prevState) => !prevState); }; + const formattedTimestamp = useMemo(() => { + let timestamp; + let date; + + if (typeof attachment.ts === 'object') { + timestamp = attachment.ts.$date; + return format(new Date(timestamp), 'h:mm a'); + } + if (typeof attachment.ts === 'string') { + date = new Date(attachment.ts); + + if (isToday(date)) { + return format(date, 'h:mm a'); + } + if (isThisWeek(date, { weekStartsOn: 0 })) { + return format(date, 'EEEE, h:mm a'); + } + if (isThisMonth(date)) { + return format(date, 'dd/MM/yyyy'); + } + if (isThisYear(date)) { + return format(date, 'MMMM d, yyyy'); + } + return format(date, 'MMMM d, yyyy'); + } + }, [attachment.ts]); + return ( @{authorName} + + {formattedTimestamp} + ) : ( diff --git a/packages/react/src/views/AttachmentHandler/TextAttachment.js b/packages/react/src/views/AttachmentHandler/TextAttachment.js index 0f8b4eb9f8..02761a2bc6 100644 --- a/packages/react/src/views/AttachmentHandler/TextAttachment.js +++ b/packages/react/src/views/AttachmentHandler/TextAttachment.js @@ -2,7 +2,7 @@ import React, { useContext, useMemo } from 'react'; import { css } from '@emotion/react'; import PropTypes from 'prop-types'; import { Box, Avatar, useTheme } from '@embeddedchat/ui-elements'; -import { format } from 'date-fns'; +import { format, isToday, isThisWeek, isThisMonth, isThisYear } from 'date-fns'; import RCContext from '../../context/RCInstance'; import { Markdown } from '../Markdown'; @@ -18,13 +18,29 @@ const TextAttachment = ({ attachment, type, variantStyles = {} }) => { const formattedTimestamp = useMemo(() => { let timestamp; + let date; + if (typeof attachment.ts === 'object') { timestamp = attachment.ts.$date; - } else if (typeof attachment.ts === 'string') { - timestamp = new Date(attachment.ts).getTime(); + return format(new Date(timestamp), 'h:mm a'); + } + if (typeof attachment.ts === 'string') { + date = new Date(attachment.ts); + + if (isToday(date)) { + return format(date, 'h:mm a'); + } + if (isThisWeek(date, { weekStartsOn: 0 })) { + return format(date, 'EEEE, h:mm a'); + } + if (isThisMonth(date)) { + return format(date, 'dd/MM/yyyy'); + } + if (isThisYear(date)) { + return format(date, 'MMMM d, yyyy'); + } + return format(date, 'MMMM d, yyyy'); } - const formattedTime = format(new Date(timestamp), 'h:mm a'); - return formattedTime; }, [attachment.ts]); return ( @@ -79,6 +95,7 @@ const TextAttachment = ({ attachment, type, variantStyles = {} }) => { line-height: 1rem; flex-shrink: 0; margin-left: 0.25rem; + text-decoraction: underline; `} > {formattedTimestamp} @@ -154,6 +171,7 @@ const TextAttachment = ({ attachment, type, variantStyles = {} }) => { line-height: 1rem; flex-shrink: 0; margin-left: 0.25rem; + text-decoraction: underline; `} > {formattedTimestamp} From 79c39fa59a6b4beb8c8da476ca4dec97f4c39c2a Mon Sep 17 00:00:00 2001 From: Piyush Bhatt <2023kuec2027@iiitkota.ac.in> Date: Thu, 6 Feb 2025 19:13:29 +0530 Subject: [PATCH 08/12] fix --- .../AttachmentHandler/AudioAttachment.js | 46 ------------------- 1 file changed, 46 deletions(-) diff --git a/packages/react/src/views/AttachmentHandler/AudioAttachment.js b/packages/react/src/views/AttachmentHandler/AudioAttachment.js index 5804e95ae9..e9bd9bdcdd 100644 --- a/packages/react/src/views/AttachmentHandler/AudioAttachment.js +++ b/packages/react/src/views/AttachmentHandler/AudioAttachment.js @@ -2,7 +2,6 @@ import React, { useState, useContext, useMemo } from 'react'; import PropTypes from 'prop-types'; import { css } from '@emotion/react'; import { Box, Avatar, useTheme } from '@embeddedchat/ui-elements'; -import { format, isToday, isThisWeek, isThisMonth, isThisYear } from 'date-fns'; import AttachmentMetadata from './AttachmentMetadata'; import RCContext from '../../context/RCInstance'; @@ -28,33 +27,6 @@ const AudioAttachment = ({ setIsExpanded((prevState) => !prevState); }; - const formattedTimestamp = useMemo(() => { - let timestamp; - let date; - - if (typeof attachment.ts === 'object') { - timestamp = attachment.ts.$date; - return format(new Date(timestamp), 'h:mm a'); - } - if (typeof attachment.ts === 'string') { - date = new Date(attachment.ts); - - if (isToday(date)) { - return format(date, 'h:mm a'); - } - if (isThisWeek(date, { weekStartsOn: 0 })) { - return format(date, 'EEEE, h:mm a'); - } - if (isThisMonth(date)) { - return format(date, 'dd/MM/yyyy'); - } - if (isThisYear(date)) { - return format(date, 'MMMM d, yyyy'); - } - return format(date, 'MMMM d, yyyy'); - } - }, [attachment.ts]); - return ( @{authorName} - - {formattedTimestamp} - ) : ( From 9e31f2269251466c604d34e4be753170aa596c13 Mon Sep 17 00:00:00 2001 From: Piyush Bhatt <2023kuec2027@iiitkota.ac.in> Date: Thu, 6 Feb 2025 19:22:38 +0530 Subject: [PATCH 09/12] use switch-case --- .../AttachmentHandler/AudioAttachment.js | 2 +- .../views/AttachmentHandler/TextAttachment.js | 44 +++++++++++++------ 2 files changed, 32 insertions(+), 14 deletions(-) diff --git a/packages/react/src/views/AttachmentHandler/AudioAttachment.js b/packages/react/src/views/AttachmentHandler/AudioAttachment.js index e9bd9bdcdd..5caf16e760 100644 --- a/packages/react/src/views/AttachmentHandler/AudioAttachment.js +++ b/packages/react/src/views/AttachmentHandler/AudioAttachment.js @@ -1,4 +1,4 @@ -import React, { useState, useContext, useMemo } from 'react'; +import React, { useState, useContext } from 'react'; import PropTypes from 'prop-types'; import { css } from '@emotion/react'; import { Box, Avatar, useTheme } from '@embeddedchat/ui-elements'; diff --git a/packages/react/src/views/AttachmentHandler/TextAttachment.js b/packages/react/src/views/AttachmentHandler/TextAttachment.js index 02761a2bc6..1a105cb443 100644 --- a/packages/react/src/views/AttachmentHandler/TextAttachment.js +++ b/packages/react/src/views/AttachmentHandler/TextAttachment.js @@ -2,7 +2,7 @@ import React, { useContext, useMemo } from 'react'; import { css } from '@emotion/react'; import PropTypes from 'prop-types'; import { Box, Avatar, useTheme } from '@embeddedchat/ui-elements'; -import { format, isToday, isThisWeek, isThisMonth, isThisYear } from 'date-fns'; +import { format } from 'date-fns'; import RCContext from '../../context/RCInstance'; import { Markdown } from '../Markdown'; @@ -26,20 +26,38 @@ const TextAttachment = ({ attachment, type, variantStyles = {} }) => { } if (typeof attachment.ts === 'string') { date = new Date(attachment.ts); + const now = new Date(); - if (isToday(date)) { - return format(date, 'h:mm a'); - } - if (isThisWeek(date, { weekStartsOn: 0 })) { - return format(date, 'EEEE, h:mm a'); - } - if (isThisMonth(date)) { - return format(date, 'dd/MM/yyyy'); - } - if (isThisYear(date)) { - return format(date, 'MMMM d, yyyy'); + const isSameDay = + date.getDate() === now.getDate() && + date.getMonth() === now.getMonth() && + date.getFullYear() === now.getFullYear(); + + const isSameWeek = (() => { + const startOfWeek = new Date(now.setDate(now.getDate() - now.getDay())); + const endOfWeek = new Date(startOfWeek); + endOfWeek.setDate(endOfWeek.getDate() + 6); + return date >= startOfWeek && date <= endOfWeek; + })(); + + const isSameMonth = + date.getMonth() === now.getMonth() && + date.getFullYear() === now.getFullYear(); + + const isSameYear = date.getFullYear() === now.getFullYear(); + + switch (true) { + case isSameDay: + return format(date, 'h:mm a'); + case isSameWeek: + return format(date, 'EEEE, h:mm a'); + case isSameMonth: + return format(date, 'dd/MM/yyyy'); + case isSameYear: + return format(date, 'MMMM d, yyyy'); + default: + return format(date, 'MMMM d, yyyy'); } - return format(date, 'MMMM d, yyyy'); } }, [attachment.ts]); From 79539bb12c2572e55b9a3f608e8e11498efc35b1 Mon Sep 17 00:00:00 2001 From: Piyush Bhatt <2023kuec2027@iiitkota.ac.in> Date: Thu, 6 Feb 2025 20:40:03 +0530 Subject: [PATCH 10/12] responsive --- .../react/src/views/AttachmentHandler/TextAttachment.js | 7 ++++++- packages/react/src/views/QuoteMessage/QuoteMessage.js | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/react/src/views/AttachmentHandler/TextAttachment.js b/packages/react/src/views/AttachmentHandler/TextAttachment.js index 1a105cb443..cde81c0b24 100644 --- a/packages/react/src/views/AttachmentHandler/TextAttachment.js +++ b/packages/react/src/views/AttachmentHandler/TextAttachment.js @@ -113,7 +113,12 @@ const TextAttachment = ({ attachment, type, variantStyles = {} }) => { line-height: 1rem; flex-shrink: 0; margin-left: 0.25rem; - text-decoraction: underline; + text-decoration: underline; + + @media (max-width: 380px) { + font-size: 0.6rem; + display: block; + } `} > {formattedTimestamp} diff --git a/packages/react/src/views/QuoteMessage/QuoteMessage.js b/packages/react/src/views/QuoteMessage/QuoteMessage.js index 096e4788e7..1a1754c953 100644 --- a/packages/react/src/views/QuoteMessage/QuoteMessage.js +++ b/packages/react/src/views/QuoteMessage/QuoteMessage.js @@ -65,6 +65,12 @@ const QuoteMessage = ({ className = '', style = {}, message }) => { line-height: 1rem; flex-shrink: 0; margin-left: 0.25rem; + text-decoration: underline; + + @media (max-width: 380px) { + font-size: 0.6rem; + display: block; + } `} > {format(new Date(message.ts), 'h:mm a')} From ab82144931d65a0e787870a545af4e11ba6f3053 Mon Sep 17 00:00:00 2001 From: Piyush Bhatt <2023kuec2027@iiitkota.ac.in> Date: Thu, 6 Feb 2025 20:56:22 +0530 Subject: [PATCH 11/12] responsive --- .../views/AttachmentHandler/TextAttachment.js | 41 +++++++++++++------ .../src/views/QuoteMessage/QuoteMessage.js | 18 +++++--- 2 files changed, 41 insertions(+), 18 deletions(-) diff --git a/packages/react/src/views/AttachmentHandler/TextAttachment.js b/packages/react/src/views/AttachmentHandler/TextAttachment.js index cde81c0b24..f29bb8aa02 100644 --- a/packages/react/src/views/AttachmentHandler/TextAttachment.js +++ b/packages/react/src/views/AttachmentHandler/TextAttachment.js @@ -99,25 +99,31 @@ const TextAttachment = ({ attachment, type, variantStyles = {} }) => { alt="avatar" size="1.2em" /> - @{attachment?.author_name} + @{attachment?.author_name} + + @@ -180,21 +186,32 @@ const TextAttachment = ({ attachment, type, variantStyles = {} }) => { alt="avatar" size="1.2em" /> - @{nestedAttachment?.author_name} + @{nestedAttachment?.author_name} + + {formattedTimestamp} diff --git a/packages/react/src/views/QuoteMessage/QuoteMessage.js b/packages/react/src/views/QuoteMessage/QuoteMessage.js index 1a1754c953..223d7cc99a 100644 --- a/packages/react/src/views/QuoteMessage/QuoteMessage.js +++ b/packages/react/src/views/QuoteMessage/QuoteMessage.js @@ -51,25 +51,31 @@ const QuoteMessage = ({ className = '', style = {}, message }) => { alt="avatar" size="1.5em" /> - {message?.u.username} + {message?.u.username} + + From b9f5f758172351f33492b9badeb8511d673c3b40 Mon Sep 17 00:00:00 2001 From: Piyush Bhatt <2023kuec2027@iiitkota.ac.in> Date: Thu, 6 Feb 2025 21:13:58 +0530 Subject: [PATCH 12/12] responsive --- .../views/AttachmentHandler/TextAttachment.js | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/packages/react/src/views/AttachmentHandler/TextAttachment.js b/packages/react/src/views/AttachmentHandler/TextAttachment.js index f29bb8aa02..f19977ee3a 100644 --- a/packages/react/src/views/AttachmentHandler/TextAttachment.js +++ b/packages/react/src/views/AttachmentHandler/TextAttachment.js @@ -33,12 +33,9 @@ const TextAttachment = ({ attachment, type, variantStyles = {} }) => { date.getMonth() === now.getMonth() && date.getFullYear() === now.getFullYear(); - const isSameWeek = (() => { - const startOfWeek = new Date(now.setDate(now.getDate() - now.getDay())); - const endOfWeek = new Date(startOfWeek); - endOfWeek.setDate(endOfWeek.getDate() + 6); - return date >= startOfWeek && date <= endOfWeek; - })(); + const startOfWeek = new Date(now); + startOfWeek.setDate(now.getDate() - now.getDay()); + const isSameWeek = date >= startOfWeek; const isSameMonth = date.getMonth() === now.getMonth() && @@ -101,9 +98,14 @@ const TextAttachment = ({ attachment, type, variantStyles = {} }) => { /> @{attachment?.author_name} @@ -188,9 +190,14 @@ const TextAttachment = ({ attachment, type, variantStyles = {} }) => { /> @{nestedAttachment?.author_name}