Skip to content

Commit 2ecb189

Browse files
임재은임재은
authored andcommitted
mission-6 완료
1 parent 889da90 commit 2ecb189

7 files changed

Lines changed: 308 additions & 28 deletions

File tree

src/assets/closeBtn.png

1.05 KB
Loading

src/assets/imageUpload.svg

Lines changed: 5 additions & 0 deletions
Loading

src/components/Header.jsx

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import { Link } from 'react-router-dom';
1+
import { Link, useLocation } from 'react-router-dom';
22
import styled from 'styled-components';
33

44
import logoImg from '../assets/logo.png';
55
import moLogoImg from '../assets/mo_logo.png';
66
import profileImg from '../assets/profileIcon.png';
77

88
function Navigation() {
9+
const location = useLocation();
910
return (
1011
<NavWrap>
1112
<Logo>
@@ -18,8 +19,10 @@ function Navigation() {
1819
</a>
1920
</Logo>
2021
<Nav>
21-
<Link to='/freeboard'>자유게시판</Link>
22-
<Link to='/items'>중고마켓</Link>
22+
<StyledLink to='/freeboard'>자유게시판</StyledLink>
23+
<StyledLink to='/items' $isActive={location.pathname === '/addItem'}>
24+
중고마켓
25+
</StyledLink>
2326
</Nav>
2427
<Profile>
2528
<a href='#'>
@@ -38,16 +41,6 @@ const NavWrap = styled.div`
3841
width: 100%;
3942
padding: 0 16px;
4043
border-bottom: 1px solid #dfdfdf;
41-
a {
42-
text-decoration: none;
43-
color: #4b5563;
44-
font-weight: 600;
45-
font-size: 16px;
46-
flex-shrink: 0;
47-
img {
48-
vertical-align: middle;
49-
}
50-
}
5144
`;
5245
const Nav = styled.div`
5346
display: flex;
@@ -74,4 +67,14 @@ const Profile = styled.div`
7467
width: 100%;
7568
l}
7669
`;
70+
const StyledLink = styled(Link)`
71+
text-decoration: none;
72+
color: ${props => (props.$isActive ? '#3692ff' : '#4b5563')};
73+
font-weight: 600;
74+
font-size: 16px;
75+
flex-shrink: 0;
76+
img {
77+
vertical-align: middle;
78+
}
79+
`;
7780
export default Navigation;

src/components/Tag.jsx

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import styled from 'styled-components';
2+
3+
import closeBtn from '../assets/closeBtn.png';
4+
export default function Tag({ children, id, deleteTagHandler }) {
5+
const onDeleteTag = () => {
6+
deleteTagHandler(id);
7+
};
8+
return (
9+
<TagWrapper id={id}>
10+
#{children}
11+
<DelBtn onClick={onDeleteTag} src={closeBtn} />
12+
</TagWrapper>
13+
);
14+
}
15+
const TagWrapper = styled.div`
16+
display: flex;
17+
height: 36px;
18+
border-radius: 26px;
19+
background-color: #f3f4f6;
20+
font-size: 16px;
21+
padding: 5px 12px 5px 16px;
22+
align-items: center;
23+
`;
24+
const DelBtn = styled.img`
25+
width: 22px;
26+
height: 24px;
27+
margin-left: 8px;
28+
`;

src/index.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ section {
108108
display: block;
109109
}
110110
body {
111-
font-family: "Pretendard", sans-serif;
111+
font-family: 'Pretendard', sans-serif;
112112
line-height: 1;
113113
}
114114
ol,
@@ -123,7 +123,7 @@ blockquote:before,
123123
blockquote:after,
124124
q:before,
125125
q:after {
126-
content: "";
126+
content: '';
127127
content: none;
128128
}
129129
table {

0 commit comments

Comments
 (0)