diff --git a/web/components/editor.tsx b/web/components/editor.tsx index 6af58caa..5f056f8b 100644 --- a/web/components/editor.tsx +++ b/web/components/editor.tsx @@ -236,9 +236,10 @@ const useUploadMutation = (editor: Editor | null) => export function RichContent(props: { content: JSONContent | string + className?: string smallImage?: boolean }) { - const { content, smallImage } = props + const { className, content, smallImage } = props const editor = useEditor({ editorProps: { attributes: { class: proseClass } }, extensions: [ @@ -254,19 +255,24 @@ export function RichContent(props: { }) useEffect(() => void editor?.commands?.setContent(content), [editor, content]) - return + return } // backwards compatibility: we used to store content as strings export function Content(props: { content: JSONContent | string + className?: string smallImage?: boolean }) { - const { content } = props + const { className, content } = props return typeof content === 'string' ? ( -
- -
+ ) : ( ) diff --git a/web/components/feed/contract-activity.tsx b/web/components/feed/contract-activity.tsx index 1be2b7a8..2c6a7cf8 100644 --- a/web/components/feed/contract-activity.tsx +++ b/web/components/feed/contract-activity.tsx @@ -137,7 +137,7 @@ export function FreeResponseContractCommentsActivity(props: { contract={contract} user={user} answer={answer} - answerComments={commentsByOutcome[answer.number.toString()]} + answerComments={commentsByOutcome[answer.number.toString()] ?? []} tips={tips} betsByUserId={betsByUserId} commentsByUserId={commentsByUserId} diff --git a/web/components/feed/feed-comments.tsx b/web/components/feed/feed-comments.tsx index 7ddcc3e6..1fdfa5cb 100644 --- a/web/components/feed/feed-comments.tsx +++ b/web/components/feed/feed-comments.tsx @@ -193,21 +193,19 @@ export function FeedComment(props: { /> )} - <> - {bought} {money} - {contract.outcomeType !== 'FREE_RESPONSE' && betOutcome && ( - <> - {' '} - of{' '} - - - )} - + {bought} {money} + {contract.outcomeType !== 'FREE_RESPONSE' && betOutcome && ( + <> + {' '} + of{' '} + + + )} -
- -
+ {onReplyClick && ( diff --git a/web/components/linkify.tsx b/web/components/linkify.tsx index b4f05165..a24ab0b6 100644 --- a/web/components/linkify.tsx +++ b/web/components/linkify.tsx @@ -1,10 +1,15 @@ +import clsx from 'clsx' import { Fragment } from 'react' import { SiteLink } from './site-link' // Return a JSX span, linkifying @username, #hashtags, and https://... // TODO: Use a markdown parser instead of rolling our own here. -export function Linkify(props: { text: string; gray?: boolean }) { - const { text, gray } = props +export function Linkify(props: { + text: string + className?: string + gray?: boolean +}) { + const { text, className, gray } = props // Replace "m1234" with "ϻ1234" // const mRegex = /(\W|^)m(\d+)/g // text = text.replace(mRegex, (_, pre, num) => `${pre}ϻ${num}`) @@ -38,7 +43,7 @@ export function Linkify(props: { text: string; gray?: boolean }) { ) }) return ( - + {text.split(regex).map((part, i) => ( {part}