forked from SanE-Seo/SaneE-SEo-Front
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 걸음나눔터 페이지 슬라이더 컴포넌트 구현 (SanE-Seo#21)
- Loading branch information
Showing
7 changed files
with
265 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
function CourseDetail() { | ||
return ( | ||
<DetailLayout> | ||
<span className="detail-title">코스 소개</span> | ||
<span className="detail-text"> | ||
노원구 동네에서 걷기 좋은 산책로 추천드립니당 | ||
</span> | ||
<span className="detail-title">사용자 등록 사진</span> | ||
</DetailLayout> | ||
); | ||
} | ||
|
||
export default CourseDetail; | ||
|
||
const DetailLayout = styled.div` | ||
width: 100%; | ||
display: flex; | ||
flex-direction: column; | ||
padding: 15px 20px; | ||
cursor: default; | ||
.detail-title { | ||
${(props) => props.theme.fonts.text_md}; | ||
color: ${(props) => props.theme.colors.gray700}; | ||
} | ||
.detail-text { | ||
${(props) => props.theme.fonts.text_sm}; | ||
color: ${(props) => props.theme.colors.gray400}; | ||
margin: 5px 0 15px 0; | ||
} | ||
`; |
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,8 +1,54 @@ | ||
import React from 'react'; | ||
import { DrawerLayout } from '../../styles/drawer.style'; | ||
|
||
function Drawer() { | ||
return <DrawerLayout></DrawerLayout>; | ||
import React, { useState } from 'react'; | ||
import * as D from '../../styles/drawer.style'; | ||
import TimeIcon from '../../assets/icons/time-icon'; | ||
import HeartIcon from '../../assets/icons/heart-icon'; | ||
import LengthIcon from '../../assets/icons/length-icon'; | ||
import LevelIcon from '../../assets/icons/level-icon'; | ||
import DefaultProfileImg from '../../assets/image/default-profile.png'; | ||
import CourseDetail from './CourseDetail'; | ||
import Review from './Review'; | ||
type DrawerProps = { | ||
isOpenDrawer: boolean; | ||
setIsOpenDrawer: (value: boolean) => void; | ||
}; | ||
function Drawer({ isOpenDrawer, setIsOpenDrawer }: DrawerProps) { | ||
const [selectedMenu, setSelectedMenu] = useState<string>('상세정보'); | ||
return ( | ||
<D.DrawerLayout | ||
// style={{ | ||
// transform: isOpenDrawer ? 'translateX(0)' : 'translateX(-100%)', | ||
// }} | ||
> | ||
<D.PostInfoBox> | ||
<span className="title-sm">노원구 최애 산책길</span> | ||
<span className="address-info">서울특별시 노원구</span> | ||
<div className="description-box"> | ||
<TimeIcon width={20} height={20} /> | ||
<span className="description-text">1시간</span> | ||
<HeartIcon width={20} height={20} /> | ||
<span className="description-text">15</span> | ||
<LengthIcon width={11} height={17} /> | ||
<span className="description-text">2.51km</span> | ||
<LevelIcon width={15} height={15} /> | ||
<span className="description-text">초급</span> | ||
</div> | ||
<div className="profile-box"> | ||
<img src={DefaultProfileImg} alt="profile" className="profile-img" /> | ||
<span className="name">응자 </span> | ||
</div> | ||
</D.PostInfoBox> | ||
<hr className="custom-line" /> | ||
<D.MenuBox> | ||
<D.MenuItem active={selectedMenu === '상세정보'.toString()}> | ||
<button onClick={() => setSelectedMenu('상세정보')}> 상세정보</button> | ||
</D.MenuItem> | ||
<D.MenuItem active={selectedMenu === '리뷰'.toString()}> | ||
<button onClick={() => setSelectedMenu('리뷰')}>리뷰</button> | ||
</D.MenuItem> | ||
</D.MenuBox> | ||
{selectedMenu == '상세정보' ? <CourseDetail /> : <Review />} | ||
</D.DrawerLayout> | ||
); | ||
} | ||
|
||
export default Drawer; |
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,74 @@ | ||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
import DefaultProfileImg from '../../assets/image/default-profile.png'; | ||
function Review() { | ||
return ( | ||
<ReviewLayout> | ||
<AddReviewButton>리뷰 작성하기</AddReviewButton> | ||
<ReviewItem> | ||
<div className="profile-rating-box"> | ||
<img src={DefaultProfileImg} className="profile-img" alt="profile" /> | ||
<span className="name">응자</span> | ||
</div> | ||
<span className="review-text">가볍게 산책하기 좋아요</span> | ||
<span className="review-text">2024.04.17</span> | ||
</ReviewItem> | ||
<ReviewItem> | ||
<div className="profile-rating-box"> | ||
<img src={DefaultProfileImg} className="profile-img" alt="profile" /> | ||
<span className="name">응자</span> | ||
</div> | ||
<span className="review-text">가볍게 산책하기 좋아요</span> | ||
<span className="review-text">2024.04.17</span> | ||
</ReviewItem> | ||
</ReviewLayout> | ||
); | ||
} | ||
|
||
export default Review; | ||
const ReviewLayout = styled.div` | ||
width: 100%; | ||
display: flex; | ||
flex-direction: column; | ||
padding: 15px 20px; | ||
cursor: default; | ||
`; | ||
|
||
const AddReviewButton = styled.button` | ||
width: 300px; | ||
height: 40px; | ||
background: #f9c758; | ||
border-radius: 10px; | ||
${(props) => props.theme.fonts.text_md}; | ||
color: #ffffff; | ||
`; | ||
|
||
const ReviewItem = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
margin-top: 20px; | ||
.profile-rating-box { | ||
display: flex; | ||
flex-direction: row; | ||
align-items: center; | ||
.profile-img { | ||
width: 26px; | ||
height: 26px; | ||
border-radius: 50%; | ||
} | ||
.name { | ||
${(props) => props.theme.fonts.text_sm}; | ||
color: ${(props) => props.theme.colors.gray600}; | ||
margin-left: 6px; | ||
} | ||
} | ||
.review-text { | ||
margin-top: 5px; | ||
${(props) => props.theme.fonts.text_sm}; | ||
color: ${(props) => props.theme.colors.gray400}; | ||
} | ||
`; |
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
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