Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: 절대경로 import 추가, MyRentInfo에 절대경로 적용 #542

Merged
merged 3 commits into from
Aug 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"react-router-dom": "^6.11.2",
"recoil": "^0.7.7",
"vite": "^4.3.8",
"vite-tsconfig-paths": "^4.2.0",
"web-vitals": "^3.3.1"
},
"scripts": {
Expand Down
33 changes: 32 additions & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/api/like/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * from "./useDeleteLike";
export * from "./useGetLike";
export * from "./usePostLike";
6 changes: 3 additions & 3 deletions src/component/mypage/MyRentInfo/MyRent.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useGetUsersSearchId } from "../../../api/users/useGetUsersSearchId";
import { useGetUsersSearchId } from "~/api/users/useGetUsersSearchId";
import RentHistory from "./RentHistory";
import RentedOrReservedBooks from "./RentedOrReservedBooks";
import InquireBoxTitle from "../../utils/InquireBoxTitle";
import Book from "../../../asset/img/admin_icon.svg";
import InquireBoxTitle from "~/component/utils/InquireBoxTitle";
import Book from "~/asset/img/admin_icon.svg";

const MyRent = () => {
const user = window.localStorage.getItem("user");
Expand Down
6 changes: 3 additions & 3 deletions src/component/mypage/MyRentInfo/RentHistory.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Pagination from "../../utils/Pagination";
import { useGetHistories } from "../../../api/histories/useGetHistories";
import Pagination from "~/component/utils/Pagination";
import { useGetHistories } from "~/api/histories/useGetHistories";
import RentHistoryTable from "./RentHistoryTable";
import "../../../asset/css/RentHistory.css";
import "~/asset/css/RentHistory.css";

const RentHistory = () => {
const { historiesList, lastPage, page, setPage } = useGetHistories({
Expand Down
14 changes: 6 additions & 8 deletions src/component/mypage/MyRentInfo/RentHistoryTable.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { useState } from "react";
import { useGetLike } from "../../../api/like/useGetLike";
import { usePostLike } from "../../../api/like/usePostLike";
import { useDeleteLike } from "../../../api/like/useDeleteLike";
import Image from "../../utils/Image";
import FilledLike from "../../../asset/img/like_filled.svg";
import EmptyLike from "../../../asset/img/like_empty.svg";
import { History } from "../../../type";
import "../../../asset/css/RentHistory.css";
import { useGetLike, usePostLike, useDeleteLike } from "~/api/like";
import Image from "~/component/utils/Image";
import FilledLike from "~/asset/img/like_filled.svg";
import EmptyLike from "~/asset/img/like_empty.svg";
import type { History } from "~/type";
import "~/asset/css/RentHistory.css";

type Props = {
factor: History;
Expand Down
10 changes: 5 additions & 5 deletions src/component/mypage/MyRentInfo/RentedOrReservedBooks.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { usePatchReservationsCancel } from "../../../api/reservations/usePatchReservationsCancel";
import Image from "../../utils/Image";
import { isNumber } from "../../../util/typeCheck";
import { Lending, Reservation } from "../../../type";
import "../../../asset/css/RentedOrReservedBooks.css";
import { usePatchReservationsCancel } from "~/api/reservations/usePatchReservationsCancel";
import Image from "~/component/utils/Image";
import { isNumber } from "~/util/typeCheck";
import { Lending, Reservation } from "~/type";
import "~/asset/css/RentedOrReservedBooks.css";

type Props = {
componentMode: string;
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx"
"jsx": "react-jsx",
"paths": { "~/*": ["./src/*"] }
},
"include": ["src"],
"references": [{ "path": "./tsconfig.vite.json" }]
Expand Down
3 changes: 2 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { defineConfig, loadEnv } from "vite";
// eslint-disable-next-line import/no-extraneous-dependencies
import react from "@vitejs/plugin-react-swc";
import tsconfigPaths from "vite-tsconfig-paths";

/**
* REACT_APP_ 으로 시작하는 환경변수를
Expand All @@ -21,7 +22,7 @@ export default defineConfig(({ mode }) => {

return {
/** @see https://vitejs.dev/plugins/ */
plugins: [react()],
plugins: [react(), tsconfigPaths()],

envPrefix,

Expand Down
Loading