Skip to content

Commit 79b9868

Browse files
committed
chore(deps): remove denpendency classnames.
1 parent 22ba122 commit 79b9868

File tree

5 files changed

+6
-18
lines changed

5 files changed

+6
-18
lines changed

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,7 @@
4444
]
4545
},
4646
"dependencies": {
47-
"@types/classnames": "^2.2.11",
4847
"@uiw/react-markdown-preview": "2.1.1",
49-
"classnames": "2.2.6",
5048
"codemirror": "5.59.2"
5149
},
5250
"devDependencies": {

src/commands/fullscreen.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React, { useEffect, useRef, useState } from 'react';
2-
import classnames from 'classnames';
32
import { ICommand} from './';
43
import { IMarkdownEditor } from '../';
54

@@ -58,9 +57,7 @@ const Fullscreen: React.FC<{ command: ICommand, editorProps: IMarkdownEditor & O
5857
<button
5958
onClick={() => setFull(!full)}
6059
type="button"
61-
className={classnames({
62-
'active': full
63-
})}
60+
className={full ? 'active' : ''}
6461
>
6562
{props.command.icon}
6663
</button>

src/commands/preview.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React, { useEffect, useState } from 'react';
2-
import classnames from 'classnames';
32
import { ICommand} from './';
43
import { IMarkdownEditor } from '../';
54

@@ -44,9 +43,7 @@ const Preview: React.FC<{ command: ICommand, editorProps: IMarkdownEditor & Opti
4443
<button
4544
onClick={() => setVisible(!visible)}
4645
type="button"
47-
className={classnames({
48-
'active': visible
49-
})}
46+
className={visible ? 'active' : ''}
5047
>
5148
{props.command.icon}
5249
</button>

src/components/ToolBar/index.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import classnames from 'classnames';
21
import * as React from "react";
32
import { IProps } from '../../common/props';
43
import CodeMirror from 'codemirror';
@@ -27,9 +26,7 @@ export default function ToolBar(props: IToolBarProps) {
2726
}
2827
}
2928
return (
30-
<div className={classnames(`${prefixCls}-toolbar`, className, {
31-
[`${prefixCls}-toolbar-mode`]: mode,
32-
})} {...htmlProps}>
29+
<div className={`${prefixCls}-toolbar ${className} ${mode ? `${prefixCls}-toolbar-mode` : ''}`} {...htmlProps}>
3330
{[...toolbars].map((command, key) => {
3431
let buttonProps: React.ButtonHTMLAttributes<HTMLButtonElement> = {
3532
type: 'button',

src/index.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import classnames from 'classnames';
21
import React, { useState, createRef, useRef, useEffect } from 'react';
32
import { IProps } from './common/props';
43
import CodeMirror, { ICodeMirror } from './components/CodeMirror';
@@ -49,10 +48,10 @@ export default function MarkdownEditor(props: IMarkdownEditor) {
4948
}
5049
return (
5150
<div ref={container}>
52-
<div className={classnames(prefixCls, className)}>
51+
<div className={`${prefixCls || ''} ${className || ''}`}>
5352
<ToolBar {...toolBarProps} toolbars={toolbarsMode} mode />
5453
<ToolBar {...toolBarProps} toolbars={toolbars} />
55-
<div className={classnames(`${prefixCls}-content`)}>
54+
<div className={`${prefixCls}-content`}>
5655
<div className={`${prefixCls}-content-editor`} ref={containerEditor}>
5756
{visibleEditor && (
5857
<CodeMirror
@@ -69,7 +68,7 @@ export default function MarkdownEditor(props: IMarkdownEditor) {
6968
<MarkdownPreview
7069
{...previewProps}
7170
data-visible={!!visible}
72-
className={classnames(`${prefixCls}-preview`)}
71+
className={`${prefixCls}-preview`}
7372
ref={(instance) => {
7473
if(instance && instance.mdp) {
7574
previewContainer.current = instance.mdp.current

0 commit comments

Comments
 (0)