From 4d0bdc9b97ac41dae83a50b3628a8ac123404e19 Mon Sep 17 00:00:00 2001 From: Steven Date: Fri, 23 Jun 2023 11:57:15 +0800 Subject: [PATCH] chore: rename folders --- web/src/App.tsx | 2 +- web/src/components/Header.tsx | 2 +- web/src/components/ShortcutListView.tsx | 2 +- web/src/{layout => layouts}/Root.tsx | 0 web/src/main.tsx | 2 +- web/src/pages/Home.tsx | 2 +- web/src/pages/UserDetail.tsx | 2 +- web/src/{router => routers}/index.tsx | 2 +- web/src/services/globalService.ts | 4 ++-- web/src/services/shortcutService.ts | 4 ++-- web/src/services/userService.ts | 4 ++-- web/src/{store => stores}/index.ts | 0 web/src/{store => stores}/modules/global.ts | 0 web/src/{store => stores}/modules/shortcut.ts | 0 web/src/{store => stores}/modules/user.ts | 0 15 files changed, 13 insertions(+), 13 deletions(-) rename web/src/{layout => layouts}/Root.tsx (100%) rename web/src/{router => routers}/index.tsx (97%) rename web/src/{store => stores}/index.ts (100%) rename web/src/{store => stores}/modules/global.ts (100%) rename web/src/{store => stores}/modules/shortcut.ts (100%) rename web/src/{store => stores}/modules/user.ts (100%) diff --git a/web/src/App.tsx b/web/src/App.tsx index 8190ca2..63f253a 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -1,7 +1,7 @@ import { CssVarsProvider } from "@mui/joy/styles"; import { Toaster } from "react-hot-toast"; import { RouterProvider } from "react-router-dom"; -import router from "./router"; +import router from "./routers"; function App() { return ( diff --git a/web/src/components/Header.tsx b/web/src/components/Header.tsx index ee64b05..50d0044 100644 --- a/web/src/components/Header.tsx +++ b/web/src/components/Header.tsx @@ -1,5 +1,5 @@ import { Link, useNavigate } from "react-router-dom"; -import { useAppSelector } from "../store"; +import { useAppSelector } from "../stores"; import { userService } from "../services"; import Icon from "./Icon"; import Dropdown from "./common/Dropdown"; diff --git a/web/src/components/ShortcutListView.tsx b/web/src/components/ShortcutListView.tsx index 19571aa..d27a555 100644 --- a/web/src/components/ShortcutListView.tsx +++ b/web/src/components/ShortcutListView.tsx @@ -4,7 +4,7 @@ import { useState } from "react"; import { toast } from "react-hot-toast"; import { UNKNOWN_ID } from "../helpers/consts"; import { shortcutService } from "../services"; -import { useAppSelector } from "../store"; +import { useAppSelector } from "../stores"; import { absolutifyLink } from "../helpers/utils"; import { showCommonDialog } from "./Alert"; import Icon from "./Icon"; diff --git a/web/src/layout/Root.tsx b/web/src/layouts/Root.tsx similarity index 100% rename from web/src/layout/Root.tsx rename to web/src/layouts/Root.tsx diff --git a/web/src/main.tsx b/web/src/main.tsx index 47645f8..3816d2a 100644 --- a/web/src/main.tsx +++ b/web/src/main.tsx @@ -1,6 +1,6 @@ import { createRoot } from "react-dom/client"; import { Provider } from "react-redux"; -import store from "./store"; +import store from "./stores"; import App from "./App"; import "./css/index.css"; diff --git a/web/src/pages/Home.tsx b/web/src/pages/Home.tsx index 7573b4b..794442f 100644 --- a/web/src/pages/Home.tsx +++ b/web/src/pages/Home.tsx @@ -1,7 +1,7 @@ import { useEffect, useState } from "react"; import { useNavigate } from "react-router-dom"; import { userService, shortcutService } from "../services"; -import { useAppSelector } from "../store"; +import { useAppSelector } from "../stores"; import useLoading from "../hooks/useLoading"; import Icon from "../components/Icon"; import Dropdown from "../components/common/Dropdown"; diff --git a/web/src/pages/UserDetail.tsx b/web/src/pages/UserDetail.tsx index f3687bd..b7d1330 100644 --- a/web/src/pages/UserDetail.tsx +++ b/web/src/pages/UserDetail.tsx @@ -1,7 +1,7 @@ import { Button } from "@mui/joy"; import { useEffect, useState } from "react"; import { useNavigate } from "react-router-dom"; -import { useAppSelector } from "../store"; +import { useAppSelector } from "../stores"; import { userService } from "../services"; import ChangePasswordDialog from "../components/ChangePasswordDialog"; diff --git a/web/src/router/index.tsx b/web/src/routers/index.tsx similarity index 97% rename from web/src/router/index.tsx rename to web/src/routers/index.tsx index bae5f30..d445833 100644 --- a/web/src/router/index.tsx +++ b/web/src/routers/index.tsx @@ -1,7 +1,7 @@ import { createBrowserRouter, redirect } from "react-router-dom"; import { isNullorUndefined } from "../helpers/utils"; import { userService } from "../services"; -import Root from "../layout/Root"; +import Root from "../layouts/Root"; import Auth from "../pages/Auth"; import Home from "../pages/Home"; import UserDetail from "../pages/UserDetail"; diff --git a/web/src/services/globalService.ts b/web/src/services/globalService.ts index a0ff100..0a5694b 100644 --- a/web/src/services/globalService.ts +++ b/web/src/services/globalService.ts @@ -1,5 +1,5 @@ -import store from "../store"; -import { setGlobalState } from "../store/modules/global"; +import store from "../stores"; +import { setGlobalState } from "../stores/modules/global"; import userService from "./userService"; const globalService = { diff --git a/web/src/services/shortcutService.ts b/web/src/services/shortcutService.ts index 3402ce7..9d5e7bb 100644 --- a/web/src/services/shortcutService.ts +++ b/web/src/services/shortcutService.ts @@ -1,6 +1,6 @@ import * as api from "../helpers/api"; -import store from "../store/"; -import { createShortcut, deleteShortcut, patchShortcut, setShortcuts } from "../store/modules/shortcut"; +import store from "../stores"; +import { createShortcut, deleteShortcut, patchShortcut, setShortcuts } from "../stores/modules/shortcut"; const convertResponseModelShortcut = (shortcut: Shortcut): Shortcut => { return { diff --git a/web/src/services/userService.ts b/web/src/services/userService.ts index 9b8025d..ac90734 100644 --- a/web/src/services/userService.ts +++ b/web/src/services/userService.ts @@ -1,6 +1,6 @@ import * as api from "../helpers/api"; -import store from "../store"; -import { setUser, patchUser } from "../store/modules/user"; +import store from "../stores"; +import { setUser, patchUser } from "../stores/modules/user"; export const convertResponseModelUser = (user: User): User => { return { diff --git a/web/src/store/index.ts b/web/src/stores/index.ts similarity index 100% rename from web/src/store/index.ts rename to web/src/stores/index.ts diff --git a/web/src/store/modules/global.ts b/web/src/stores/modules/global.ts similarity index 100% rename from web/src/store/modules/global.ts rename to web/src/stores/modules/global.ts diff --git a/web/src/store/modules/shortcut.ts b/web/src/stores/modules/shortcut.ts similarity index 100% rename from web/src/store/modules/shortcut.ts rename to web/src/stores/modules/shortcut.ts diff --git a/web/src/store/modules/user.ts b/web/src/stores/modules/user.ts similarity index 100% rename from web/src/store/modules/user.ts rename to web/src/stores/modules/user.ts