mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-03-26 17:52:18 +01:00
small fix for dm message timestamp
This commit is contained in:
parent
4167406d42
commit
193b7b6a17
@ -16,8 +16,8 @@ import ProfileView from "./views/profile";
|
||||
import HashTagView from "./views/hashtag";
|
||||
import ThreadView from "./views/note";
|
||||
import NotificationsView from "./views/notifications";
|
||||
import DirectMessagesView from "./views/messages";
|
||||
import DirectMessageChatView from "./views/messages/chat";
|
||||
import DirectMessagesView from "./views/dms";
|
||||
import DirectMessageChatView from "./views/dms/chat";
|
||||
|
||||
import SigninView from "./views/signin";
|
||||
import SignupView from "./views/signup";
|
||||
|
@ -15,7 +15,7 @@ import { RelayMode } from "../../classes/relay";
|
||||
import { useTimelineCurserIntersectionCallback } from "../../hooks/use-timeline-cursor-intersection-callback";
|
||||
import IntersectionObserverProvider from "../../providers/intersection-observer";
|
||||
import useSubject from "../../hooks/use-subject";
|
||||
import Message from "../../views/messages/message";
|
||||
import Message from "../../views/dms/message";
|
||||
import { LightboxProvider } from "../lightbox-provider";
|
||||
import { useSigningContext } from "../../providers/signing-provider";
|
||||
import { DraftNostrEvent } from "../../types/nostr-event";
|
||||
|
@ -5,8 +5,8 @@ import { TrustProvider } from "../../../providers/trust";
|
||||
import UserAvatarLink from "../../user-avatar-link";
|
||||
import UserLink from "../../user-link";
|
||||
import Timestamp from "../../timestamp";
|
||||
import DecryptPlaceholder from "../../../views/messages/decrypt-placeholder";
|
||||
import { MessageContent } from "../../../views/messages/message";
|
||||
import DecryptPlaceholder from "../../../views/dms/decrypt-placeholder";
|
||||
import { MessageContent } from "../../../views/dms/message";
|
||||
import { getMessageRecipient } from "../../../services/direct-messages";
|
||||
import useCurrentAccount from "../../../hooks/use-current-account";
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { useRef } from "react";
|
||||
import { Box, ButtonGroup, Card, CardBody, CardFooter, CardHeader, CardProps, Flex } from "@chakra-ui/react";
|
||||
import { Box, BoxProps, ButtonGroup, Card, CardBody, CardFooter, CardHeader, CardProps, Flex } from "@chakra-ui/react";
|
||||
|
||||
import useCurrentAccount from "../../hooks/use-current-account";
|
||||
import { getMessageRecipient } from "../../services/direct-messages";
|
||||
@ -25,7 +25,7 @@ import useEventReactions from "../../hooks/use-event-reactions";
|
||||
import AddReactionButton from "../../components/note/components/add-reaction-button";
|
||||
import { TrustProvider } from "../../providers/trust";
|
||||
|
||||
export function MessageContent({ event, text }: { event: NostrEvent; text: string }) {
|
||||
export function MessageContent({ event, text, children, ...props }: { event: NostrEvent; text: string } & BoxProps) {
|
||||
let content: EmbedableContent = [text];
|
||||
|
||||
content = embedNostrLinks(content);
|
||||
@ -36,8 +36,9 @@ export function MessageContent({ event, text }: { event: NostrEvent; text: strin
|
||||
|
||||
return (
|
||||
<TrustProvider event={event}>
|
||||
<Box whiteSpace="pre-wrap" display="inline">
|
||||
<Box whiteSpace="pre-wrap" {...props}>
|
||||
{content}
|
||||
{children}
|
||||
</Box>
|
||||
</TrustProvider>
|
||||
);
|
||||
@ -72,9 +73,12 @@ export default function Message({ event }: { event: NostrEvent } & Omit<CardProp
|
||||
variant="link"
|
||||
py="4"
|
||||
>
|
||||
{(text) => <MessageContent event={event} text={text} />}
|
||||
{(text) => (
|
||||
<MessageContent event={event} text={text} display="inline">
|
||||
{reactions.length === 0 && <Timestamp float="right" timestamp={event.created_at} />}
|
||||
</MessageContent>
|
||||
)}
|
||||
</DecryptPlaceholder>
|
||||
{reactions.length === 0 && <Timestamp float="right" timestamp={event.created_at} />}
|
||||
</CardBody>
|
||||
{reactions.length > 0 && (
|
||||
<CardFooter alignItems="center" display="flex" gap="2" px="2" pt="0" pb="2">
|
Loading…
x
Reference in New Issue
Block a user