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

View File

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

View File

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