-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
32 changed files
with
1,410 additions
and
70 deletions.
There are no files selected for viewing
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.
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 |
---|---|---|
@@ -0,0 +1,97 @@ | ||
/** @jsxImportSource @emotion/react */ | ||
import styled from '@emotion/styled'; | ||
import { ResStatus } from '@pages/Reservation/ReservationList'; | ||
import { TypoTitleXsM } from '@styles/Common'; | ||
import variables from '@styles/Variables'; | ||
import { Dispatch, SetStateAction } from 'react'; | ||
|
||
const ReservationNavigator = ({ | ||
list, | ||
status, | ||
setStatus, | ||
}: { | ||
list: ResStatus[]; | ||
status: ResStatus; | ||
setStatus: Dispatch<SetStateAction<ResStatus>>; | ||
}) => { | ||
return ( | ||
<nav> | ||
<UlStyle> | ||
{list.map((item, index) => { | ||
const isActive = item === status; | ||
const length = list.length; | ||
|
||
return ( | ||
<LiStyle | ||
key={index} | ||
className={isActive ? 'active' : ''} | ||
onClick={() => setStatus(item)} | ||
length={length} | ||
> | ||
<span css={TypoTitleXsM}>{item}</span> | ||
</LiStyle> | ||
); | ||
})} | ||
</UlStyle> | ||
</nav> | ||
); | ||
}; | ||
|
||
const UlStyle = styled.ul` | ||
display: flex; | ||
`; | ||
|
||
const LiStyle = styled.li<{ length: number }>` | ||
position: relative; | ||
width: calc(100% / length); | ||
flex-grow: 1; | ||
flex-shrink: 0; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
padding: 1rem 0; | ||
box-sizing: border-box; | ||
color: ${variables.colors.gray600}; | ||
& > span { | ||
position: relative; | ||
} | ||
&::before { | ||
content: ''; | ||
position: absolute; | ||
background-color: ${variables.colors.gray300}; | ||
height: 0.1rem; | ||
left: 0; | ||
right: 0; | ||
bottom: 0; | ||
} | ||
&.active { | ||
color: ${variables.colors.black}; | ||
} | ||
&.active::before { | ||
content: ''; | ||
position: absolute; | ||
background-color: ${variables.colors.black}; | ||
height: 0.2rem; | ||
left: 0; | ||
right: 0; | ||
bottom: 0; | ||
} | ||
&.active > span::after { | ||
content: ''; | ||
position: absolute; | ||
right: calc(-4 * sqrt(2) * 0.1rem); | ||
top: calc(-2 * sqrt(2) * 0.1rem); | ||
width: 0.4rem; | ||
height: 0.4rem; | ||
background-color: ${variables.colors.primary}; | ||
transform: translateX(-25%) rotate(45deg); | ||
} | ||
`; | ||
|
||
export default ReservationNavigator; |
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,64 @@ | ||
/** @jsxImportSource @emotion/react */ | ||
import { css } from '@emotion/react'; | ||
import { TypoCapXsR } from '@styles/Common'; | ||
import variables from '@styles/Variables'; | ||
|
||
const RatingReview = ({ ratingValue = 0 }) => { | ||
let ratingComment = ''; | ||
|
||
switch (ratingValue) { | ||
case 1: | ||
ratingComment = '별로였어요.'; | ||
break; | ||
case 2: | ||
ratingComment = '그저 그랬어요.'; | ||
break; | ||
case 3: | ||
ratingComment = '괜찮았어요.'; | ||
break; | ||
case 4: | ||
ratingComment = '좋았어요.'; | ||
break; | ||
case 5: | ||
ratingComment = '최고였어요!'; | ||
break; | ||
default: | ||
ratingComment = '촬영은 어떠셨나요? 사진관 이용 리뷰를 남겨주세요.'; | ||
break; | ||
} | ||
|
||
return ( | ||
<div css={CardRatingStar}> | ||
<p>{ratingComment}</p> | ||
<div className="ratingBox"> | ||
{Array.from({ length: 5 }).map((_, i) => ( | ||
<img | ||
key={i} | ||
src={`/img/icon-rating${i < ratingValue ? '.svg' : '-disabled.svg'}`} | ||
alt={i < ratingValue ? '평가됨' : '미평가'} | ||
/> | ||
))} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default RatingReview; | ||
|
||
const CardRatingStar = css` | ||
display: flex; | ||
flex-direction: column; | ||
gap: 0.6rem; | ||
border-top: 0.1rem solid ${variables.colors.gray300}; | ||
padding-top: 1rem; | ||
& p { | ||
${TypoCapXsR} | ||
color: ${variables.colors.gray800}; | ||
} | ||
.ratingBox { | ||
display: flex; | ||
gap: 0.2rem; | ||
} | ||
`; |
Oops, something went wrong.