Skip to content
Closed
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
18 changes: 15 additions & 3 deletions src/component/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Menu, User } from 'react-feather';
import { useNavigate } from 'react-router-dom';
import Logo from '../image/Logo.png';
import Logo from '../image/Logo.svg';

type HeaderProps = {
onMenuClick: () => void;
Expand All @@ -9,11 +9,23 @@ type HeaderProps = {
export default function Header({ onMenuClick }: HeaderProps) {
const navigate = useNavigate();

const handleUserClick = () => {
const token = localStorage.getItem('accessToken'); // ✅ 로그인 여부 확인
if (token) {
navigate('/mypage'); // 로그인 → 마이페이지
} else {
navigate('/login'); // 비로그인 → 로그인 페이지
}
};

return (
<header className="bg-beige3 fixed top-0 right-0 left-0 z-50 mx-auto flex h-14 w-full max-w-[430px] items-center justify-between">
<div className="flex w-full flex-row items-center justify-between px-4 py-3">
{/* 왼쪽: 메뉴(햄버거) 아이콘 */}
<Menu className="h-7 w-7 cursor-pointer text-green-700" onClick={onMenuClick} />
<Menu
className="h-7 w-7 cursor-pointer text-green-700"
onClick={onMenuClick}
/>

{/* 가운데: 로고 이미지 */}
<div className="flex flex-1 justify-center">
Expand All @@ -28,7 +40,7 @@ export default function Header({ onMenuClick }: HeaderProps) {
{/* 오른쪽: 사람 아이콘 */}
<User
className="h-7 w-7 cursor-pointer text-green-700"
onClick={() => navigate('/mypage')}
onClick={handleUserClick} // ✅ 조건부 이동
/>
</div>
</header>
Expand Down
6 changes: 6 additions & 0 deletions src/constants/MyTravel.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export const TRAVEL_ITEMS = [
{ id: 1, title: '행궁동', tranquil: true, type: '자연관광지', likes: 3 },
{ id: 2, title: '행궁동', tranquil: true, type: '자연관광지', likes: 3 },
{ id: 3, title: '행궁동', tranquil: true, type: '자연관광지', likes: 3 },
{ id: 4, title: '행궁동', tranquil: true, type: '자연관광지', likes: 3 },
];
3 changes: 3 additions & 0 deletions src/image/Finish.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/image/Logo.png
Binary file not shown.
2 changes: 2 additions & 0 deletions src/image/Logo.png.url
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[InternetShortcut]
URL=https://github.com/SoomTeum/frontend/blob/develop/src/image/Logo.png
9 changes: 9 additions & 0 deletions src/image/Logo.svg
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요건 혹시 왜 추가하신건가용...? 제가 변경된 로고 이미지로 icons 폴더에 추가해두었습니다!

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading