11import React , { forwardRef } from 'react' ;
22import { Editor } from '@tinymce/tinymce-react' ;
3- import { FormControl , FormHelperText , InputLabel } from '@mui/material' ;
3+ import { FormControl , FormHelperText , InputLabel , useTheme } from '@mui/material' ;
44import makeStyles from '@mui/styles/makeStyles' ;
55
66import { useAfterInitialEffect , useConsolidatedRef , useUID } from '../../../hooks' ;
7- import { theme } from '../../../theme' ;
87
9- const useStyles = makeStyles ( ( ) => ( {
8+ const useStyles = makeStyles ( theme => ( {
109 fieldLabel : {
1110 position : 'relative' ,
1211 transform : 'translate(0, 0px) scale(1)' ,
@@ -32,6 +31,7 @@ interface RichTextEditorProps {
3231}
3332
3433const RichTextEditor = forwardRef ( function RichTextEditor ( props : RichTextEditorProps , ref ) {
34+ const theme = useTheme ( ) ;
3535 const classes = useStyles ( ) ;
3636 const uid = useUID ( ) ;
3737 const { id = uid , defaultValue, label, labelHidden, info, testId, placeholder, disabled, required, readOnly, error, onBlur, onChange } = props ;
@@ -91,27 +91,27 @@ const RichTextEditor = forwardRef(function RichTextEditor(props: RichTextEditorP
9191 skin : 'oxide-dark' , // or 'oxide' for light theme
9292 // ...other TinyMCE config...
9393 content_style : `
94- body {
95- font-family: ${ theme . typography . fontFamily } ;
96- font-size: ${ theme . typography . fontSize } px;
97- color: ${ theme . palette . text . primary } ;
98- background: ${ theme . palette . background . paper } ;
99- }
100- a { color: ${ theme . palette . primary . main } ; }
101- h1, h2, h3, h4, h5, h6 { color: ${ theme . palette . text . primary } ; font-family: ${ theme . typography . fontFamily } ; }
102- blockquote { color: ${ theme . palette . text . secondary } ; border-left: 4px solid ${ theme . palette . primary . light } ; padding-left: 8px; }
103- ul, ol { color: ${ theme . palette . text . primary } ; }
104- input, textarea, select {
105- background: ${ theme . palette . background . paper } ;
106- color: ${ theme . palette . text . primary } ;
107- border: 1px solid ${ theme . palette . divider } ;
108- border-radius: 4px;
109- padding: 6px 10px;
110- font-size: 1em;
111- font-family: inherit;
112- }
113- /* Add more styles as needed */
114- ` ,
94+ body {
95+ font-family: ${ theme . typography . fontFamily } ;
96+ font-size: ${ theme . typography . fontSize } px;
97+ color: ${ theme . palette . text . primary } ;
98+ background: ${ theme . palette . background . paper } ;
99+ }
100+ a { color: ${ theme . palette . primary . main } ; }
101+ h1, h2, h3, h4, h5, h6 { color: ${ theme . palette . text . primary } ; font-family: ${ theme . typography . fontFamily } ; }
102+ blockquote { color: ${ theme . palette . text . secondary } ; border-left: 4px solid ${ theme . palette . primary . light } ; padding-left: 8px; }
103+ ul, ol { color: ${ theme . palette . text . primary } ; }
104+ input, textarea, select {
105+ background: ${ theme . palette . background . paper } ;
106+ color: ${ theme . palette . text . primary } ;
107+ border: 1px solid ${ theme . palette . divider } ;
108+ border-radius: 4px;
109+ padding: 6px 10px;
110+ font-size: 1em;
111+ font-family: inherit;
112+ }
113+ /* Add more styles as needed */
114+ ` ,
115115 placeholder,
116116 menubar : false ,
117117 statusbar : false ,
0 commit comments