Skip to content

Commit 793f2ef

Browse files
committed
chore: update component name
1 parent 9fd50a4 commit 793f2ef

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useState, useEffect } from 'react';
2-
import JsonFormatter from './components/JsonFormatter';
2+
import JsonFormatter from './components/json-formatter';
33
import './App.less';
44

55
export default function App() {

src/components/JsonFormatter.tsx renamed to src/components/json-formatter/index.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import React, { useState, useCallback } from 'react';
1+
import { useState, useCallback } from 'react';
22
import Editor from '@monaco-editor/react';
3-
import { DEFAULT_JSON } from '../constants';
4-
import './JsonFormatter.less';
3+
import { DEFAULT_JSON } from '../../constants';
4+
import './style.less';
55

66
interface JsonFormatterProps {
77
isDarkMode: boolean;
88
onThemeChange: (isDark: boolean) => void;
99
}
1010

11-
const JsonFormatter: React.FC<JsonFormatterProps> = ({ isDarkMode, onThemeChange }) => {
11+
export default function JsonFormatter({ isDarkMode, onThemeChange }: JsonFormatterProps) {
1212
const [inputJson, setInputJson] = useState(DEFAULT_JSON);
1313
const [outputJson, setOutputJson] = useState('');
1414
const [error, setError] = useState('');
@@ -185,6 +185,4 @@ const JsonFormatter: React.FC<JsonFormatterProps> = ({ isDarkMode, onThemeChange
185185
</div>
186186
</div>
187187
);
188-
};
189-
190-
export default JsonFormatter;
188+
}

src/components/JsonFormatter.less renamed to src/components/json-formatter/style.less

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import '../styles/variables.less';
1+
@import '../../styles/variables.less';
22

33
.formatter-container {
44
width: 100%;
@@ -230,4 +230,4 @@
230230
color: @light-success;
231231
border-color: @light-success-border;
232232
}
233-
}
233+
}

0 commit comments

Comments
 (0)