Skip to content

Commit

Permalink
refactor: optimize imports
Browse files Browse the repository at this point in the history
  • Loading branch information
iib0011 committed Jun 26, 2024
1 parent 3f00335 commit 13f5d25
Show file tree
Hide file tree
Showing 20 changed files with 24 additions and 52 deletions.
5 changes: 2 additions & 3 deletions src/components/Navbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ import MenuIcon from '@mui/icons-material/Menu';
import { Link, useNavigate } from 'react-router-dom';
import githubIcon from '@assets/github-mark.png'; // Adjust the path to your GitHub icon
import {
Stack,
Drawer,
List,
ListItem,
ListItemButton,
ListItemText,
ListItemButton
Stack
} from '@mui/material';
import useMediaQuery from '@mui/material/useMediaQuery';
import { useTheme } from '@mui/material/styles';
Expand Down
2 changes: 1 addition & 1 deletion src/components/ToolHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Button, Box, Stack } from '@mui/material';
import { Box, Button } from '@mui/material';
import Typography from '@mui/material/Typography';
import ToolBreadcrumb from './ToolBreadcrumb';
import { capitalizeFirstLetter } from '../utils/string';
Expand Down
2 changes: 1 addition & 1 deletion src/components/allTools/ToolCard.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Box, Link, Card, CardContent, Typography } from '@mui/material';
import { Box, Card, CardContent, Link, Typography } from '@mui/material';
import { ToolCardProps } from './AllTools';
import ChevronRightIcon from '@mui/icons-material/ChevronRight';
import { useNavigate } from 'react-router-dom';
Expand Down
4 changes: 2 additions & 2 deletions src/components/examples/ExampleCard.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { ExampleCardProps } from './Examples';
import {
Box,
Stack,
Card,
CardContent,
Typography,
Stack,
TextField,
Typography,
useTheme
} from '@mui/material';
import ArrowDownwardIcon from '@mui/icons-material/ArrowDownward';
Expand Down
2 changes: 1 addition & 1 deletion src/components/input/ToolFileInput.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Box, styled, TextField, useTheme } from '@mui/material';
import { Box, useTheme } from '@mui/material';
import Typography from '@mui/material/Typography';
import React, { useContext, useEffect, useRef, useState } from 'react';
import InputHeader from '../InputHeader';
Expand Down
6 changes: 1 addition & 5 deletions src/components/input/ToolTextInput.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import { Box, Stack, TextField } from '@mui/material';
import Typography from '@mui/material/Typography';
import Button from '@mui/material/Button';
import PublishIcon from '@mui/icons-material/Publish';
import ContentPasteIcon from '@mui/icons-material/ContentPaste';
import { Box, TextField } from '@mui/material';
import React, { useContext, useRef } from 'react';
import { CustomSnackBarContext } from '../../contexts/CustomSnackBarContext';
import InputHeader from '../InputHeader';
Expand Down
2 changes: 1 addition & 1 deletion src/components/options/ColorSelector.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState, ChangeEvent, useRef } from 'react';
import React, { ChangeEvent, useRef, useState } from 'react';
import { Box, Stack, TextField } from '@mui/material';
import PaletteIcon from '@mui/icons-material/Palette';
import IconButton from '@mui/material/IconButton';
Expand Down
6 changes: 1 addition & 5 deletions src/components/options/RadioWithTextField.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import { SplitOperatorType } from '../../pages/string/split/service';
import { Box, Stack } from '@mui/material';
import { Field } from 'formik';
import Typography from '@mui/material/Typography';
import { Box } from '@mui/material';
import React from 'react';
import TextFieldWithDesc from './TextFieldWithDesc';
import { globalDescriptionFontSize } from '../../config/uiConfig';
import SimpleRadio from './SimpleRadio';

