-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
React 김주동 sprint7 #97
Merged
GANGYIKIM
merged 9 commits into
codeit-bootcamp-frontend:React-김주동
from
joodongkim:React-김주동-sprint7
Sep 23, 2024
The head ref may contain hidden characters: "React-\uAE40\uC8FC\uB3D9-sprint7"
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
3c68d4e
First commit Sprint Mission5 on React
joodongkim 675f9b0
Sprint mission 6 commit.
joodongkim 20fd6da
Sprint Mission 6 Update 1
joodongkim 6ebe241
update sprint mission 6
joodongkim 4bfa053
Sprint mission 6 update commit.
joodongkim 3164f59
Merge branch 'React-김주동' into React-김주동-sprint6
joodongkim 10b590a
delete .bak files
joodongkim 2032cc0
Update Comments
joodongkim 1437689
modify ItemComment
joodongkim File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Large diffs are not rendered by default.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<meta name="keywords" content="Codeit - FE10 Sprint Mission 5"> | ||
<meta name="keywords" content="Codeit - FE10 Sprint Mission 7"> | ||
<meta name="author" content="[email protected]"> | ||
<meta property="og:type" content="website" /> | ||
<meta property="og:title" content="판다마켓" /> | ||
|
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,41 +1,50 @@ | ||
import React from 'react' | ||
import Logo from '../../assets/images/logo/logo.svg' | ||
import { Link, NavLink } from 'react-router-dom' | ||
import './Header.css' | ||
import React from "react"; | ||
import Logo from "../../assets/images/logo/logo.svg"; | ||
import { Link, NavLink, useLocation } from "react-router-dom"; | ||
import "./Header.css"; | ||
|
||
function getLinkStyle ({ isActive }) { | ||
return { color: isActive ? 'var(--blue)' : undefined } | ||
function getLinkStyle({ isActive }) { | ||
return { color: isActive ? "var(--blue)" : undefined }; | ||
} | ||
|
||
function Header () { | ||
function Header() { | ||
const location = useLocation(); // 현재 경로 정보 | ||
|
||
return ( | ||
<header className='globalHeader'> | ||
<div className='headerLeft'> | ||
<Link to='/' className='headerLogo' aria-label='홈으로 이동'> | ||
<img src={Logo} alt='판다마켓 로고' width='153' /> | ||
<header className="globalHeader"> | ||
<div className="headerLeft"> | ||
<Link to="/" className="headerLogo" aria-label="홈으로 이동"> | ||
<img src={Logo} alt="판다마켓 로고" width="153" /> | ||
</Link> | ||
|
||
<nav> | ||
<ul> | ||
<li> | ||
<NavLink to='/community' style={getLinkStyle}> | ||
<NavLink to="/community" style={getLinkStyle}> | ||
자유게시판 | ||
</NavLink> | ||
</li> | ||
<li> | ||
<NavLink to='/items' style={getLinkStyle}> | ||
<NavLink | ||
to="/items" | ||
style={({ isActive }) => | ||
location.pathname === "/additem" || isActive | ||
? { color: "var(--blue)" } | ||
: {} | ||
} | ||
> | ||
중고마켓 | ||
</NavLink> | ||
</li> | ||
</ul> | ||
</nav> | ||
</div> | ||
|
||
<Link to='/login' className='loginLink button'> | ||
<Link to="/login" className="loginLink button"> | ||
로그인 | ||
</Link> | ||
</header> | ||
) | ||
); | ||
} | ||
|
||
export default Header | ||
export default Header; |
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,27 @@ | ||
import React from "react"; | ||
import styled from "styled-components"; | ||
import { ReactComponent as CloseIcon } from "../../assets/images/icons/ic_x.svg"; | ||
|
||
const Button = styled.button` | ||
background-color: ${({ theme }) => theme.colors.gray[400]}; | ||
width: 20px; | ||
height: 20px; | ||
border-radius: 50%; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
|
||
&:hover { | ||
background-color: ${({ theme }) => theme.colors.blue.primary}; | ||
} | ||
`; | ||
|
||
function DeleteButton({ onClick, label }) { | ||
return ( | ||
<Button aria-label={`${label} 삭제`} onClick={onClick}> | ||
<CloseIcon /> | ||
</Button> | ||
); | ||
} | ||
|
||
export default DeleteButton; |
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,33 @@ | ||
.sortButtonWrapper { | ||
position: relative; | ||
} | ||
|
||
.sortDropdownTriggerButton { | ||
border: 1px solid var(--gray-200); | ||
border-radius: 12px; | ||
padding: 9px; | ||
margin-left: 8px; | ||
} | ||
|
||
.dropdownMenu { | ||
position: absolute; | ||
top: 110%; | ||
right: 0; | ||
background: #fff; | ||
border-radius: 8px; | ||
border: 1px solid var(--gray-200); | ||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); | ||
z-index: 99; | ||
} | ||
|
||
.dropdownItem { | ||
padding: 12px 44px; | ||
border-bottom: 1px solid var(--gray-200); | ||
font-size: 16px; | ||
color: var(--gray-800); | ||
cursor: pointer; | ||
} | ||
|
||
.dropdownItem:last-child { | ||
border-bottom: none; | ||
} |
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,43 @@ | ||
import React, { useState } from "react"; | ||
import "./DropdownMenu.css"; | ||
import { ReactComponent as SortIcon } from "../../assets/images/icons/ic_sort.svg"; | ||
|
||
function DropdownMenu({ onSortSelection }) { | ||
const [isDropdownVisible, setIsDropdownVisible] = useState(false); | ||
|
||
const toggleDropdown = () => { | ||
setIsDropdownVisible(!isDropdownVisible); | ||
}; | ||
|
||
return ( | ||
<div className="sortButtonWrapper"> | ||
<button className="sortDropdownTriggerButton" onClick={toggleDropdown}> | ||
<SortIcon /> | ||
</button> | ||
|
||
{isDropdownVisible && ( | ||
<div className="dropdownMenu"> | ||
<div | ||
className="dropdownItem" | ||
onClick={() => { | ||
onSortSelection("recent"); | ||
setIsDropdownVisible(false); | ||
}} | ||
> | ||
최신순 | ||
</div> | ||
<div | ||
className="dropdownItem" | ||
onClick={() => { | ||
onSortSelection("favorite"); | ||
setIsDropdownVisible(false); | ||
}} | ||
> | ||
인기순 | ||
</div> | ||
</div> | ||
)} | ||
</div> | ||
); | ||
} | ||
export default DropdownMenu; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2:
dropdown option들 모두 click 했을 때 새로 선택된 값 넘기고 안 보이게 해주는 로직이니 공통함수로 빼도 좋겠네요.