첫 커밋

This commit is contained in:
focp212@naver.com
2025-09-05 15:36:48 +09:00
commit 05238b04c1
825 changed files with 176358 additions and 0 deletions

203
src/components/Header.tsx Normal file
View File

@@ -0,0 +1,203 @@
import React, { useState } from 'react';
import { Link, useRouterState } from '@tanstack/react-router';
import { Toasts } from '@/shared/ui/toasts/toasts';
import { notiBar, snackBar } from '@/shared/lib/toast';
import { ToastContainer,toast } from 'react-toastify';
const Header: React.FC = () => {
const [isOpenBottomSheet, setIsOpenBottomSheet] = useState(true);
const [isMenuOpen, setIsMenuOpen] = useState(false);
const router = useRouterState();
const isActive = (path: string) => {
return router.location.pathname === path;
};
const toastTest = (str: string) => {
//alert(str)
toast(str);
//notiBar(str)
};
const openBottomSheet = () => {
};
return (
<>
<header
className="fixed left-0 right-0 bg-white shadow-lg z-50"
style={{
top: `env(safe-area-inset-top, 0px)`
}}
>
<Toasts />
<div className="container mx-auto px-4">
<div className="flex justify-between items-center py-4">
{/* Logo */}
<Link to="/" className="flex items-center space-x-2">
<div className="w-8 h-8 bg-blue-600 rounded-md flex items-center justify-center">
<span className="text-white font-bold text-sm">NP</span>
</div>
<span className="text-xl font-bold text-gray-900">
NicePayments
</span>
</Link>
{/* Desktop Navigation */}
<nav className="hidden md:flex items-center space-x-8">
<Link
to="/"
className={`font-medium transition-colors ${
isActive('/')
? 'text-blue-600 border-b-2 border-blue-600 pb-1'
: 'text-gray-700 hover:text-blue-600'
}`}
>
</Link>
<Link
to="/about"
className={`font-medium transition-colors ${
isActive('/about')
? 'text-blue-600 border-b-2 border-blue-600 pb-1'
: 'text-gray-700 hover:text-blue-600'
}`}
>
</Link>
<Link
to="/contact"
className={`font-medium transition-colors ${
isActive('/contact')
? 'text-blue-600 border-b-2 border-blue-600 pb-1'
: 'text-gray-700 hover:text-blue-600'
}`}
>
</Link>
<Link
to="/test"
className={`font-medium transition-colors ${
isActive('/test')
? 'text-blue-600 border-b-2 border-blue-600 pb-1'
: 'text-gray-700 hover:text-blue-600'
}`}
>
</Link>
</nav>
{/* User Menu */}
<div className="hidden md:flex items-center space-x-4">
<div className="space-x-2">
<button
onClick={() => toastTest('로그인')}
className="text-gray-700 px-4 py-2 rounded-md hover:bg-gray-100 transition-colors">
</button>
<button className="bg-blue-600 text-white px-4 py-2 rounded-md hover:bg-blue-700 transition-colors">
</button>
</div>
</div>
{/* Mobile Menu Button */}
<button
className="md:hidden flex items-center justify-center w-8 h-8"
onClick={() => setIsMenuOpen(!isMenuOpen)}
>
<svg
className="w-6 h-6"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
{isMenuOpen ? (
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
d="M6 18L18 6M6 6l12 12"
/>
) : (
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
d="M4 6h16M4 12h16M4 18h16"
/>
)}
</svg>
</button>
</div>
{/* Mobile Menu */}
{isMenuOpen && (
<div className="md:hidden py-4 border-t border-gray-200">
<nav className="flex flex-col space-y-4">
<Link
to="/"
className={`font-medium transition-colors ${
isActive('/') ? 'text-blue-600' : 'text-gray-700'
}`}
onClick={() => setIsMenuOpen(false)}
>
</Link>
<Link
to="/about"
className={`font-medium transition-colors ${
isActive('/about') ? 'text-blue-600' : 'text-gray-700'
}`}
onClick={() => setIsMenuOpen(false)}
>
</Link>
<Link
to="/contact"
className={`font-medium transition-colors ${
isActive('/contact') ? 'text-blue-600' : 'text-gray-700'
}`}
onClick={() => setIsMenuOpen(false)}
>
</Link>
<Link
to="/test"
className={`font-medium transition-colors ${
isActive('/test') ? 'text-blue-600' : 'text-gray-700'
}`}
onClick={() => setIsMenuOpen(false)}
>
</Link>
<div className="pt-4 border-t border-gray-200">
<div className="space-y-2">
<button
className="w-full text-left text-gray-700 hover:text-blue-600 transition-colors"
onClick={() => toastTest('로그인')}
>
</button>
<button
className="w-full text-left bg-blue-600 text-white px-4 py-2 rounded-md hover:bg-blue-700 transition-colors"
onClick={() => setIsMenuOpen(false)}
>
</button>
</div>
</div>
</nav>
</div>
)}
</div>
</header>
</>
);
};
export default Header;