Skip to content

Commit

Permalink
✨ 좌상단 로고 클릭 시 메인 페이지 이동
Browse files Browse the repository at this point in the history
  • Loading branch information
RookieAND committed Mar 2, 2024
1 parent c1ab56b commit 5432d2e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ export const wrapper = style([
},
]);

export const audyLogo = style({
cursor: 'pointer',
})

export const leftContainer = style({
display: 'flex',
alignItems: 'center',
Expand Down
12 changes: 10 additions & 2 deletions src/components/global-navigation-bar/GlobalNavigationBar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useEffect, useState } from 'react';

import { useLocation } from 'react-router-dom';
import { useLocation, useNavigate } from 'react-router-dom';

import AudyLogoIcon from '@/assets/icons/audyLogo.svg?react';
import SettingIcon from '@/assets/icons/setting.svg?react';
Expand All @@ -16,6 +16,7 @@ import * as S from './GlobalNavigationBar.css';
const GlobalNavigationBar = () => {
const { pathname } = useLocation();
const { openModal } = useModal();
const navigate = useNavigate();

const [isSaving, setIsSaving] = useState(false);

Expand Down Expand Up @@ -50,10 +51,17 @@ const GlobalNavigationBar = () => {
};
}, []);

const handleAudyLogoClick = () => {
navigate('/');
};

return (
<div className={S.wrapper}>
<div className={S.leftContainer}>
<AudyLogoIcon />
<AudyLogoIcon
className={S.audyLogo}
onClick={handleAudyLogoClick}
/>
{isSaving && (
<p className={S.savingStatus}>수정된 코스 저장중...</p>
)}
Expand Down

0 comments on commit 5432d2e

Please sign in to comment.