Skip to content

Commit

Permalink
Merge branch 'main' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
(hoooooony) committed Oct 10, 2024
2 parents cdb4274 + 378d60a commit 48f9077
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/components/common/Footer/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Link } from 'react-router-dom';
import { Link, useLocation } from 'react-router-dom';
import { CATEGORY } from 'static/category';
import useLogger from 'utils/hooks/analytics/useLogger';
import useMediaQuery from 'utils/hooks/layout/useMediaQuery';
Expand All @@ -7,6 +7,8 @@ import styles from './Footer.module.scss';
function Footer(): JSX.Element {
const isMobile = useMediaQuery();
const logger = useLogger();
const { pathname } = useLocation();
const isStage = pathname.includes('stage');
const logShortcut = (title: string) => {
if (title === '식단') logger.actionEventClick({ actionTitle: 'CAMPUS', title: 'footer', value: '식단' });
if (title === '버스/교통') logger.actionEventClick({ actionTitle: 'CAMPUS', title: 'footer', value: '버스/교통' });
Expand All @@ -25,7 +27,10 @@ function Footer(): JSX.Element {
.flatMap((categoryInfo) => categoryInfo.submenu)
.slice(0, -3).map((submenuInfo) => (
<li className={styles.footer__service} key={submenuInfo.title}>
<Link to={submenuInfo.link} onClick={() => logShortcut(submenuInfo.title)}>
<Link
to={isStage && submenuInfo.stageLink ? submenuInfo.stageLink : submenuInfo.link}
onClick={() => logShortcut(submenuInfo.title)}
>
{submenuInfo.title}
</Link>
</li>
Expand Down
2 changes: 2 additions & 0 deletions src/static/category.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export interface Submenu {
planFlag: boolean;
tag: number | null;
openInNewTab?: boolean;
stageLink?:string;
}

export type CategoryTitle = '서비스';
Expand Down Expand Up @@ -78,6 +79,7 @@ export const CATEGORY: Category[] = [
planFlag: false,
tag: null,
openInNewTab: true,
stageLink: 'https://owner.stage.koreatech.in',
},
{
title: '리뷰 작성하기',
Expand Down

0 comments on commit 48f9077

Please sign in to comment.