Skip to content

Commit

Permalink
fix: restore error prop for markdown editor
Browse files Browse the repository at this point in the history
  • Loading branch information
drodil committed Nov 20, 2024
1 parent 4744122 commit e630318
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ const MarkdownEditorContainer = styled('div')(({ theme }) => ({
},
},
},
'& .error': {
borderColor: theme.palette.error.main,
},
},
}));

Expand All @@ -77,6 +80,7 @@ export type MarkdownEditorProps = {
value: string;
onChange: (value: string) => void;
height: number;
error?: boolean;
placeholder?: string;
onImageUpload?: (imageId: number) => void;
disableToolbar?: boolean;
Expand All @@ -99,6 +103,7 @@ export const MarkdownEditor = (props: MarkdownEditorProps) => {
disableAttachments,
disableToolbar,
disablePreview,
error,
postId,
answerId,
collectionId,
Expand Down Expand Up @@ -157,6 +162,7 @@ export const MarkdownEditor = (props: MarkdownEditorProps) => {
<ReactMde
disablePreview={disablePreview}
classes={{
reactMde: error ? 'error' : undefined,
toolbar: disableToolbar ? 'invisible' : undefined,
}}
value={value}
Expand Down

0 comments on commit e630318

Please sign in to comment.