Skip to content

Commit

Permalink
removed property for adding clear button or not since we want to add …
Browse files Browse the repository at this point in the history
…it to every TextEditor used
  • Loading branch information
JochemVH1 committed Jul 2, 2024
1 parent 89a2a9f commit bc8e729
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/controls/email/EmailForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const EmailForm = ({value, onChange, attachmentsAvailable, textEditorRepl
let getToolbarCustomButtons: (editorState: EditorState) => JSX.Element[] = () => [];
if (textEditorReplacements && textEditorReplacements.length) {
getToolbarCustomButtons = (editorState: EditorState) => (
[<TextEditorReplacements editorState={editorState} replacements={textEditorReplacements} addClearButton={true}/>]
[<TextEditorReplacements editorState={editorState} replacements={textEditorReplacements}/>]
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ import {ITextEditorCustomReplacement} from '../../../invoice/invoice-replacement
type TextEditorReplacementsProps = {
onChange?: (editorState: EditorState) => void,
editorState: EditorState,
replacements: ITextEditorCustomReplacement[],
addClearButton?: boolean
replacements: ITextEditorCustomReplacement[]
}



export const TextEditorReplacements = ({onChange, editorState, replacements, addClearButton}: TextEditorReplacementsProps) => {
export const TextEditorReplacements = ({onChange, editorState, replacements}: TextEditorReplacementsProps) => {
const [open, setOpen] = useState<boolean>(false);

const addPlaceholder = (placeholder: string): void => {
Expand Down Expand Up @@ -60,7 +59,7 @@ export const TextEditorReplacements = ({onChange, editorState, replacements, add
</ul>
</div>
</div>
{addClearButton ? <button type='button' className="rdw-option-wrapper" onClick={() => clearText()}> Clear</button> : null}
<button type='button' className="rdw-option-wrapper" onClick={() => clearText()}> Clear</button>
</div>
);
};

0 comments on commit bc8e729

Please sign in to comment.