handleStoreClick()}
aria-hidden
@@ -79,6 +80,7 @@ function IndexStore() {
: categories?.shop_categories.slice(0, 12).map((category) => (
category.name === '전체보기' ? (
handleStoreClick()}
aria-hidden
diff --git a/src/pages/IndexPage/components/IndexTimetable/index.tsx b/src/pages/IndexPage/components/IndexTimetable/index.tsx
index 5ff9b3d1e..71708f809 100644
--- a/src/pages/IndexPage/components/IndexTimetable/index.tsx
+++ b/src/pages/IndexPage/components/IndexTimetable/index.tsx
@@ -55,7 +55,7 @@ export default function IndexTimeTable() {
onClick={() => {
logger.actionEventClick({
actionTitle: 'USER',
- title: 'main_timetable',
+ event_label: 'main_timetable',
value: 'text',
});
}}
@@ -69,7 +69,7 @@ export default function IndexTimeTable() {
onClick={() => {
logger.actionEventClick({
actionTitle: 'USER',
- title: 'main_timetable',
+ event_label: 'main_timetable',
value: 'table',
});
}}
diff --git a/src/pages/IndexPage/index.tsx b/src/pages/IndexPage/index.tsx
index c0de54a46..a924acc85 100644
--- a/src/pages/IndexPage/index.tsx
+++ b/src/pages/IndexPage/index.tsx
@@ -1,7 +1,7 @@
import { Suspense, useEffect } from 'react';
import IndexBus from './components/IndexBus';
import IndexCafeteria from './components/IndexCafeteria';
-import IndexNotice from './components/IndexNotice';
+import IndexArticles from './components/IndexArticles';
import IndexStore from './components/IndexStore';
import IndexTimetable from './components/IndexTimetable';
import styles from './IndexPage.module.scss';
@@ -21,7 +21,7 @@ function IndexPage() {
-
+
diff --git a/src/pages/Notice/NoticeListPage/index.tsx b/src/pages/Notice/NoticeListPage/index.tsx
deleted file mode 100644
index 016a33a40..000000000
--- a/src/pages/Notice/NoticeListPage/index.tsx
+++ /dev/null
@@ -1,21 +0,0 @@
-import Pagination from 'pages/Notice/components/Pagination';
-import NoticeHeader from 'pages/Notice/components/NoticeHeader';
-import NoticeList from 'pages/Notice/components/NoticeList';
-import usePageParams from 'pages/Notice/hooks/usePageParams';
-import useArticles from 'pages/Notice/hooks/useArticles';
-import { Suspense } from 'react';
-
-export default function NoticeListPage() {
- const paramsPage = usePageParams();
- const { articles, paginationInfo } = useArticles(paramsPage);
-
- return (
- <>
-
- }>
-
-
-
- >
- );
-}
diff --git a/src/pages/Notice/NoticePage/index.tsx b/src/pages/Notice/NoticePage/index.tsx
deleted file mode 100644
index 4c9939326..000000000
--- a/src/pages/Notice/NoticePage/index.tsx
+++ /dev/null
@@ -1,28 +0,0 @@
-import { Suspense } from 'react';
-import { Outlet } from 'react-router-dom';
-import useScrollToTop from 'utils/hooks/ui/useScrollToTop';
-import LoadingSpinner from 'components/common/LoadingSpinner';
-import HotArticles from 'pages/Notice/components/HotArticle';
-import styles from './NoticePage.module.scss';
-
-export default function NoticePage() {
- useScrollToTop();
-
- return (
-
- );
-}
diff --git a/src/pages/Notice/components/ArticleHeader/index.tsx b/src/pages/Notice/components/ArticleHeader/index.tsx
deleted file mode 100644
index 1fbe0f905..000000000
--- a/src/pages/Notice/components/ArticleHeader/index.tsx
+++ /dev/null
@@ -1,38 +0,0 @@
-import setArticleRegisteredDate from 'utils/ts/setArticleRegisteredDate';
-import convertNoticeTag from 'utils/ts/convertNoticeTag';
-import useMediaQuery from 'utils/hooks/layout/useMediaQuery';
-import styles from './ArticleHeader.module.scss';
-
-interface ArticleHeaderProps {
- boardId: number
- title: string
- registeredAt: string
- author: string
- hit: number
-}
-
-export default function ArticleHeader({
- boardId, title, registeredAt, author, hit,
-}: ArticleHeaderProps) {
- const isMobile = useMediaQuery();
-
- return (
-
-
-
{convertNoticeTag(boardId)}
-
{title}
- {setArticleRegisteredDate(registeredAt)[1] && (
-
- )}
-
-
-
{isMobile ? `조회 ${hit} · ${author}` : author}
-
{registeredAt}
-
-
- );
-}
diff --git a/src/pages/Store/StoreBenefitPage/index.tsx b/src/pages/Store/StoreBenefitPage/index.tsx
index 074cd26c0..64741106c 100644
--- a/src/pages/Store/StoreBenefitPage/index.tsx
+++ b/src/pages/Store/StoreBenefitPage/index.tsx
@@ -27,7 +27,7 @@ function StoreBenefitPage() {
const onClickBenefitTab = (id: number, value :string) => {
logger.actionEventClick({
actionTitle: 'BUSINESS',
- title: 'benefit_shop_categories',
+ event_label: 'benefit_shop_categories',
value,
// eslint-disable-next-line max-len
event_category: 'click',
diff --git a/src/pages/Store/StoreDetailPage/Review/components/DeleteModal/DeleteModal.tsx b/src/pages/Store/StoreDetailPage/Review/components/DeleteModal/DeleteModal.tsx
index d8aa4ce60..2203b63cd 100644
--- a/src/pages/Store/StoreDetailPage/Review/components/DeleteModal/DeleteModal.tsx
+++ b/src/pages/Store/StoreDetailPage/Review/components/DeleteModal/DeleteModal.tsx
@@ -15,7 +15,7 @@ export default function DeleteModal({ close, deleteMyReview, storeDetail }: Prop
const loggingConfirmDeleteClick = () => {
logger.actionEventClick({
actionTitle: 'BUSINSESS',
- title: 'shop_detail_view_review_delete_done',
+ event_label: 'shop_detail_view_review_delete_done',
value: storeDetail.name,
event_category: 'click',
});
@@ -23,7 +23,7 @@ export default function DeleteModal({ close, deleteMyReview, storeDetail }: Prop
const loggingCancelDeleteClick = () => {
logger.actionEventClick({
actionTitle: 'BUSINSESS',
- title: 'shop_detail_view_review_delete_cancel',
+ event_label: 'shop_detail_view_review_delete_cancel',
value: storeDetail.name,
event_category: 'click',
});
diff --git a/src/pages/Store/StoreDetailPage/Review/components/ReviewButton/index.tsx b/src/pages/Store/StoreDetailPage/Review/components/ReviewButton/index.tsx
index 5400ec4ba..5a7c867f3 100644
--- a/src/pages/Store/StoreDetailPage/Review/components/ReviewButton/index.tsx
+++ b/src/pages/Store/StoreDetailPage/Review/components/ReviewButton/index.tsx
@@ -35,7 +35,7 @@ export default function ReviewButton({ goReviewPage }: { goReviewPage: ()=> void
const goReviewPageLogging = () => {
logger.actionEventClick({
actionTitle: 'BUSINESS',
- title: 'shop_detail_view_review_write',
+ event_label: 'shop_detail_view_review_write',
event_category: 'click',
value: storeDetail.name,
});
diff --git a/src/pages/Store/StoreDetailPage/Review/components/ReviewReporting/index.tsx b/src/pages/Store/StoreDetailPage/Review/components/ReviewReporting/index.tsx
index 928c84c7e..f3e29a267 100644
--- a/src/pages/Store/StoreDetailPage/Review/components/ReviewReporting/index.tsx
+++ b/src/pages/Store/StoreDetailPage/Review/components/ReviewReporting/index.tsx
@@ -89,7 +89,7 @@ export default function ReviewReportingPage() {
const loggingReportDone = () => {
logger.actionEventClick({
actionTitle: 'BUSINESS',
- title: 'shop_detail_view_review_report_done',
+ event_label: 'shop_detail_view_review_report_done',
value: storeDetail.name,
event_category: 'click',
});
diff --git a/src/pages/Store/StoreDetailPage/Review/components/SelectButton/SelectButton.tsx b/src/pages/Store/StoreDetailPage/Review/components/SelectButton/SelectButton.tsx
index 167f97300..24bd1a04d 100644
--- a/src/pages/Store/StoreDetailPage/Review/components/SelectButton/SelectButton.tsx
+++ b/src/pages/Store/StoreDetailPage/Review/components/SelectButton/SelectButton.tsx
@@ -36,7 +36,7 @@ export default function SelectButton({ is_mine, review_id, is_reported }: Props)
const openDeleteModal = () => {
logger.actionEventClick({
actionTitle: 'BUSINESS',
- title: 'shop_detail_view_review_delete',
+ event_label: 'shop_detail_view_review_delete',
value: storeDetail.name,
event_category: 'click',
});
@@ -66,7 +66,7 @@ export default function SelectButton({ is_mine, review_id, is_reported }: Props)
const loggingReportClick = () => {
logger.actionEventClick({
actionTitle: 'BUSINESS',
- title: 'shop_detail_view_review_report',
+ event_label: 'shop_detail_view_review_report',
value: storeDetail.name,
event_category: 'click',
});
diff --git a/src/pages/Store/StoreDetailPage/index.tsx b/src/pages/Store/StoreDetailPage/index.tsx
index 51b2b76c1..d3e78e033 100644
--- a/src/pages/Store/StoreDetailPage/index.tsx
+++ b/src/pages/Store/StoreDetailPage/index.tsx
@@ -57,7 +57,7 @@ function StoreDetailPage() {
if (!sessionStorage.getItem('enter_storeDetail')) {
logger.actionEventClick({
actionTitle: 'AB_TEST',
- title: 'BUSINESS_call_1',
+ event_label: 'BUSINESS_call_1',
value: testValue === 'call_number' ? 'number' : 'floating',
event_category: 'a/b test 로깅(전화하기)',
});
@@ -83,7 +83,7 @@ function StoreDetailPage() {
if (param.get('state') === '리뷰' && sessionStorage.getItem('enterReviewPage')) {
logger.actionEventClick({
actionTitle: 'BUSINESS',
- title: 'shop_detail_view_review_back',
+ event_label: 'shop_detail_view_review_back',
value: '',
event_category: 'click',
previous_page: '리뷰',
@@ -93,7 +93,7 @@ function StoreDetailPage() {
}
logger.actionEventClick({
actionTitle: 'BUSINESS',
- title: `${storeType}_call`,
+ event_label: `${storeType}_call`,
value: storeDetail!.name,
event_category: 'click',
duration_time: (new Date().getTime() - Number(sessionStorage.getItem('enter_storeDetail'))) / 1000,
@@ -102,7 +102,7 @@ function StoreDetailPage() {
const onClickImage = (img: string[], index: number) => {
logger.actionEventClick({
- actionTitle: 'BUSINESS', title: 'shop_picture', value: storeDetail!.name, event_category: 'click',
+ actionTitle: 'BUSINESS', event_label: 'shop_picture', value: storeDetail!.name, event_category: 'click',
});
portalManager.open((portalOption: Portal) => (
@@ -112,7 +112,7 @@ function StoreDetailPage() {
if (param.get('state') === '리뷰' && sessionStorage.getItem('enterReviewPage')) {
logger.actionEventClick({
actionTitle: 'BUSINESS',
- title: 'shop_detail_view_review_back',
+ event_label: 'shop_detail_view_review_back',
value: storeDetail.name,
event_category: 'click',
previous_page: '리뷰',
@@ -121,17 +121,17 @@ function StoreDetailPage() {
});
}
logger.actionEventClick({
- actionTitle: 'BUSINESS', title: 'shop_detail_view_back', value: storeDetail!.name, event_category: 'ShopList', current_page: sessionStorage.getItem('cameFrom') || '전체보기', duration_time: (new Date().getTime() - Number(sessionStorage.getItem('enter_storeDetail'))) / 1000,
+ actionTitle: 'BUSINESS', event_label: 'shop_detail_view_back', value: storeDetail!.name, event_category: 'ShopList', current_page: sessionStorage.getItem('cameFrom') || '전체보기', duration_time: (new Date().getTime() - Number(sessionStorage.getItem('enter_storeDetail'))) / 1000,
});
};
const onClickEventList = () => {
logger.actionEventClick({
- actionTitle: 'BUSINESS', title: 'shop_detail_view_event', value: `${storeDetail.name}`, event_category: 'click',
+ actionTitle: 'BUSINESS', event_label: 'shop_detail_view_event', value: `${storeDetail.name}`, event_category: 'click',
});
};
const onClickReviewList = () => {
logger.actionEventClick({
- actionTitle: 'BUSINESS', title: 'shop_detail_view_review', value: `${storeDetail.name}`, event_category: 'click',
+ actionTitle: 'BUSINESS', event_label: 'shop_detail_view_review', value: `${storeDetail.name}`, event_category: 'click',
});
};
const copyAccount = async (account: string) => {
@@ -142,17 +142,17 @@ function StoreDetailPage() {
const detailScrollLogging = () => {
if ((param.get('state') === '메뉴' || !param.get('state'))) {
logger.actionEventClick({
- actionTitle: 'BUSINESS', title: 'shop_detail_view', value: storeDetail.name, event_category: 'scroll',
+ actionTitle: 'BUSINESS', event_label: 'shop_detail_view', value: storeDetail.name, event_category: 'scroll',
});
}
if (param.get('state') === '이벤트/공지') {
logger.actionEventClick({
- actionTitle: 'BUSINESS', title: 'shop_detail_view_event', value: storeDetail.name, event_category: 'scroll',
+ actionTitle: 'BUSINESS', event_label: 'shop_detail_view_event', value: storeDetail.name, event_category: 'scroll',
});
}
if (param.get('state') === '리뷰') {
logger.actionEventClick({
- actionTitle: 'BUSINESS', title: 'shop_detail_view_review', value: storeDetail.name, event_category: 'scroll',
+ actionTitle: 'BUSINESS', event_label: 'shop_detail_view_review', value: storeDetail.name, event_category: 'scroll',
});
}
};
@@ -167,7 +167,7 @@ function StoreDetailPage() {
if (sessionStorage.getItem('enterReviewPage')) {
logger.actionEventClick({
actionTitle: 'BUSINESS',
- title: 'shop_detail_view_review_back',
+ event_label: 'shop_detail_view_review_back',
value: storeDetail.name,
event_category: 'click',
previous_page: '리뷰',
@@ -190,7 +190,7 @@ function StoreDetailPage() {
const handlePopState = () => {
logger.actionEventClick({
actionTitle: 'BUSINESS',
- title: 'shop_detail_view_back',
+ event_label: 'shop_detail_view_back',
value: storeDetail.name,
event_category: 'swipe',
current_page: sessionStorage.getItem('cameFrom') || '전체보기',
@@ -366,7 +366,7 @@ function StoreDetailPage() {
param.set('state', '메뉴');
setParam(param, { replace: true });
logger.actionEventClick({
- actionTitle: 'BUSINESS', title: 'shop_detail_view', value: storeDetail!.name, event_category: 'click',
+ actionTitle: 'BUSINESS', event_label: 'shop_detail_view', value: storeDetail!.name, event_category: 'click',
});
}}
>
diff --git a/src/pages/Store/StorePage/components/DesktopStoreList/index.tsx b/src/pages/Store/StorePage/components/DesktopStoreList/index.tsx
index 8dea30027..16a2ce377 100644
--- a/src/pages/Store/StorePage/components/DesktopStoreList/index.tsx
+++ b/src/pages/Store/StorePage/components/DesktopStoreList/index.tsx
@@ -43,7 +43,7 @@ export default function DesktopStoreList(storeListProps: StoreListProps) {
className={styles['store-list__item']}
key={store.id}
onClick={() => logger.actionEventClick({
- actionTitle: 'BUSINESS', title: `${storeType}_click`, value: store.name, event_category: 'click', previous_page: `${koreanCategory || '전체보기'}`, current_page: `${store.name}`, duration_time: (new Date().getTime() - Number(sessionStorage.getItem('enter_category'))) / 1000,
+ actionTitle: 'BUSINESS', event_label: `${storeType}_click`, value: store.name, event_category: 'click', previous_page: `${koreanCategory || '전체보기'}`, current_page: `${store.name}`, duration_time: (new Date().getTime() - Number(sessionStorage.getItem('enter_category'))) / 1000,
})}
>
{store.is_event
diff --git a/src/pages/Store/StorePage/components/EventCarousel/index.tsx b/src/pages/Store/StorePage/components/EventCarousel/index.tsx
index fa69dc810..181894afc 100644
--- a/src/pages/Store/StorePage/components/EventCarousel/index.tsx
+++ b/src/pages/Store/StorePage/components/EventCarousel/index.tsx
@@ -78,7 +78,7 @@ function EventCarousel() {
const logger = useLogger();
const eventLogging = (shopName: string) => {
logger.actionEventClick({
- actionTitle: 'BUSINESS', title: 'shop_categories_event', value: `${shopName}`, event_category: 'click',
+ actionTitle: 'BUSINESS', event_label: 'shop_categories_event', value: `${shopName}`, event_category: 'click',
});
};
diff --git a/src/pages/Store/StorePage/components/MobileStoreList/index.tsx b/src/pages/Store/StorePage/components/MobileStoreList/index.tsx
index 4cc9af2eb..78571d901 100644
--- a/src/pages/Store/StorePage/components/MobileStoreList/index.tsx
+++ b/src/pages/Store/StorePage/components/MobileStoreList/index.tsx
@@ -38,7 +38,7 @@ export default function MobileStoreList(mobileStoreListProps: MobileStoreListPro
className={styles['store-list__item']}
key={store.id}
onClick={() => logger.actionEventClick({
- actionTitle: 'BUSINESS', title: `${storeType}_click`, value: store.name, event_category: 'click', previous_page: `${koreanCategory || '전체보기'}`, current_page: `${store.name}`, duration_time: (new Date().getTime() - Number(sessionStorage.getItem('enter_category'))) / 1000,
+ actionTitle: 'BUSINESS', event_label: `${storeType}_click`, value: store.name, event_category: 'click', previous_page: `${koreanCategory || '전체보기'}`, current_page: `${store.name}`, duration_time: (new Date().getTime() - Number(sessionStorage.getItem('enter_category'))) / 1000,
})}
>
{store.is_event
diff --git a/src/pages/Store/StorePage/components/SearchBar/index.tsx b/src/pages/Store/StorePage/components/SearchBar/index.tsx
index c651cdf7f..214c6d533 100644
--- a/src/pages/Store/StorePage/components/SearchBar/index.tsx
+++ b/src/pages/Store/StorePage/components/SearchBar/index.tsx
@@ -27,7 +27,7 @@ export default function SearchBar() {
onClick={() => {
if (!isMobile) setToggle(false);
const currentCategoryId = Number(params.category) - 1; // 검색창에 포커스되면 로깅
- if (categories) logger.actionEventClick({ actionTitle: 'BUSINESS', title: 'shop_categories_search', value: `search in ${categories.shop_categories[currentCategoryId]?.name || '전체보기'}` });
+ if (categories) logger.actionEventClick({ actionTitle: 'BUSINESS', event_label: 'shop_categories_search', value: `search in ${categories.shop_categories[currentCategoryId]?.name || '전체보기'}` });
openModal();
}}
>
diff --git a/src/pages/Store/StorePage/components/SearchBarModal/index.tsx b/src/pages/Store/StorePage/components/SearchBarModal/index.tsx
index 3edc20643..ca91b386d 100644
--- a/src/pages/Store/StorePage/components/SearchBarModal/index.tsx
+++ b/src/pages/Store/StorePage/components/SearchBarModal/index.tsx
@@ -67,7 +67,7 @@ export default function SearchBarModal({ onClose }:SearchBarModalProps) {
})}
onFocus={() => {
const currentCategoryId = Number(params.category) - 1; // 검색창에 포커스되면 로깅
- if (categories) logger.actionEventClick({ actionTitle: 'BUSINESS', title: 'shop_categories_search', value: `search in ${categories.shop_categories[currentCategoryId]?.name || '전체보기'}` });
+ if (categories) logger.actionEventClick({ actionTitle: 'BUSINESS', event_label: 'shop_categories_search', value: `search in ${categories.shop_categories[currentCategoryId]?.name || '전체보기'}` });
}}
/>
리뷰와 관련된 사진을 업로드해주세요.
diff --git a/src/pages/TimetablePage/MainTimetablePage/DefaultPage/index.tsx b/src/pages/TimetablePage/MainTimetablePage/DefaultPage/index.tsx
index 4607cbc4c..ed3826458 100644
--- a/src/pages/TimetablePage/MainTimetablePage/DefaultPage/index.tsx
+++ b/src/pages/TimetablePage/MainTimetablePage/DefaultPage/index.tsx
@@ -20,7 +20,7 @@ export default function DefaultPage({ frameId, setCurrentFrameId }: DefaultPageP
if (sessionStorage.getItem('swipeToBack') === 'true') {
logger.actionEventSwipe({
actionTitle: 'USER',
- title: 'timetable_back',
+ event_label: 'timetable_back',
value: 'OS스와이프',
previous_page: '시간표',
current_page: '메인',
@@ -31,7 +31,7 @@ export default function DefaultPage({ frameId, setCurrentFrameId }: DefaultPageP
// 브라우저의 뒤로가기 버튼 클릭 시 / 마우스 사이드 버튼 누를 시
logger.actionEventClick({
actionTitle: 'USER',
- title: 'timetable_back',
+ event_label: 'timetable_back',
value: '뒤로가기버튼',
previous_page: '시간표',
current_page: '메인',
diff --git a/src/pages/TimetablePage/components/Curriculum/index.tsx b/src/pages/TimetablePage/components/Curriculum/index.tsx
index 1aee6b9a0..fea621d21 100644
--- a/src/pages/TimetablePage/components/Curriculum/index.tsx
+++ b/src/pages/TimetablePage/components/Curriculum/index.tsx
@@ -24,7 +24,7 @@ function Curriculum({ list }: CurriculumListBoxProps) {
const onClickOption = (dept: string) => {
logger.actionEventClick({
actionTitle: 'USER',
- title: 'timetable',
+ event_label: 'timetable',
value: `click_currirculum_${dept}`,
});
closePopup();
diff --git a/src/pages/TimetablePage/components/LectureList/index.tsx b/src/pages/TimetablePage/components/LectureList/index.tsx
index c903c7244..705ec6196 100644
--- a/src/pages/TimetablePage/components/LectureList/index.tsx
+++ b/src/pages/TimetablePage/components/LectureList/index.tsx
@@ -231,7 +231,7 @@ function LectureList({ frameId }: { frameId: number }) {
onClickSearchButton();
logger.actionEventClick({
actionTitle: 'USER',
- title: 'timetable',
+ event_label: 'timetable',
value: 'search',
});
}}
diff --git a/src/pages/TimetablePage/components/MainTimetable/index.tsx b/src/pages/TimetablePage/components/MainTimetable/index.tsx
index 5a3d29467..0f216491d 100644
--- a/src/pages/TimetablePage/components/MainTimetable/index.tsx
+++ b/src/pages/TimetablePage/components/MainTimetable/index.tsx
@@ -51,7 +51,7 @@ function MainTimetable({ frameId }: { frameId: number }) {
if (isSemesterAndTimetableExist()) {
logger.actionEventClick({
actionTitle: 'USER',
- title: 'timetable',
+ event_label: 'timetable',
value: '이미지저장',
duration_time:
(new Date().getTime() - Number(sessionStorage.getItem('enterTimetablePage'))) / 1000,
diff --git a/src/pages/TimetablePage/components/SemesterList/index.tsx b/src/pages/TimetablePage/components/SemesterList/index.tsx
index 138742908..fb8bcd536 100644
--- a/src/pages/TimetablePage/components/SemesterList/index.tsx
+++ b/src/pages/TimetablePage/components/SemesterList/index.tsx
@@ -44,7 +44,7 @@ function SemesterList() {
const onClickOption = (clickededSemester: Semester) => {
updateSemester(clickededSemester);
- logger.actionEventClick({ actionTitle: 'USER', title: 'timetable', value: `click_semester_${clickededSemester.year}${clickededSemester.term}` });
+ logger.actionEventClick({ actionTitle: 'USER', event_label: 'timetable', value: `click_semester_${clickededSemester.year}${clickededSemester.term}` });
closePopup();
};
diff --git a/src/static/category.ts b/src/static/category.ts
index 7353144d3..0a1d5e957 100644
--- a/src/static/category.ts
+++ b/src/static/category.ts
@@ -1,4 +1,6 @@
-export type SubmenuTitle = '공지사항' | '버스' | '버스 시간표' | '식단' | '시간표' | '복덕방' | '주변상점' | '교내 시설물 정보' | '코인 사장님' | '리뷰 작성하기' | '리뷰 수정하기' | '리뷰 신고하기' | '전화 주문 혜택';// 헤더에 리뷰 신고하기 제목 추가
+import ROUTES from './routes';
+
+export type SubmenuTitle = '공지사항' | '버스 교통편' | '버스 시간표' | '식단' | '시간표' | '복덕방' | '주변상점' | '교내 시설물 정보' | '코인 사장님' | '리뷰 작성하기' | '리뷰 수정하기' | '리뷰 신고하기' | '전화 주문 혜택';
export interface Submenu {
title: SubmenuTitle;
@@ -18,63 +20,63 @@ export interface Category {
submenu: Submenu[]
}
-export const CATEGORY: Category[] = [
+export const CATEGORY = [
{
title: '서비스',
planFlag: false,
submenu: [
{
title: '공지사항',
- link: '/board/notice',
+ link: ROUTES.Articles(),
newFlag: false,
planFlag: false,
tag: null,
},
{
- title: '버스',
- link: '/bus/route',
+ title: '버스 교통편',
+ link: ROUTES.BusRoute(),
newFlag: false,
planFlag: false,
tag: null,
},
{
title: '버스 시간표',
- link: '/bus/course',
+ link: ROUTES.BusCourse(),
newFlag: false,
planFlag: false,
tag: null,
},
{
title: '식단',
- link: '/cafeteria',
+ link: ROUTES.Cafeteria(),
newFlag: false,
planFlag: false,
tag: null,
},
{
title: '시간표',
- link: '/timetable',
+ link: ROUTES.Timetable(),
newFlag: false,
planFlag: false,
tag: null,
},
{
title: '복덕방',
- link: '/room',
+ link: ROUTES.Room(),
newFlag: false,
planFlag: false,
tag: null,
},
{
title: '주변상점',
- link: '/store',
+ link: ROUTES.Store(),
newFlag: false,
planFlag: false,
tag: null,
},
{
title: '교내 시설물 정보',
- link: '/campusinfo',
+ link: ROUTES.CampusInfo(),
newFlag: false,
planFlag: false,
tag: null,
@@ -104,7 +106,7 @@ export const CATEGORY: Category[] = [
},
{
title: '리뷰 신고하기',
- link: '/report/review', // 리뷰 신고하기 제목을 위한 추가
+ link: '/report/review',
newFlag: false,
planFlag: false,
tag: null,
@@ -116,130 +118,6 @@ export const CATEGORY: Category[] = [
planFlag: false,
tag: null,
},
- // {
- // title: "FAQ",
- // link: "/faq",
- // newFlag: false,
- // planFlag: false,
- // tag: null
- // },
- // {
- // title: "동아리",
- // link: "/circle",
- // newFlag: false,
- // planFlag: false,
- // tag: null
- // },
- ],
- },
- /* {
- title: '공지사항',
- planFlag: false,
- submenu: [
- {
- title: "자유게시판",
- link: "/board/free",
- tag: 1,
- newFlag: false,
- planFlag: false
- },
- {
- title: "취업게시판",
- link: "/board/job",
- newFlag: false,
- tag: 2,
- planFlag: false
- },
- {
- title: "익명게시판",
- tag: -1, //원래 3
- link: "/board/anonymous",
- newFlag: false,
- planFlag: false
- },
- {
- title: "질문게시판",
- tag: 10,
- link: "/board/question",
- newFlag: false,
- planFlag: false
- },
- {
- title: '분실물',
- tag: 5,
- link: '/lost',
- newFlag: false,
- planFlag: false
- },
- {
- title: '홍보게시판',
- tag: 6,
- link: '/board/promotion',
- newFlag: true,
- planFlag: false
- }
],
},
- {
- 'title': '평가시스템',
- 'planFlag': true,
- 'submenu': [
- {
- 'title': '교수 평가',
- 'tag': null,
- 'link': '',
- 'newFlag': false,
- 'planFlag': true
- },
- {
- 'title': '강의 평가',
- 'tag': null,
- 'link': '',
- 'newFlag': false,
- 'planFlag': true
- }
- ]
- },
- {
- title: "중고장터",
- newFlag: false,
- planFlag: false,
- submenu: [
- {
- title: "팝니다",
- tag: null,
- link: "/market/sell",
- newFlag: false,
- planFlag: false
- },
- {
- title: "삽니다",
- tag: null,
- link: "/market/buy",
- newFlag: false,
- planFlag: false
- }
- ]
- },
- {
- 'title': '부동산',
- 'planFlag': true,
- 'submenu': [
- {
- 'title': '원룸정보',
- 'tag': null,
- 'link': 'room-list',
- 'newFlag': false,
- 'planFlag': false
- },
- {
- 'title': '거래게시판',
- 'tag': null,
- 'link': '',
- 'newFlag': false,
- 'planFlag': true
- }
- ]
- }
- */
];
diff --git a/src/static/routes.ts b/src/static/routes.ts
index d7ea1a84c..43174cf3c 100644
--- a/src/static/routes.ts
+++ b/src/static/routes.ts
@@ -21,8 +21,11 @@ const ROUTES = {
BusRoute: () => '/bus/route',
BusCourse: () => '/bus/course',
Cafeteria: () => '/cafeteria',
- BoardNotice: () => '/board/notice',
- BoardNoticeDetail: ({ id, isLink }: ROUTESParams<'id'>) => (isLink ? `/board/notice/${id}` : '/board/notice/:id'),
+ Articles: () => '/articles',
+ ArticlesDetail: ({ id, isLink }: ROUTESParams<'id'>) => (isLink ? `/articles/${id}` : '/articles/:id'),
+ LostItemDetail: ({ id, isLink }: ROUTESParams<'id'>) => (isLink ? `/articles/lost-item/${id}` : '/articles/lost-item/:id'),
+ LostItemFound: () => '/lost-item/found',
+ LostItemLost: () => '/lost-item/lost',
Room: () => '/room',
RoomDetail: ({ id, isLink }: ROUTESParams<'id'>) => (isLink ? `/room/${id}` : '/room/:id'),
CampusInfo: () => '/campusinfo',
diff --git a/src/utils/hooks/analytics/useLogger.ts b/src/utils/hooks/analytics/useLogger.ts
index e0189c3cb..b35e97acd 100644
--- a/src/utils/hooks/analytics/useLogger.ts
+++ b/src/utils/hooks/analytics/useLogger.ts
@@ -12,7 +12,7 @@ type ScrollLoggerProps = {
type ActionLoggerProps = {
actionTitle: string,
- title: string,
+ event_label: string,
value: string,
event_category?: string,
previous_page?: string,
@@ -23,7 +23,7 @@ type ActionLoggerProps = {
type LoggerEventProps = {
action: string,
category: string,
- label: string,
+ event_label: string,
value: string,
duration_time?: number,
previous_page?: string,
@@ -36,14 +36,14 @@ const useLogger = () => {
const logEvent = ({
action,
category,
- label,
+ event_label,
value,
duration_time,
previous_page,
current_page,
}: LoggerEventProps) => {
const event = {
- action, category, label, value, duration_time, previous_page, current_page,
+ action, category, event_label, value, duration_time, previous_page, current_page,
};
gtag.event(event);
prevEvent.current = event;
@@ -54,21 +54,21 @@ const useLogger = () => {
value,
} : ClickLoggerProps) => {
logEvent({
- action: 'click', category: 'click', label: title, value,
+ action: 'click', category: 'click', event_label: title, value,
});
};
const scroll = ({
- title,
+ title: event_label,
}: ScrollLoggerProps) => {
logEvent({
- action: 'scroll', category: 'BUSINESS', label: title, value: title,
+ action: 'scroll', category: 'BUSINESS', event_label, value: event_label,
});
};
const actionEventClick = ({
actionTitle,
- title,
+ event_label,
value,
duration_time,
previous_page,
@@ -76,20 +76,20 @@ const useLogger = () => {
event_category,
}: ActionLoggerProps) => {
logEvent({
- action: actionTitle, category: event_category || 'click', label: title, value, duration_time, previous_page, current_page,
+ action: actionTitle, category: event_category || 'click', event_label, value, duration_time, previous_page, current_page,
});
};
const actionEventSwipe = ({
actionTitle,
- title,
+ event_label,
value,
duration_time,
previous_page,
current_page,
}: ActionLoggerProps) => {
logEvent({
- action: actionTitle, category: 'swipe', label: title, value, duration_time, previous_page, current_page,
+ action: actionTitle, category: 'swipe', event_label, value, duration_time, previous_page, current_page,
});
};
diff --git a/src/utils/hooks/ui/useImageUpload.ts b/src/utils/hooks/ui/useImageUpload.ts
index 61a8500e9..331c5e43f 100644
--- a/src/utils/hooks/ui/useImageUpload.ts
+++ b/src/utils/hooks/ui/useImageUpload.ts
@@ -1,15 +1,23 @@
-import { uploadFile } from 'api/review'; // import the function from the API file
import { useRef, useState } from 'react';
import showToast from 'utils/ts/showToast';
import useTokenState from 'utils/hooks/state/useTokenState';
+import { uploadLostItemFile, uploadShopFile } from 'api/uploadFile';
// 정의할 수 있는 에러 타입
export type UploadError = '413' | '415' | '404' | '422' | 'networkError' | '401' | '';
const MAXSIZE = 1024 * 1024 * 10;
+interface UseImageUploadOptions {
+ maxLength?: number;
+ uploadFn: typeof uploadShopFile | typeof uploadLostItemFile;
+}
+
/* eslint-disable */
-export default function useImageUpload() {
+export default function useImageUpload({
+ maxLength = 3,
+ uploadFn,
+}: UseImageUploadOptions) {
const token = useTokenState();
const [imageFile, setImageFile] = useState
([]);
const [uploadError, setUploadError] = useState('');
@@ -18,56 +26,59 @@ export default function useImageUpload() {
const saveImgFile = async () => {
const files = imgRef.current?.files;
// imageFile.length + files.length을 통해 저장된 이미지 + 새로 추가할 이미지의 개수를 파악함
- if (files && (imageFile.length + files.length > 3)) {
- showToast('error', '파일은 3개까지 등록할 수 있습니다.')
+ if (files && (imageFile.length + files.length > maxLength)) {
+ showToast('error', `파일은 ${maxLength}개까지 등록할 수 있습니다.`)
return;
}
- if (files && files.length) {
- const uploadedFile: string[] = [...imageFile];
- const correctForm = new RegExp('(.*?)\\.(jpg|jpeg|gif|bmp|png)$');
+ if (!files || !files.length) return;
- for (let i = 0; i < files.length; i += 1) {
- const file = files[i];
+ const uploadedFile: string[] = [...imageFile];
+ const correctForm = new RegExp('(.*?)\\.(jpg|jpeg|gif|bmp|png|JPG|JPEG|GIF|BMP|PNG)$');
- if (file.size > MAXSIZE) {
- setUploadError('413'); // 파일 사이즈가 너무 큰 경우
- return;
- }
+ for (let i = 0; i < files.length; i += 1) {
+ const file = files[i];
- if (!correctForm.test(file.name)) {
- setUploadError('415'); // 지원하지 않는 타입 에러
- return;
- }
+ if (file.size > MAXSIZE) {
+ setUploadError('413'); // 파일 사이즈가 너무 큰 경우
+ return;
+ }
- const formData = new FormData();
- formData.append('multipartFile', file);
+ if (!correctForm.test(file.name)) {
+ setUploadError('415'); // 지원하지 않는 타입 에러
+ return;
+ }
+
+ const formData = new FormData();
+ formData.append('multipartFile', file);
- try {
- const data = await uploadFile(token, formData);
- if (data.file_url) {
- uploadedFile.push(data.file_url);
- }
- } catch (error: any) {
- setImageFile([]);
- const errorMessage = error.toString();
- if (errorMessage.includes('415')) {
- setUploadError('415');
- } else if (errorMessage.includes('404')) {
- setUploadError('404');
- } else if (errorMessage.includes('422')) {
- setUploadError('422');
- } else if (errorMessage.includes('Network Error')) {
- setUploadError('networkError');
- } else {
- setUploadError('401');
- }
- return;
+ try {
+ const data = await uploadFn(token, formData);
+ if (data.file_url) {
+ uploadedFile.push(data.file_url);
+ }
+ } catch (error: any) {
+ setImageFile([]);
+ const errorMessage = error.toString();
+ if (errorMessage.includes('415')) {
+ setUploadError('415');
+ } else if (errorMessage.includes('404')) {
+ setUploadError('404');
+ } else if (errorMessage.includes('422')) {
+ setUploadError('422');
+ } else if (errorMessage.includes('Network Error')) {
+ setUploadError('networkError');
+ } else {
+ setUploadError('401');
}
+ return;
}
- setImageFile(uploadedFile);
- setUploadError('');
}
+
+ setImageFile(uploadedFile);
+ setUploadError('');
+
+ return uploadedFile;
};
return {
diff --git a/src/utils/ts/convertArticlesTag.ts b/src/utils/ts/convertArticlesTag.ts
new file mode 100644
index 000000000..23cb3d20f
--- /dev/null
+++ b/src/utils/ts/convertArticlesTag.ts
@@ -0,0 +1,47 @@
+export const convertArticlesTag = (type: number) => {
+ switch (type) {
+ case 1:
+ return '[자유게시판]';
+ case 2:
+ return '[취업게시판]';
+ case 3:
+ return '[익명게시판]';
+ case 4:
+ return '[공지사항]';
+ case 5:
+ return '[일반공지]';
+ case 6:
+ return '[장학공지]';
+ case 7:
+ return '[학사공지]';
+ case 8:
+ return '[취업공지]';
+ case 9:
+ return '[코인공지]';
+ case 12:
+ return '[현장실습]';
+ case 13:
+ return '[학생생활]';
+ case 14:
+ return '[분실물]';
+ default:
+ return '[공지사항]';
+ }
+};
+
+export const BOARD_IDS = {
+ // 전체 공지 + 분실물 조회 시 필드를 없앰 ...articles?boardId=${BOARD_IDS.전체공지}&page...
+ 자유게시판: 1,
+ 취업게시판: 2,
+ 익명게시판: 3,
+ 공지사항: 4, // 전체 공지 조회 시 사용
+ 일반공지: 5,
+ 장학공지: 6,
+ 학사공지: 7,
+ 취업공지: 8,
+ 코인공지: 9,
+ 질문게시판: 10,
+ 홍보게시판: 11,
+ 현장실습: 12,
+ 학생생활: 13,
+} as const;
diff --git a/src/utils/ts/convertNoticeTag.ts b/src/utils/ts/convertNoticeTag.ts
deleted file mode 100644
index 763c0d04f..000000000
--- a/src/utils/ts/convertNoticeTag.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-function convertNoticeTag(type: number) {
- switch (type) {
- case 5:
- return '[일반공지]';
- case 6:
- return '[장학공지]';
- case 7:
- return '[학사공지]';
- case 8:
- return '[취업공지]';
- case 9:
- return '[코인공지]';
- case 12:
- return '[현장실습]';
- case 13:
- return '[학생생활]';
- default:
- return '[공지사항]';
- }
-}
-
-export default convertNoticeTag;