-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Feature/#20 메인페이지 반응형 작업(트랙 소개 제외)
- Loading branch information
Showing
25 changed files
with
579 additions
and
286 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,58 @@ | ||
import { useCallback } from 'react'; | ||
import { useCallback, useState } from 'react'; | ||
import { useNavigate } from 'react-router'; | ||
import * as S from './Header.styled'; | ||
import Popup from '../Popup/Popup'; | ||
import Hamburger from '../../assets/Icons/Hamburger.svg'; | ||
import useMediaQueries from '@/hooks/useMediaQueries'; | ||
|
||
export default function Header() { | ||
const [isPopupOpen, setPopupOpen] = useState(false); | ||
const [isMenuOpen, setMenuOpen] = useState(false); | ||
const navigate = useNavigate(); | ||
const onContainerClick = useCallback(() => { | ||
}, []); | ||
const { isMobile } = useMediaQueries(); | ||
|
||
const onContainerClick = useCallback(() => {}, []); | ||
|
||
return ( | ||
<S.HeaderContainer> | ||
<S.Logo onClick={() => navigate('/')}>Farm System</S.Logo> | ||
|
||
{isMobile ? ( | ||
<S.HamburgerIcon src={Hamburger} alt="Menu" onClick={() => setMenuOpen(!isMenuOpen)} /> | ||
) : ( | ||
<> | ||
<S.Nav> | ||
<S.NavItem onClick={() => navigate('/')}>홈</S.NavItem> | ||
<S.NavItem onClick={() => setPopupOpen(true)}>블로그 / 프로젝트</S.NavItem> | ||
<S.NavItem onClick={() => setPopupOpen(true)}>소식</S.NavItem> | ||
<S.NavItem onClick={() => setPopupOpen(true)}>FAQ</S.NavItem> | ||
<S.NavItem onClick={() => navigate('/apply')}>지원하기</S.NavItem> | ||
</S.Nav> | ||
|
||
<S.Nav> | ||
<S.NavItem onClick={() => navigate('/')}> | ||
홈 | ||
</S.NavItem> | ||
<S.NavItem onClick={() => navigate('/blog-project')}> | ||
블로그 / 프로젝트 | ||
</S.NavItem> | ||
<S.NavItem onClick={() => navigate('/news')}> | ||
소식 | ||
</S.NavItem> | ||
<S.NavItem onClick={() => navigate('/faq')}> | ||
FAQ | ||
</S.NavItem> | ||
<S.NavItem onClick={() => navigate('/apply')}> | ||
지원하기 | ||
</S.NavItem> | ||
</S.Nav> | ||
|
||
{/* 파밍로그 버튼 */} | ||
<S.FarmingLogButton onClick={onContainerClick}>파밍로그</S.FarmingLogButton> | ||
{/* 파밍로그 버튼 */} | ||
<S.FarmingLogButton onClick={onContainerClick}>파밍로그</S.FarmingLogButton> | ||
</> | ||
)} | ||
|
||
<S.MobileNavWrapper $isMenuOpen={isMenuOpen}> | ||
{isMobile && ( | ||
<S.MobileNav> | ||
<S.NavItem onClick={() => navigate('/')}>홈</S.NavItem> | ||
<S.NavItem onClick={() => setPopupOpen(true)}>블로그 / 프로젝트</S.NavItem> | ||
<S.NavItem onClick={() => setPopupOpen(true)}>소식</S.NavItem> | ||
<S.NavItem onClick={() => setPopupOpen(true)}>FAQ</S.NavItem> | ||
<S.NavItem onClick={() => navigate('/apply')}>지원하기</S.NavItem> | ||
<S.NavItem onClick={() => setPopupOpen(true)}>파밍로그</S.NavItem> | ||
</S.MobileNav> | ||
)} | ||
</S.MobileNavWrapper> | ||
|
||
<Popup | ||
isOpen={isPopupOpen} | ||
onClose={() => setPopupOpen(false)} | ||
title={"아직 오픈되지 않았습니다."} | ||
content={"오픈 예정: 2025년 4월"} | ||
/> | ||
</S.HeaderContainer> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import styled from 'styled-components'; | ||
|
||
export const PopupOverlay = styled.div` | ||
position: fixed; | ||
inset: 0; | ||
background: rgba(113, 113, 113, 0.3); | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
z-index: 9999; | ||
`; | ||
|
||
export const PopupBox = styled.div` | ||
width: 500px; | ||
background-color: #fcfcfc; | ||
border: 3px solid #28723f; | ||
border-radius: 15px; | ||
text-align: center; | ||
padding: 40px; | ||
z-index: 10000; | ||
`; | ||
|
||
export const PopupTitle = styled.p` | ||
font-size: 22px; | ||
font-weight: 700; | ||
color: black; | ||
margin-bottom: 20px; | ||
`; | ||
|
||
export const PopupText = styled.p` | ||
font-size: 18px; | ||
color: black; | ||
margin-bottom: 20px; | ||
`; | ||
|
||
export const PopupCloseButton = styled.button` | ||
background-color: #28723f; | ||
color: #fcfcfc; | ||
font-size: 16px; | ||
padding: 10px 20px; | ||
border: none; | ||
border-radius: 10px; | ||
cursor: pointer; | ||
box-shadow: 0px 2px 10px rgba(25, 25, 25, 0.2); | ||
width: 100px; | ||
margin-top: 20px; | ||
&:hover { | ||
background-color: #1f5b30; | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import React from 'react'; | ||
import * as S from './Popup.styled'; | ||
|
||
interface PopupProps { | ||
isOpen: boolean; | ||
onClose: () => void; | ||
title: string; | ||
content: string; | ||
} | ||
|
||
const Popup: React.FC<PopupProps> = ({ isOpen, onClose, title, content }) => { | ||
if (!isOpen) return null; | ||
|
||
return ( | ||
<S.PopupOverlay onClick={onClose}> | ||
<S.PopupBox onClick={(e) => e.stopPropagation()}> | ||
<S.PopupTitle>{title}</S.PopupTitle> | ||
<S.PopupText>{content}</S.PopupText> | ||
<S.PopupCloseButton onClick={onClose}>확인</S.PopupCloseButton> | ||
</S.PopupBox> | ||
</S.PopupOverlay> | ||
); | ||
}; | ||
|
||
export default Popup; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.