-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* First commit Sprint Mission5 on React * Sprint mission 6 commit. * Sprint Mission 6 Update 1 * update sprint mission 6 * Sprint mission 6 update commit. * delete .bak files * Update Comments * modify ItemComment
- Loading branch information
1 parent
d48b01a
commit 4f9c678
Showing
41 changed files
with
1,859 additions
and
370 deletions.
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.