File tree 2 files changed +19
-2
lines changed
site/src/modules/notifications/NotificationsInbox
2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,16 @@ export const LongText: Story = {
48
48
} ,
49
49
} ;
50
50
51
+ export const Markdown : Story = {
52
+ args : {
53
+ notification : {
54
+ ...MockNotification ,
55
+ read_at : null ,
56
+ content : "Hello **world**!" ,
57
+ } ,
58
+ } ,
59
+ } ;
60
+
51
61
export const UnreadFocus : Story = {
52
62
args : {
53
63
notification : {
Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ import { SquareCheckBig } from "lucide-react";
5
5
import type { FC } from "react" ;
6
6
import { Link as RouterLink } from "react-router-dom" ;
7
7
import { relativeTime } from "utils/time" ;
8
+ import Markdown from "react-markdown" ;
9
+ import { cn } from "utils/cn" ;
8
10
9
11
type InboxItemProps = {
10
12
notification : InboxNotification ;
@@ -26,8 +28,13 @@ export const InboxItem: FC<InboxItemProps> = ({
26
28
</ div >
27
29
28
30
< div className = "flex flex-col gap-3 flex-1" >
29
- < span className = "text-content-secondary text-sm font-medium whitespace-break-spaces [overflow-wrap:anywhere]" >
30
- { notification . content }
31
+ < span
32
+ className = { cn ( [
33
+ "text-content-secondary text-sm font-medium whitespace-break-spaces [overflow-wrap:anywhere]" ,
34
+ "[&_p]:m-0" ,
35
+ ] ) }
36
+ >
37
+ < Markdown > { notification . content } </ Markdown >
31
38
</ span >
32
39
< div className = "flex items-center gap-1" >
33
40
{ notification . actions . map ( ( action ) => {
You can’t perform that action at this time.
0 commit comments