Skip to content

Commit

Permalink
[TEMP]: Drop mxeditor for now (podkrepi-bg#1574)
Browse files Browse the repository at this point in the history
Until we figure out why its chunk is not found...
  • Loading branch information
sashko9807 authored Aug 30, 2023
1 parent 26188cd commit 523c866
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/components/common/form/FormRichTextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { translateError } from 'common/form/useForm'
import { TranslatableField } from 'common/form/validation'
import { styled } from '@mui/material/styles'

import { ModernEditor } from './MDXEditor'
// import { ModernEditor } from './MDXEditor'
import { QuillEditor } from './QuillEditor'

export type FormRichTextFieldProps = {
Expand All @@ -33,7 +33,7 @@ export default function FormRichTextField({ name }: FormRichTextFieldProps) {
const { t } = useTranslation()
const [, meta] = useField(name)
const helperText = meta.touched ? translateError(meta.error as TranslatableField, t) : ''
const [useMdxEditor, setUseMdxEditor] = React.useState(true)
const [useMdxEditor, setUseMdxEditor] = React.useState(false)

return (
<div>
Expand All @@ -46,7 +46,7 @@ export default function FormRichTextField({ name }: FormRichTextFieldProps) {
<Field name={name}>
{({ field }: { field: FieldInputProps<string> }) => (
<StyledGrid>
<EditorSwitch>
{/* <EditorSwitch>
<label>
<input
type="radio"
Expand All @@ -67,12 +67,10 @@ export default function FormRichTextField({ name }: FormRichTextFieldProps) {
/>{' '}
{t('campaigns:campaign.rte.classic')}
</label>
</EditorSwitch>
</EditorSwitch> */}

{useMdxEditor ? (
<>
<ModernEditor html={field.value} onChange={field.onChange(field.name)} />
</>
<>{/* <ModernEditor html={field.value} onChange={field.onChange(field.name)} /> */}</>
) : (
<QuillEditor value={field.value} onChange={field.onChange(field.name)} />
)}
Expand Down

0 comments on commit 523c866

Please sign in to comment.