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