Kaynağa Gözat

change onClick handler name

soumaeda 2 yıl önce
ebeveyn
işleme
4c6294a730

+ 5 - 5
packages/editor/src/components/CodeMirrorEditor/Toolbar/TextFormatTools.tsx

@@ -45,7 +45,7 @@ export const TextFormatTools = (props: TextFormatToolsType): JSX.Element => {
     setOpen(bool => !bool);
     setOpen(bool => !bool);
   }, []);
   }, []);
 
 
-  const onClickCreateReplaceSelection = (prefix: string, suffix: string) => codeMirrorEditor?.insertMarkdownElements(prefix, suffix);
+  const onClickInsertMarkdownElements = (prefix: string, suffix: string) => codeMirrorEditor?.insertMarkdownElements(prefix, suffix);
 
 
   return (
   return (
     <div className="d-flex">
     <div className="d-flex">
@@ -53,19 +53,19 @@ export const TextFormatTools = (props: TextFormatToolsType): JSX.Element => {
 
 
       <Collapse isOpen={isOpen} horizontal>
       <Collapse isOpen={isOpen} horizontal>
         <div className="d-flex px-1 gap-1" style={{ width: '220px' }}>
         <div className="d-flex px-1 gap-1" style={{ width: '220px' }}>
-          <button type="button" className="btn btn-toolbar-button" onClick={() => onClickCreateReplaceSelection('**', '**')}>
+          <button type="button" className="btn btn-toolbar-button" onClick={() => onClickInsertMarkdownElements('**', '**')}>
             <span className="material-symbols-outlined fs-5">format_bold</span>
             <span className="material-symbols-outlined fs-5">format_bold</span>
           </button>
           </button>
           <button type="button" className="btn btn-toolbar-button">
           <button type="button" className="btn btn-toolbar-button">
-            <span className="material-symbols-outlined fs-5" onClick={() => onClickCreateReplaceSelection('*', '*')}>format_italic</span>
+            <span className="material-symbols-outlined fs-5" onClick={() => onClickInsertMarkdownElements('*', '*')}>format_italic</span>
           </button>
           </button>
-          <button type="button" className="btn btn-toolbar-button" onClick={() => onClickCreateReplaceSelection('~', '~')}>
+          <button type="button" className="btn btn-toolbar-button" onClick={() => onClickInsertMarkdownElements('~', '~')}>
             <span className="material-symbols-outlined fs-5">format_strikethrough</span>
             <span className="material-symbols-outlined fs-5">format_strikethrough</span>
           </button>
           </button>
           <button type="button" className="btn btn-toolbar-button">
           <button type="button" className="btn btn-toolbar-button">
             <span className="material-symbols-outlined fs-5">block</span>
             <span className="material-symbols-outlined fs-5">block</span>
           </button>
           </button>
-          <button type="button" className="btn btn-toolbar-button" onClick={() => onClickCreateReplaceSelection('`', '`')}>
+          <button type="button" className="btn btn-toolbar-button" onClick={() => onClickInsertMarkdownElements('`', '`')}>
             <span className="material-symbols-outlined fs-5">code</span>
             <span className="material-symbols-outlined fs-5">code</span>
           </button>
           </button>
           <button type="button" className="btn btn-toolbar-button">
           <button type="button" className="btn btn-toolbar-button">