Skip to content

Commit

Permalink
refactor: store, api 절대경로 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
pipisebastian committed Nov 20, 2024
1 parent 0119d98 commit 64d9356
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 18 deletions.
8 changes: 4 additions & 4 deletions client/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { useRefreshQuery } from "@apis/auth";
import { useErrorStore } from "@stores/useErrorStore";
import { useUserInfo } from "@stores/useUserStore";
import { useEffect } from "react";
import { ErrorModal } from "@components/modal/ErrorModal";
import { WorkSpace } from "@features/workSpace/WorkSpace";
import { useRefreshQuery } from "./apis/auth";
import { ErrorModal } from "./components/modal/ErrorModal";
import { useErrorStore } from "./stores/useErrorStore";
import { useUserInfo } from "./stores/useUserStore";

const App = () => {
const { id, name, accessToken } = useUserInfo();
Expand Down
2 changes: 1 addition & 1 deletion client/src/apis/auth.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useUserActions } from "@stores/useUserStore";
import { useMutation, useQuery } from "@tanstack/react-query";
import { useUserActions } from "@src/stores/useUserStore";
import { unAuthorizationFetch, fetch } from "./axios";

const authKey = {
Expand Down
4 changes: 2 additions & 2 deletions client/src/apis/axios.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useErrorStore } from "@stores/useErrorStore";
import { useUserStore } from "@stores/useUserStore";
import axios, { AxiosError, CreateAxiosDefaults, InternalAxiosRequestConfig } from "axios";
import { useErrorStore } from "@src/stores/useErrorStore";
import { useUserStore } from "@src/stores/useUserStore";

interface CustomAxiosRequestConfig extends InternalAxiosRequestConfig {
_retry?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/sidebar/MenuButton.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useUserInfo } from "@src/stores/useUserStore";
import { useUserInfo } from "@stores/useUserStore";
import { menuItemWrapper, imageBox, textBox } from "./MenuButton.style";

export const MenuButton = () => {
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { useIsSidebarOpen, useSidebarActions } from "@stores/useSidebarStore";
import { motion } from "framer-motion";
import { IconButton } from "@components/button/IconButton";
import { Modal } from "@components/modal/modal";
import { useModal } from "@components/modal/useModal";
import { MAX_VISIBLE_PAGE } from "@src/constants/page";
import { AuthButton } from "@src/features/auth/AuthButton";
import { useIsSidebarOpen, useSidebarActions } from "@src/stores/useSidebarStore";
import { Page } from "@src/types/page";
import { MenuButton } from "./MenuButton";
import { PageItem } from "./PageItem";
Expand Down
10 changes: 5 additions & 5 deletions client/src/features/auth/AuthButton.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useLogoutMutation } from "@src/apis/auth";
import { TextButton } from "@src/components/button/textButton";
import { Modal } from "@src/components/modal/modal";
import { useModal } from "@src/components/modal/useModal";
import { useCheckLogin } from "@src/stores/useUserStore";
import { useLogoutMutation } from "@apis/auth";
import { useCheckLogin } from "@stores/useUserStore";
import { TextButton } from "@components/button/textButton";
import { Modal } from "@components/modal/modal";
import { useModal } from "@components/modal/useModal";
import { AuthModal } from "./AuthModal";

export const AuthButton = () => {
Expand Down
4 changes: 2 additions & 2 deletions client/src/features/auth/AuthModal.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import { useLoginMutation, useSignupMutation } from "@apis/auth";
import { useState } from "react";
import Lock from "@assets/icons/lock.svg?react";
import Mail from "@assets/icons/mail.svg?react";
import User from "@assets/icons/user.svg?react";
import { InputField } from "@components/inputField/InputField";
import { Modal } from "@components/modal/modal";
import { useLoginMutation, useSignupMutation } from "@src/apis/auth";
import { InputField } from "@src/components/inputField/InputField";
import { container, formContainer, title, toggleButton } from "./AuthModal.style";

interface AuthModalProps {
Expand Down
2 changes: 1 addition & 1 deletion client/src/features/editor/Editor.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useSocket } from "@apis/useSocket.ts";
import { DndContext } from "@dnd-kit/core";
import { SortableContext, verticalListSortingStrategy } from "@dnd-kit/sortable";
import { EditorCRDT } from "@noctaCrdt/Crdt";
Expand All @@ -6,7 +7,6 @@ import { Block as CRDTBlock } from "@noctaCrdt/Node";
import { BlockId } from "@noctaCrdt/NodeId";
import { RemoteCharInsertOperation } from "node_modules/@noctaCrdt/Interfaces.ts";
import { useRef, useState, useCallback, useEffect } from "react";
import { useSocket } from "@src/apis/useSocket.ts";
import { editorContainer, editorTitleContainer, editorTitle } from "./Editor.style";
import { Block } from "./components/block/Block.tsx";
import { useBlockDragAndDrop } from "./hooks/useBlockDragAndDrop";
Expand Down
2 changes: 1 addition & 1 deletion client/src/features/page/hooks/usePage.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useEffect, useState } from "react";
import { PAGE, SIDE_BAR } from "@constants/size";
import { SPACING } from "@constants/spacing";
import { useIsSidebarOpen } from "@src/stores/useSidebarStore";
import { useIsSidebarOpen } from "@stores/useSidebarStore";
import { Position, Size } from "@src/types/page";

const PADDING = SPACING.MEDIUM * 2;
Expand Down
2 changes: 2 additions & 0 deletions client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
"@constants/*": ["src/constants/*"],
"@hooks/*": ["src/hooks/*"],
"@utils/*": ["src/utils/*"],
"@apis/*": ["src/apis/*"],
"@stores/*": ["src/stores/*"],
"@noctaCrdt": ["../@noctaCrdt/dist"],
"@noctaCrdt/*": ["../@noctaCrdt/dist/*"]
}
Expand Down

0 comments on commit 64d9356

Please sign in to comment.