-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bump nostr-tools
- Loading branch information
Showing
21 changed files
with
488 additions
and
267 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"nostrudel": minor | ||
--- | ||
|
||
Add unknown notifications toggle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"nostrudel": minor | ||
--- | ||
|
||
Add "q" tags for quoted notes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
src/views/notifications/components/mention-notification.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { ReactNode, forwardRef } from "react"; | ||
import { kinds, NostrEvent } from "nostr-tools"; | ||
|
||
import { EmbedEvent } from "../../../components/embed-event"; | ||
import { AtIcon } from "../../../components/icons"; | ||
import NotificationIconEntry from "./notification-icon-entry"; | ||
import { TimelineNote } from "../../../components/note/timeline-note"; | ||
import ArticleCard from "../../articles/components/article-card"; | ||
|
||
const MentionNotification = forwardRef<HTMLDivElement, { event: NostrEvent; onClick?: () => void }>( | ||
({ event, onClick }, ref) => { | ||
let content: ReactNode; | ||
switch (event.kind) { | ||
case kinds.LongFormArticle: | ||
content = <ArticleCard article={event} />; | ||
break; | ||
case kinds.ShortTextNote: | ||
content = <TimelineNote event={event} showReplyButton />; | ||
break; | ||
default: | ||
content = <EmbedEvent event={event} />; | ||
break; | ||
} | ||
|
||
return ( | ||
<NotificationIconEntry | ||
ref={ref} | ||
icon={<AtIcon boxSize={6} color="purple.400" />} | ||
id={event.id} | ||
pubkey={event.pubkey} | ||
timestamp={event.created_at} | ||
summary={event.content} | ||
onClick={onClick} | ||
> | ||
{content} | ||
</NotificationIconEntry> | ||
); | ||
}, | ||
); | ||
|
||
export default MentionNotification; |
29 changes: 29 additions & 0 deletions
29
src/views/notifications/components/message-notification.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { NostrEvent } from "nostr-tools"; | ||
import { forwardRef } from "react"; | ||
import { Text } from "@chakra-ui/react"; | ||
|
||
import NotificationIconEntry from "./notification-icon-entry"; | ||
import UserAvatar from "../../../components/user/user-avatar"; | ||
import UserName from "../../../components/user/user-name"; | ||
import { EmbedEvent } from "../../../components/embed-event"; | ||
import { DirectMessagesIcon } from "../../../components/icons"; | ||
|
||
const MessageNotification = forwardRef<HTMLDivElement, { event: NostrEvent; onClick?: () => void }>( | ||
({ event, onClick }, ref) => { | ||
return ( | ||
<NotificationIconEntry | ||
ref={ref} | ||
icon={<DirectMessagesIcon boxSize={6} color="gray.500" />} | ||
id={event.id} | ||
pubkey={event.pubkey} | ||
timestamp={event.created_at} | ||
summary={<>Direct Messaged</>} | ||
onClick={onClick} | ||
> | ||
<EmbedEvent event={event} /> | ||
</NotificationIconEntry> | ||
); | ||
}, | ||
); | ||
|
||
export default MessageNotification; |
Oops, something went wrong.