const RadioWithTextField = <T,>({
Expand Down
6 changes: 1 addition & 5 deletions src/components/result/ToolTextResult.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import Typography from '@mui/material/Typography';
import { Box, Stack, TextField } from '@mui/material';
import Button from '@mui/material/Button';
import DownloadIcon from '@mui/icons-material/Download';
import ContentPasteIcon from '@mui/icons-material/ContentPaste';
import { Box, TextField } from '@mui/material';
import React, { useContext } from 'react';
import { CustomSnackBarContext } from '../../contexts/CustomSnackBarContext';
import InputHeader from '../InputHeader';
Expand Down
3 changes: 1 addition & 2 deletions src/config/routesConfig.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { RouteObject } from 'react-router-dom';
import { Navigate } from 'react-router-dom';
import { Navigate, RouteObject } from 'react-router-dom';
import { lazy } from 'react';

const Home = lazy(() => import('../pages/home'));
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Box, Card, CardContent, Stack } from '@mui/material';
import { Box, Card, CardContent } from '@mui/material';
import Grid from '@mui/material/Grid';
import Typography from '@mui/material/Typography';
import { Link, useNavigate } from 'react-router-dom';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/number/generate/generate.service.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Import necessary modules and functions
import { describe, it, expect } from 'vitest';
import { describe, expect, it } from 'vitest';
import { listOfIntegers } from './service';

// Define test cases for the listOfIntegers function
Expand Down
2 changes: 1 addition & 1 deletion src/pages/number/sum/sum.service.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it, expect } from 'vitest';
import { describe, expect, it } from 'vitest';
import { compute } from './service';

describe('compute function', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/string/join/string-join.e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { test, expect } from '@playwright/test';
import { expect, test } from '@playwright/test';

test.describe('JoinText Component', () => {
test.beforeEach(async ({ page }) => {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/string/join/string-join.service.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it, expect } from 'vitest';
import { describe, expect, it } from 'vitest';
import { mergeText } from './service';

describe('mergeText', () => {
Expand Down
9 changes: 2 additions & 7 deletions src/pages/string/split/index.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
import { Box, Stack } from '@mui/material';
import Grid from '@mui/material/Grid';
import React, { useContext, useEffect, useState } from 'react';
import { Box } from '@mui/material';
import React, { useState } from 'react';
import ToolTextInput from '../../../components/input/ToolTextInput';
import ToolTextResult from '../../../components/result/ToolTextResult';
import { Formik, useFormikContext } from 'formik';
import * as Yup from 'yup';
import ToolOptions from '../../../components/options/ToolOptions';
import { compute, SplitOperatorType } from './service';
import { CustomSnackBarContext } from '../../../contexts/CustomSnackBarContext';
import RadioWithTextField from '../../../components/options/RadioWithTextField';
import TextFieldWithDesc from '../../../components/options/TextFieldWithDesc';
import ToolOptionGroups from '../../../components/options/ToolOptionGroups';
import ToolInputAndResult from '../../../components/ToolInputAndResult';
import CheckboxWithDesc from '../../../components/options/CheckboxWithDesc';

const initialValues = {
splitSeparatorType: 'symbol' as SplitOperatorType,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/string/split/string-split.service.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it, expect } from 'vitest';
import { describe, expect, it } from 'vitest';
import { compute } from './service';

describe('compute function', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/string/to-morse/to-morse.service.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it, expect } from 'vitest';
import { describe, expect, it } from 'vitest';
import { compute } from './service';

describe('compute function', () => {
Expand Down
13 changes: 2 additions & 11 deletions src/pages/tools-by-category/index.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
import {
Box,
Card,
CardContent,
Divider,
Stack,
useTheme
} from '@mui/material';
import { Box, Divider, Stack, useTheme } from '@mui/material';
import Grid from '@mui/material/Grid';
import Typography from '@mui/material/Typography';
import { Link, useNavigate, useParams } from 'react-router-dom';
import { getToolsByCategory, tools } from '../../tools';
import Button from '@mui/material/Button';
import { getToolsByCategory } from '../../tools';
import Hero from 'components/Hero';
import AllTools from '../../components/allTools/AllTools';
import { capitalizeFirstLetter } from '../../utils/string';
import toolsPng from '@assets/tools.png';

Expand Down
2 changes: 1 addition & 1 deletion src/tools/defineTool.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ToolLayout from '../components/ToolLayout';
import React, { LazyExoticComponent, JSXElementConstructor } from 'react';
import React, { JSXElementConstructor, LazyExoticComponent } from 'react';

interface ToolOptions {
path: string;
Expand Down

0 comments on commit 13f5d25

Please sign in to comment.