diff --git a/README.md b/README.md
index 541db24f..69a63429 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,7 @@
## BSM
+## commit convention
+
feat : 새로운 기능 추가
fix : 버그 수정
docs : 문서 관련
@@ -9,4 +11,16 @@ test : 테스트 관련 코드
build : 빌드 관련 파일 수정
ci : CI 설정 파일 수정
perf : 성능 개선
-chore : 그 외 자잘한 수정
\ No newline at end of file
+chore : 그 외 자잘한 수정
+
+## import convention
+
+1. React
+2. style
+3. asset
+4. constant
+5. hook
+6. store
+7. type
+8. interface
+9. components
diff --git a/next.config.js b/next.config.js
index 745e6349..686cb84d 100644
--- a/next.config.js
+++ b/next.config.js
@@ -1,7 +1,7 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
images: {
- domains: ["bssm.kro.kr", "discord.com"],
+ domains: ["bssm.kro.kr"],
},
};
diff --git a/package.json b/package.json
index 9519840c..d9fd8850 100644
--- a/package.json
+++ b/package.json
@@ -26,6 +26,7 @@
"eslint-config-next": "13.0.0",
"eslint-plugin-prettier": "^4.2.1",
"jest": "^29.3.1",
+ "msw": "^1.2.3",
"next": "13.4.4",
"prettier": "^2.8.8",
"react": "18.2.0",
@@ -73,5 +74,8 @@
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
+ },
+ "msw": {
+ "workerDirectory": "public"
}
}
diff --git a/public/mockServiceWorker.js b/public/mockServiceWorker.js
new file mode 100644
index 00000000..36a99274
--- /dev/null
+++ b/public/mockServiceWorker.js
@@ -0,0 +1,303 @@
+/* eslint-disable */
+/* tslint:disable */
+
+/**
+ * Mock Service Worker (1.2.3).
+ * @see https://github.com/mswjs/msw
+ * - Please do NOT modify this file.
+ * - Please do NOT serve this file on production.
+ */
+
+const INTEGRITY_CHECKSUM = '3d6b9f06410d179a7f7404d4bf4c3c70'
+const activeClientIds = new Set()
+
+self.addEventListener('install', function () {
+ self.skipWaiting()
+})
+
+self.addEventListener('activate', function (event) {
+ event.waitUntil(self.clients.claim())
+})
+
+self.addEventListener('message', async function (event) {
+ const clientId = event.source.id
+
+ if (!clientId || !self.clients) {
+ return
+ }
+
+ const client = await self.clients.get(clientId)
+
+ if (!client) {
+ return
+ }
+
+ const allClients = await self.clients.matchAll({
+ type: 'window',
+ })
+
+ switch (event.data) {
+ case 'KEEPALIVE_REQUEST': {
+ sendToClient(client, {
+ type: 'KEEPALIVE_RESPONSE',
+ })
+ break
+ }
+
+ case 'INTEGRITY_CHECK_REQUEST': {
+ sendToClient(client, {
+ type: 'INTEGRITY_CHECK_RESPONSE',
+ payload: INTEGRITY_CHECKSUM,
+ })
+ break
+ }
+
+ case 'MOCK_ACTIVATE': {
+ activeClientIds.add(clientId)
+
+ sendToClient(client, {
+ type: 'MOCKING_ENABLED',
+ payload: true,
+ })
+ break
+ }
+
+ case 'MOCK_DEACTIVATE': {
+ activeClientIds.delete(clientId)
+ break
+ }
+
+ case 'CLIENT_CLOSED': {
+ activeClientIds.delete(clientId)
+
+ const remainingClients = allClients.filter((client) => {
+ return client.id !== clientId
+ })
+
+ // Unregister itself when there are no more clients
+ if (remainingClients.length === 0) {
+ self.registration.unregister()
+ }
+
+ break
+ }
+ }
+})
+
+self.addEventListener('fetch', function (event) {
+ const { request } = event
+ const accept = request.headers.get('accept') || ''
+
+ // Bypass server-sent events.
+ if (accept.includes('text/event-stream')) {
+ return
+ }
+
+ // Bypass navigation requests.
+ if (request.mode === 'navigate') {
+ return
+ }
+
+ // Opening the DevTools triggers the "only-if-cached" request
+ // that cannot be handled by the worker. Bypass such requests.
+ if (request.cache === 'only-if-cached' && request.mode !== 'same-origin') {
+ return
+ }
+
+ // Bypass all requests when there are no active clients.
+ // Prevents the self-unregistered worked from handling requests
+ // after it's been deleted (still remains active until the next reload).
+ if (activeClientIds.size === 0) {
+ return
+ }
+
+ // Generate unique request ID.
+ const requestId = Math.random().toString(16).slice(2)
+
+ event.respondWith(
+ handleRequest(event, requestId).catch((error) => {
+ if (error.name === 'NetworkError') {
+ console.warn(
+ '[MSW] Successfully emulated a network error for the "%s %s" request.',
+ request.method,
+ request.url,
+ )
+ return
+ }
+
+ // At this point, any exception indicates an issue with the original request/response.
+ console.error(
+ `\
+[MSW] Caught an exception from the "%s %s" request (%s). This is probably not a problem with Mock Service Worker. There is likely an additional logging output above.`,
+ request.method,
+ request.url,
+ `${error.name}: ${error.message}`,
+ )
+ }),
+ )
+})
+
+async function handleRequest(event, requestId) {
+ const client = await resolveMainClient(event)
+ const response = await getResponse(event, client, requestId)
+
+ // Send back the response clone for the "response:*" life-cycle events.
+ // Ensure MSW is active and ready to handle the message, otherwise
+ // this message will pend indefinitely.
+ if (client && activeClientIds.has(client.id)) {
+ ;(async function () {
+ const clonedResponse = response.clone()
+ sendToClient(client, {
+ type: 'RESPONSE',
+ payload: {
+ requestId,
+ type: clonedResponse.type,
+ ok: clonedResponse.ok,
+ status: clonedResponse.status,
+ statusText: clonedResponse.statusText,
+ body:
+ clonedResponse.body === null ? null : await clonedResponse.text(),
+ headers: Object.fromEntries(clonedResponse.headers.entries()),
+ redirected: clonedResponse.redirected,
+ },
+ })
+ })()
+ }
+
+ return response
+}
+
+// Resolve the main client for the given event.
+// Client that issues a request doesn't necessarily equal the client
+// that registered the worker. It's with the latter the worker should
+// communicate with during the response resolving phase.
+async function resolveMainClient(event) {
+ const client = await self.clients.get(event.clientId)
+
+ if (client?.frameType === 'top-level') {
+ return client
+ }
+
+ const allClients = await self.clients.matchAll({
+ type: 'window',
+ })
+
+ return allClients
+ .filter((client) => {
+ // Get only those clients that are currently visible.
+ return client.visibilityState === 'visible'
+ })
+ .find((client) => {
+ // Find the client ID that's recorded in the
+ // set of clients that have registered the worker.
+ return activeClientIds.has(client.id)
+ })
+}
+
+async function getResponse(event, client, requestId) {
+ const { request } = event
+ const clonedRequest = request.clone()
+
+ function passthrough() {
+ // Clone the request because it might've been already used
+ // (i.e. its body has been read and sent to the client).
+ const headers = Object.fromEntries(clonedRequest.headers.entries())
+
+ // Remove MSW-specific request headers so the bypassed requests
+ // comply with the server's CORS preflight check.
+ // Operate with the headers as an object because request "Headers"
+ // are immutable.
+ delete headers['x-msw-bypass']
+
+ return fetch(clonedRequest, { headers })
+ }
+
+ // Bypass mocking when the client is not active.
+ if (!client) {
+ return passthrough()
+ }
+
+ // Bypass initial page load requests (i.e. static assets).
+ // The absence of the immediate/parent client in the map of the active clients
+ // means that MSW hasn't dispatched the "MOCK_ACTIVATE" event yet
+ // and is not ready to handle requests.
+ if (!activeClientIds.has(client.id)) {
+ return passthrough()
+ }
+
+ // Bypass requests with the explicit bypass header.
+ // Such requests can be issued by "ctx.fetch()".
+ if (request.headers.get('x-msw-bypass') === 'true') {
+ return passthrough()
+ }
+
+ // Notify the client that a request has been intercepted.
+ const clientMessage = await sendToClient(client, {
+ type: 'REQUEST',
+ payload: {
+ id: requestId,
+ url: request.url,
+ method: request.method,
+ headers: Object.fromEntries(request.headers.entries()),
+ cache: request.cache,
+ mode: request.mode,
+ credentials: request.credentials,
+ destination: request.destination,
+ integrity: request.integrity,
+ redirect: request.redirect,
+ referrer: request.referrer,
+ referrerPolicy: request.referrerPolicy,
+ body: await request.text(),
+ bodyUsed: request.bodyUsed,
+ keepalive: request.keepalive,
+ },
+ })
+
+ switch (clientMessage.type) {
+ case 'MOCK_RESPONSE': {
+ return respondWithMock(clientMessage.data)
+ }
+
+ case 'MOCK_NOT_FOUND': {
+ return passthrough()
+ }
+
+ case 'NETWORK_ERROR': {
+ const { name, message } = clientMessage.data
+ const networkError = new Error(message)
+ networkError.name = name
+
+ // Rejecting a "respondWith" promise emulates a network error.
+ throw networkError
+ }
+ }
+
+ return passthrough()
+}
+
+function sendToClient(client, message) {
+ return new Promise((resolve, reject) => {
+ const channel = new MessageChannel()
+
+ channel.port1.onmessage = (event) => {
+ if (event.data && event.data.error) {
+ return reject(event.data.error)
+ }
+
+ resolve(event.data)
+ }
+
+ client.postMessage(message, [channel.port2])
+ })
+}
+
+function sleep(timeMs) {
+ return new Promise((resolve) => {
+ setTimeout(resolve, timeMs)
+ })
+}
+
+async function respondWithMock(response) {
+ await sleep(response.delay)
+ return new Response(response.body, response)
+}
diff --git a/src/apis/httpClient/httpClient.ts b/src/apis/httpClient/httpClient.ts
index 08d07333..449ad202 100644
--- a/src/apis/httpClient/httpClient.ts
+++ b/src/apis/httpClient/httpClient.ts
@@ -1,9 +1,7 @@
import axios, { AxiosInstance, AxiosRequestConfig } from "axios";
import { requestInterceptors, responseInterceptors } from "@/apis/interceptor";
-import Storage from "@/apis/storage";
-import refreshToken from "@/apis/token/refreshToken";
-import TOKEN from "@/global/constants/token.constant";
-import IClassLevel from "@/global/types/classLevel.type";
+import { KEY } from "@/constants/";
+import { QueryClient } from "react-query";
export interface HttpClientConfig {
baseURL?: string;
@@ -36,26 +34,22 @@ export class HttpClient {
});
}
- getTimetable(classLevel: IClassLevel, requestConfig?: AxiosRequestConfig) {
- return this.api.get(`/${classLevel.grade}/${classLevel.class}`, {
+ getByTitle(requestConfig?: AxiosRequestConfig) {
+ return this.api.get("/:title", {
...HttpClient.clientConfig,
...requestConfig,
});
}
- getByTitle(url: string, requestConfig?: AxiosRequestConfig) {
- return this.api.get(`/${url}`, {
+ getTimetable(requestConfig?: AxiosRequestConfig) {
+ return this.api.get("/:grade/:class", {
...HttpClient.clientConfig,
...requestConfig,
});
}
- getInQuery(
- param: string,
- data: string | number,
- requestConfig?: AxiosRequestConfig,
- ) {
- return this.api.get(`?${param}=${data}`, {
+ getPost(requestConfig?: AxiosRequestConfig) {
+ return this.api.get("", {
...HttpClient.clientConfig,
...requestConfig,
});
@@ -68,12 +62,8 @@ export class HttpClient {
});
}
- postInQuery(
- param: string,
- data: unknown,
- requestConfig?: AxiosRequestConfig,
- ) {
- return this.api.post(`?${param}=${data}`, {
+ postOAuth(data: unknown, requestConfig?: AxiosRequestConfig) {
+ return this.api.post(`?code=${data}`, {
...HttpClient.clientConfig,
...requestConfig,
});
@@ -86,8 +76,8 @@ export class HttpClient {
});
}
- putByTitle(title: string, data: unknown, requestConfig?: AxiosRequestConfig) {
- return this.api.put(`/${title}`, data, {
+ putByTitle(data: unknown, requestConfig?: AxiosRequestConfig) {
+ return this.api.put("/:title", data, {
...HttpClient.clientConfig,
...requestConfig,
});
@@ -100,8 +90,8 @@ export class HttpClient {
});
}
- deleteById(id: number, requestConfig?: AxiosRequestConfig) {
- return this.api.delete(`/${id}`, {
+ deleteById(requestConfig?: AxiosRequestConfig) {
+ return this.api.delete("/:id", {
...HttpClient.clientConfig,
...requestConfig,
});
@@ -109,30 +99,17 @@ export class HttpClient {
private setting() {
HttpClient.setCommonInterceptors(this.api);
- // const queryClient = new QueryClient();
+ const queryClient = new QueryClient();
this.api.interceptors.response.use(
(response) => response,
(error) => {
- // queryClient.invalidateQueries("getUser");
- refreshToken();
+ queryClient.invalidateQueries(KEY.USER);
return Promise.reject(error);
},
);
}
- static setAccessToken() {
- const accessToken = Storage.getItem(TOKEN.ACCESS);
- HttpClient.clientConfig.headers = {
- ...HttpClient.clientConfig.headers,
- Authorization: accessToken || undefined,
- };
- }
-
- static removeAccessToken() {
- Storage.setItem(TOKEN.ACCESS, "");
- }
-
private static setCommonInterceptors(instance: AxiosInstance) {
instance.interceptors.request.use(requestInterceptors as never);
instance.interceptors.response.use(responseInterceptors);
@@ -148,4 +125,5 @@ export default {
oauth: new HttpClient("api/auth/oauth/bsm", axiosConfig),
user: new HttpClient("api/user", axiosConfig),
timetable: new HttpClient("api/timetable", axiosConfig),
+ post: new HttpClient("api/post/", axiosConfig),
};
diff --git a/src/apis/interceptor/index.ts b/src/apis/interceptor/index.ts
index c6a1882b..d23cfbad 100644
--- a/src/apis/interceptor/index.ts
+++ b/src/apis/interceptor/index.ts
@@ -1,17 +1,6 @@
-import Storage from "@/apis/storage";
import { AxiosRequestConfig, AxiosResponse } from "axios";
-import refreshToken from "@/apis/token/refreshToken";
-import ERROR from "@/global/constants/error.constant";
-import TOKEN from "@/global/constants/token.constant";
export const requestInterceptors = (requestConfig: AxiosRequestConfig) => {
- if (!Storage.getItem(TOKEN.ACCESS) && Storage.getItem(TOKEN.REFRESH))
- refreshToken();
-
- if (requestConfig.headers) {
- requestConfig.headers.Authorization = Storage.getItem(TOKEN.ACCESS);
- }
-
const urlParams = requestConfig.url?.split("/:") || [];
if (urlParams.length < 2) return requestConfig;
@@ -32,8 +21,6 @@ export const requestInterceptors = (requestConfig: AxiosRequestConfig) => {
};
export const responseInterceptors = (originalResponse: AxiosResponse) => {
- if (originalResponse.status !== ERROR.STATUS.SUCCESS) refreshToken();
-
return {
...originalResponse,
data: originalResponse.data,
diff --git a/src/apis/storage/index.ts b/src/apis/storage/index.ts
index 741aa481..21888371 100644
--- a/src/apis/storage/index.ts
+++ b/src/apis/storage/index.ts
@@ -1,16 +1,16 @@
-type LocalStorageKey = "access_token" | "refresh_token";
+import { StorageSettingKey } from "@/types/";
export default class Storage {
- static getItem(key: LocalStorageKey) {
+ static getItem(key: StorageSettingKey) {
return typeof window !== "undefined" ? localStorage.getItem(key) : null;
}
- static setItem(key: LocalStorageKey, value: string) {
+ static setItem(key: StorageSettingKey, value: string) {
if (typeof window === "undefined") return;
localStorage.setItem(key, value);
}
- static delItem(key: LocalStorageKey) {
+ static delItem(key: StorageSettingKey) {
if (typeof window === "undefined") return;
localStorage.removeItem(key);
}
diff --git a/src/apis/token/refreshToken.ts b/src/apis/token/refreshToken.ts
deleted file mode 100644
index ea49fd33..00000000
--- a/src/apis/token/refreshToken.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import axios from "axios";
-import Storage from "@/apis/storage";
-import TOKEN from "@/global/constants/token.constant";
-
-const refreshToken = async () => {
- // fix 필요
- try {
- const res = (
- await axios.put("/auth/refresh/access", {
- refresh_token: Storage.getItem(TOKEN.REFRESH),
- })
- ).data;
- Storage.setItem(TOKEN.ACCESS, res.accessToken);
- } catch (err) {
- Storage.delItem(TOKEN.REFRESH);
- }
-};
-
-export default refreshToken;
diff --git a/src/app/layout.tsx b/src/app/layout.tsx
index f189e420..3dbc2693 100644
--- a/src/app/layout.tsx
+++ b/src/app/layout.tsx
@@ -1,5 +1,4 @@
-import "@/styles/globals.css";
-import Provider from "@/global/helpers/provider.helper";
+import Provider from "@/helpers/provider.helper";
export const metadata = {
title: "BSM",
diff --git a/src/app/lostfound/[postType]/[id]/page.tsx b/src/app/lostfound/[state]/[id]/page.tsx
similarity index 100%
rename from src/app/lostfound/[postType]/[id]/page.tsx
rename to src/app/lostfound/[state]/[id]/page.tsx
diff --git a/src/app/page.tsx b/src/app/page.tsx
index 77cfff68..1f8dd329 100644
--- a/src/app/page.tsx
+++ b/src/app/page.tsx
@@ -1,7 +1,10 @@
"use client";
+import initMockAPI from "@/mocks";
import HomePage from "@/page/home";
+if (process.env.NODE_ENV === "development") initMockAPI();
+
const Home = () => {
return ;
};
diff --git a/src/assets/data/emptyCategories.ts b/src/assets/data/emptyCategories.ts
new file mode 100644
index 00000000..b22de56f
--- /dev/null
+++ b/src/assets/data/emptyCategories.ts
@@ -0,0 +1,22 @@
+import { FORUM } from "@/constants";
+
+const categories = [
+ {
+ name: FORUM.CATEGORY.ALL.NAME,
+ type: FORUM.CATEGORY.ALL.TYPE,
+ },
+ {
+ name: FORUM.CATEGORY.COMPLAIN.NAME,
+ type: FORUM.CATEGORY.COMPLAIN.TYPE,
+ },
+ {
+ name: FORUM.CATEGORY.HUMOR.NAME,
+ type: FORUM.CATEGORY.HUMOR.TYPE,
+ },
+ {
+ name: FORUM.CATEGORY.INFORMATION.NAME,
+ type: FORUM.CATEGORY.INFORMATION.TYPE,
+ },
+];
+
+export default categories;
diff --git a/src/page/timetable/data/emptyClassInfo.ts b/src/assets/data/emptyClassInfo.ts
similarity index 75%
rename from src/page/timetable/data/emptyClassInfo.ts
rename to src/assets/data/emptyClassInfo.ts
index 37373225..66caeb62 100644
--- a/src/page/timetable/data/emptyClassInfo.ts
+++ b/src/assets/data/emptyClassInfo.ts
@@ -1,4 +1,4 @@
-import IClassInfo from "@/global/types/classInfo.type";
+import { IClassInfo } from "@/interfaces";
const emptyClassInfo: IClassInfo = {
className: "",
diff --git a/src/page/timetable/data/emptyClassLevel.ts b/src/assets/data/emptyClassLevel.ts
similarity index 100%
rename from src/page/timetable/data/emptyClassLevel.ts
rename to src/assets/data/emptyClassLevel.ts
diff --git a/src/page/timetable/data/emptyTimetable.ts b/src/assets/data/emptyTimetable.ts
similarity index 95%
rename from src/page/timetable/data/emptyTimetable.ts
rename to src/assets/data/emptyTimetable.ts
index ba0407a5..f5611408 100644
--- a/src/page/timetable/data/emptyTimetable.ts
+++ b/src/assets/data/emptyTimetable.ts
@@ -1,4 +1,4 @@
-import ITimetable from "@/global/types/timetable.type";
+import { ITimetable } from "@/interfaces";
const emptyTimetable: ITimetable = {
SUN: [
diff --git a/src/assets/data/index.ts b/src/assets/data/index.ts
new file mode 100644
index 00000000..7bca69dc
--- /dev/null
+++ b/src/assets/data/index.ts
@@ -0,0 +1,4 @@
+export { default as emptyCategories } from "./emptyCategories";
+export { default as emptyClassInfo } from "./emptyClassInfo";
+export { default as emptyClassLevel } from "./emptyClassLevel";
+export { default as emptyTimetable } from "./emptyTimetable";
diff --git a/src/global/assets/svgs/Arrow.tsx b/src/assets/icons/Arrow.tsx
similarity index 96%
rename from src/global/assets/svgs/Arrow.tsx
rename to src/assets/icons/Arrow.tsx
index 33ee15e5..af176f86 100644
--- a/src/global/assets/svgs/Arrow.tsx
+++ b/src/assets/icons/Arrow.tsx
@@ -1,5 +1,4 @@
-import SVGAttribute from "@/global/types/SVGAttribute.type";
-import React from "react";
+import { SVGAttribute } from "@/interfaces";
const path = {
top: "M1.66419 23.4679C2.24222 24.0457 3.02609 24.3703 3.84342 24.3703C4.66075 24.3703 5.44462 24.0457 6.02265 23.4679L21.2803 8.21018L36.538 23.4679C37.1193 24.0293 37.898 24.34 38.7061 24.333C39.5143 24.326 40.2874 24.0018 40.8589 23.4303C41.4304 22.8588 41.7546 22.0857 41.7616 21.2775C41.7686 20.4694 41.4579 19.6907 40.8965 19.1094L23.4596 1.67249C22.8815 1.09464 22.0977 0.77002 21.2803 0.77002C20.463 0.77002 19.6791 1.09464 19.1011 1.67249L1.66419 19.1094C1.08634 19.6874 0.761719 20.4713 0.761719 21.2886C0.761719 22.106 1.08634 22.8898 1.66419 23.4679Z",
diff --git a/src/page/forum-post/assets/CategoryArrow.tsx b/src/assets/icons/CategoryArrow.tsx
similarity index 92%
rename from src/page/forum-post/assets/CategoryArrow.tsx
rename to src/assets/icons/CategoryArrow.tsx
index ab189677..e6052696 100644
--- a/src/page/forum-post/assets/CategoryArrow.tsx
+++ b/src/assets/icons/CategoryArrow.tsx
@@ -1,5 +1,4 @@
-import SVGAttribute from "@/global/types/SVGAttribute.type";
-import React from "react";
+import { SVGAttribute } from "@/interfaces";
const CategoryArrow = ({
width = 12,
diff --git a/src/global/assets/svgs/Check.tsx b/src/assets/icons/Check.tsx
similarity index 94%
rename from src/global/assets/svgs/Check.tsx
rename to src/assets/icons/Check.tsx
index 21a4f691..913252f3 100644
--- a/src/global/assets/svgs/Check.tsx
+++ b/src/assets/icons/Check.tsx
@@ -1,5 +1,4 @@
-import SVGAttribute from "@/global/types/SVGAttribute.type";
-import React from "react";
+import { SVGAttribute } from "@/interfaces";
const Check = ({ width = 24, height = 24, isPointable }: SVGAttribute) => {
return (
diff --git a/src/page/forum-post/assets/CommentIcon.tsx b/src/assets/icons/CommentIcon.tsx
similarity index 91%
rename from src/page/forum-post/assets/CommentIcon.tsx
rename to src/assets/icons/CommentIcon.tsx
index 584f6c27..955454eb 100644
--- a/src/page/forum-post/assets/CommentIcon.tsx
+++ b/src/assets/icons/CommentIcon.tsx
@@ -1,5 +1,4 @@
-import SVGAttribute from "@/global/types/SVGAttribute.type";
-import React from "react";
+import { SVGAttribute } from "@/interfaces";
const CommentIcon = ({
width = 22,
diff --git a/src/global/assets/svgs/Emoji.tsx b/src/assets/icons/Emoji.tsx
similarity index 92%
rename from src/global/assets/svgs/Emoji.tsx
rename to src/assets/icons/Emoji.tsx
index d61be812..2be64c23 100644
--- a/src/global/assets/svgs/Emoji.tsx
+++ b/src/assets/icons/Emoji.tsx
@@ -1,5 +1,5 @@
import React from "react";
-import Kissing from "./emojis/Kissing";
+import { Kissing } from "./index";
const Emoji = ({ ...props }: React.ButtonHTMLAttributes) => {
const [isHover, setIsHover] = React.useState(false);
diff --git a/src/page/forum-post/assets/Like.tsx b/src/assets/icons/Like.tsx
similarity index 94%
rename from src/page/forum-post/assets/Like.tsx
rename to src/assets/icons/Like.tsx
index 8a0421f7..60ceb6ae 100644
--- a/src/page/forum-post/assets/Like.tsx
+++ b/src/assets/icons/Like.tsx
@@ -1,5 +1,4 @@
-import SVGAttribute from "@/global/types/SVGAttribute.type";
-import React from "react";
+import { SVGAttribute } from "@/interfaces";
const Like = ({ width = 50, height = 50, isPointable }: SVGAttribute) => {
return (
diff --git a/src/page/forum/assets/LikeLogo.tsx b/src/assets/icons/LikeIcon.tsx
similarity index 78%
rename from src/page/forum/assets/LikeLogo.tsx
rename to src/assets/icons/LikeIcon.tsx
index eee7a81d..8bad7197 100644
--- a/src/page/forum/assets/LikeLogo.tsx
+++ b/src/assets/icons/LikeIcon.tsx
@@ -1,7 +1,6 @@
-import SVGAttribute from "@/global/types/SVGAttribute.type";
-import React from "react";
+import { SVGAttribute } from "@/interfaces";
-const LikeLogo = ({ width = 15, height = 13, isPointable }: SVGAttribute) => {
+const LikeIcon = ({ width = 15, height = 13, isPointable }: SVGAttribute) => {
return (