Skip to content

Commit 9f0bb35

Browse files
committed
fix vercel react and clean
1 parent 1fce94a commit 9f0bb35

File tree

21 files changed

+55
-54
lines changed

21 files changed

+55
-54
lines changed

react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"scripts": {
77
"start": "vite --port 4050",
88
"lint": "eslint . --ext .ts,.tsx",
9-
"format": "prettier --write .",
9+
"format": "npx prettier --write .",
1010
"typecheck": "tsc --noEmit",
1111
"lint:fix": "eslint . --ext .ts,.tsx --fix --cache",
1212
"dev:lint": "concurrently -k -n VITE,ESLINT -c auto \"vite\" \"chokidar 'src/**/*.{ts,tsx}' -c 'eslint {path}'\"",

react/src/contexts/AxiosInterceptor.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { useEffect, useContext, ReactNode } from 'react';
22
import { toast } from 'sonner';
3+
import type { AxiosError, AxiosResponse, InternalAxiosRequestConfig } from 'axios';
34
import API from '../utils/axios';
4-
import { setLoading } from '../store/generalSlice';
55
import AuthContext from './UseAuth';
6-
import type { AxiosError, AxiosResponse, InternalAxiosRequestConfig } from 'axios';
7-
import { useAppDispatch } from '../store';
6+
import { setLoading } from '@/store/generalSlice';
7+
import { useAppDispatch } from '@/store';
88

99
interface AxiosInterceptorProps {
1010
children: ReactNode;

react/src/contexts/UseAuth.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ReactElement, createContext, useCallback, useEffect, useReducer, useContext } from 'react';
22
import { useNavigate } from 'react-router-dom';
3-
import API from '../utils/axios';
4-
import { authReducerActionProps, initialAuthContextProps, AuthContextType } from '../types';
3+
import API from '@/utils/axios';
4+
import { authReducerActionProps, initialAuthContextProps, AuthContextType } from '@/types';
55

66
const LOGIN = 'LOGIN';
77
const LOGOUT = 'LOGOUT';

react/src/layout/Customization/index.tsx

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import React, { useEffect } from 'react';
1+
import { ChangeEvent, useEffect, useState } from 'react';
2+
import { Property } from 'csstype';
3+
24
import { useSelector } from 'react-redux';
35
import { useTheme } from '@mui/material/styles';
46
import { Avatar, ButtonBase, FormControl, FormControlLabel, FormLabel, Grid, Radio, RadioGroup, Switch, PaletteMode } from '@mui/material';
@@ -15,11 +17,10 @@ import theme4 from '../../assets/scss/_theme4.module.scss';
1517
import theme5 from '../../assets/scss/_theme5.module.scss';
1618
import theme6 from '../../assets/scss/_theme6.module.scss';
1719

18-
import { StringColorProps, DefaultRootStateProps } from '../../types';
20+
import { StringColorProps, DefaultRootStateProps } from '@/types';
1921
import config from '../../config';
20-
import { setFontFamily, setNavType, setPresetColor, setRtlLayout } from '../../store/customizationReducer';
21-
import { Property } from 'csstype';
22-
import { useAppDispatch } from '../../store';
22+
import { setFontFamily, setNavType, setPresetColor, setRtlLayout } from '@/store/customizationReducer';
23+
import { useAppDispatch } from '@/store';
2324

2425
const PresetColor = ({
2526
color,
@@ -52,18 +53,18 @@ const Customization = () => {
5253

5354
const customization = useSelector((state: DefaultRootStateProps) => state.customization);
5455

55-
const [navType, setNavTypeState] = React.useState<PaletteMode>(customization.navType);
56+
const [navType, setNavTypeState] = useState<PaletteMode>(customization.navType);
5657
useEffect(() => {
5758
dispatch(setNavType(navType));
5859
}, [dispatch, navType]);
5960

60-
const [presetColor, setPresetColorState] = React.useState<string>(customization.presetColor);
61+
const [presetColor, setPresetColorState] = useState<string>(customization.presetColor);
6162
useEffect(() => {
6263
dispatch(setPresetColor(presetColor));
6364
}, [dispatch, presetColor]);
6465

65-
const [rtlLayout, setRtlLayoutState] = React.useState(customization.rtlLayout);
66-
const handleRtlLayout = (event: React.ChangeEvent<HTMLInputElement>) => {
66+
const [rtlLayout, setRtlLayoutState] = useState(customization.rtlLayout);
67+
const handleRtlLayout = (event: ChangeEvent<HTMLInputElement>) => {
6768
setRtlLayoutState(event.target.checked);
6869
};
6970

@@ -91,7 +92,7 @@ const Customization = () => {
9192
break;
9293
}
9394

94-
const [fontFamily, setFontFamilyState] = React.useState(initialFont);
95+
const [fontFamily, setFontFamilyState] = useState(initialFont);
9596
useEffect(() => {
9697
let newFont: Property.FontFamily;
9798
switch (fontFamily) {

react/src/layout/MainLayout/Header/ProfileSection/index.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ import {
2424
} from '@mui/icons-material';
2525

2626
import PerfectScrollbar from 'react-perfect-scrollbar';
27-
import MainCard from '../../../../ui-component/cards/MainCard';
28-
import { useAuth } from '../../../../contexts/UseAuth';
29-
import { DefaultRootStateProps } from '../../../../types';
30-
import Customization from '../../../Customization';
31-
import { setLocale } from '../../../../store/customizationReducer';
32-
import { useAppDispatch } from '../../../../store';
27+
import MainCard from '@/ui-component/cards/MainCard';
28+
import { useAuth } from '@/contexts/UseAuth';
29+
import { DefaultRootStateProps } from '@/types';
30+
import Customization from '@/layout/Customization';
31+
import { setLocale } from '@/store/customizationReducer';
32+
import { useAppDispatch } from '@/store';
3333

3434
const ProfileSection = () => {
3535
const theme = useTheme();

react/src/routes/Guard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useNavigate } from 'react-router-dom';
2-
import { useAuth } from '../contexts/UseAuth';
3-
import { GuardProps } from '../types';
2+
import { useAuth } from '@/contexts/UseAuth';
3+
import { GuardProps } from '@/types';
44
import { useEffect } from 'react';
55
import config from '../config';
66

react/src/store/generalSlice.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createAsyncThunk, createSlice, PayloadAction, ActionReducerMapBuilder, type GetThunkAPI } from '@reduxjs/toolkit';
22
import { toast } from 'sonner';
3-
import { Assignment, FieldValue, FilterQuery, ModelType, Student, TableModelType, Teacher } from '../types';
3+
import { Assignment, FieldValue, FilterQuery, ModelType, Student, TableModelType, Teacher } from '@/types';
44
import API from '../utils/axios';
55

66
export interface ModelList {

react/src/themes/types.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { CSSObject } from '@emotion/react';
22
import { PaletteMode } from '@mui/material';
33
import { Property } from 'csstype';
4-
import { ColorProps } from '../types';
4+
import { ColorProps } from '@/types';
55

66
export interface CustomizationProps {
77
fontFamily: Property.FontFamily;

react/src/types/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ReactElement } from 'react';
22
import { PaletteMode } from '@mui/material';
33
import { Property } from 'csstype';
4-
import { ModelState } from '../store/generalSlice';
4+
import { ModelState } from '@/store/generalSlice';
55

66
export * from './general';
77
export * from './table';

react/src/types/theme/createTheme.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import customShadows from '../../themes/shadows';
2-
import type { CustomizationStateProps } from '../index';
2+
import type { CustomizationStateProps } from '@/types';
33

44
declare module '@mui/material/styles' {
55
interface ThemeOptions {

0 commit comments

Comments
 (0)