mirror of
https://github.com/spacebarchat/client.git
synced 2024-11-22 18:32:34 +01:00
edited mark
This commit is contained in:
parent
73ca4219a8
commit
89ff9ef83f
@ -142,6 +142,13 @@ function Message({ message, isHeader, isSending, isFailed }: Props) {
|
||||
</div>
|
||||
)}
|
||||
{parseMessageContent(message.content)}
|
||||
{"edited_timestamp" in message && message.edited_timestamp && (
|
||||
<MessageTimestamp date={message.edited_timestamp}>
|
||||
<span style={{ color: "var(--text-secondary)", fontSize: "12px", paddingLeft: "5px" }}>
|
||||
(edited)
|
||||
</span>
|
||||
</MessageTimestamp>
|
||||
)}
|
||||
{"attachments" in message
|
||||
? message.attachments.map((attachment, index) => (
|
||||
<Fragment key={index}>
|
||||
|
@ -11,10 +11,15 @@ const Container = styled.div`
|
||||
user-select: none;
|
||||
`;
|
||||
|
||||
function MessageTimestamp({ date }: { date: string | number | Date | dayjs.Dayjs }) {
|
||||
interface Props {
|
||||
date: string | number | Date | dayjs.Dayjs;
|
||||
children?: React.ReactElement;
|
||||
}
|
||||
|
||||
function MessageTimestamp({ date, children }: Props) {
|
||||
return (
|
||||
<Tooltip title={dayjs(date).format("dddd, MMMM MM, h:mm A")} placement="top">
|
||||
<Container>{dayjs(date).calendar(undefined, calendarStrings)}</Container>
|
||||
{children ? children : <Container>{dayjs(date).calendar(undefined, calendarStrings)}</Container>}
|
||||
</Tooltip>
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user