Refactor MarkdownDisplay and MarkdownInput components for improved rendering and user experience. Adjust spacing in NoteItem for better layout consistency.
All checks were successful
farmcontrol/farmcontrol-ui/pipeline/head This commit looks good

This commit is contained in:
Tom Butcher 2026-03-09 01:29:59 +00:00
parent bfbec30a75
commit aa2e7b85ed
3 changed files with 4 additions and 3 deletions

View File

@ -41,7 +41,7 @@ const MarkdownDisplay = ({ content }) => {
ul: UlComponent, ul: UlComponent,
ol: OlComponent, ol: OlComponent,
li: LiComponent, li: LiComponent,
strong: (props) => <Text strong {...props} />, strong: (props) => <strong {...props} />,
em: (props) => <Text italic {...props} />, em: (props) => <Text italic {...props} />,
code: ({ inline, ...props }) => code: ({ inline, ...props }) =>
inline ? ( inline ? (
@ -55,7 +55,7 @@ const MarkdownDisplay = ({ content }) => {
} }
return ( return (
<div className="markdown markdown-display"> <div className='markdown markdown-display'>
<ReactMarkdown remarkPlugins={[remarkGfm]} components={components}> <ReactMarkdown remarkPlugins={[remarkGfm]} components={components}>
{content} {content}
</ReactMarkdown> </ReactMarkdown>

View File

@ -103,6 +103,7 @@ const MarkdownInput = ({
<CodeBlockEditor <CodeBlockEditor
code={markdownValue} code={markdownValue}
language='markdown' language='markdown'
showLineNumbers={false}
style={{ border: 'none' }} style={{ border: 'none' }}
onChange={(val) => { onChange={(val) => {
onChange?.(val) onChange?.(val)

View File

@ -168,7 +168,7 @@ const NoteItem = ({
<PersonIcon /> <PersonIcon />
<Text style={{ whiteSpace: 'nowrap' }}>{note.user.name}:</Text> <Text style={{ whiteSpace: 'nowrap' }}>{note.user.name}:</Text>
</Space> </Space>
<div style={{ marginBottom: '4px' }}> <div style={{ marginTop: '4px' }}>
<MarkdownDisplay content={note.content} /> <MarkdownDisplay content={note.content} />
</div> </div>
</Flex> </Flex>