-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from ehdrhelr/fe/feature/reserveForm
[FE]예약 폼 모달
- Loading branch information
Showing
21 changed files
with
409 additions
and
34 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 |
---|---|---|
|
@@ -13,5 +13,6 @@ | |
</head> | ||
<body> | ||
<div id="root"></div> | ||
<div id="modal"></div> | ||
</body> | ||
</html> |
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
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
38 changes: 38 additions & 0 deletions
38
FE/airbnb/src/components/reservePageSkeleton/MapSkeleton.tsx
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,38 @@ | ||
import styled from 'styled-components'; | ||
|
||
interface Props {} | ||
|
||
const MapSkeleton = (props: Props) => { | ||
return <StyledMapSkeleton className='skeleton-screen'>loading</StyledMapSkeleton>; | ||
}; | ||
|
||
export default MapSkeleton; | ||
|
||
const StyledMapSkeleton = styled.div` | ||
background-color: #f2f2f2; | ||
position: absolute; | ||
right: 0; | ||
width: 50%; | ||
height: 100%; | ||
&::before { | ||
content: ''; | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
background: linear-gradient(to right, #f2f2f2, #ddd, #f2f2f2); | ||
animation: loading 1s infinite linear; | ||
} | ||
@keyframes loading { | ||
0% { | ||
transform: translateX(0); | ||
} | ||
50%, | ||
100% { | ||
transform: translateX(460px); | ||
} | ||
} | ||
`; |
25 changes: 25 additions & 0 deletions
25
FE/airbnb/src/components/reservePageSkeleton/ReserveSkeleton.tsx
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,25 @@ | ||
import styled from 'styled-components'; | ||
|
||
interface Props {} | ||
|
||
const ReserveSkeleton = (props: Props) => { | ||
return ( | ||
<StyledReserveSkeleton> | ||
<div className='skeleton__img'></div> | ||
<div className='skeleton__desc'> | ||
<div className='skeleton__info'></div> | ||
<div className='skeleton__price'></div> | ||
</div> | ||
</StyledReserveSkeleton> | ||
); | ||
}; | ||
|
||
export default ReserveSkeleton; | ||
|
||
const StyledReserveSkeleton = styled.div` | ||
.skeleton__img, | ||
.skeleton__info, | ||
.skeleton__price { | ||
background-color: f2f2f2; | ||
} | ||
`; |
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
24 changes: 24 additions & 0 deletions
24
FE/airbnb/src/components/reserveRoomList/reserveForm/ReserveBtn.tsx
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,24 @@ | ||
import styled from 'styled-components'; | ||
|
||
interface Props { | ||
className: string; | ||
} | ||
|
||
const ReserveBtn = ({ className }: Props) => { | ||
return <StyledReserveBtn className={className}>예약하기</StyledReserveBtn>; | ||
}; | ||
|
||
export default ReserveBtn; | ||
|
||
const StyledReserveBtn = styled.button` | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
width: 100%; | ||
height: 55px; | ||
border: none; | ||
border-radius: 10px; | ||
background-color: ${({ theme }) => theme.colors.black}; | ||
color: ${({ theme }) => theme.colors.white}; | ||
font-weight: 700; | ||
`; |
59 changes: 52 additions & 7 deletions
59
FE/airbnb/src/components/reserveRoomList/reserveForm/ReserveForm.tsx
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,29 +1,74 @@ | ||
import { RefObject } from 'react'; | ||
import styled from 'styled-components'; | ||
import { roomType } from '../roomType'; | ||
import ReserveBtn from './ReserveBtn'; | ||
import ReserveFormHeader from './ReserveFormHeader'; | ||
import ReserveFormInfo from './ReserveFormInfo'; | ||
import ReserveFromPrice from './ReserveFromPrice'; | ||
import { createPortal } from 'react-dom'; | ||
import usePortal from '../../../hooks/usePortal'; | ||
|
||
interface Props { | ||
toggleRef: RefObject<HTMLDivElement>; | ||
roomData: roomType; | ||
} | ||
|
||
const ReserveForm = ({ roomData }: Props) => { | ||
const ReserveForm = ({ toggleRef, roomData }: Props) => { | ||
const { chargePerNight } = roomData; | ||
const portalElement: HTMLDivElement | null = document.querySelector('#modal'); | ||
return ( | ||
<StyledReserveFormWrapper> | ||
<StyledReserveForm>123</StyledReserveForm>; | ||
</StyledReserveFormWrapper> | ||
portalElement && | ||
createPortal( | ||
<StyledReserveFormWrapper> | ||
<StyledReserveForm ref={toggleRef}> | ||
<ReserveFormHeader | ||
className='reserve__header' | ||
chargePerNight={chargePerNight} | ||
review={127} | ||
/> | ||
<ReserveFormInfo className='reserve__info' /> | ||
<ReserveBtn className='reserve__btn' /> | ||
<div className='reserve__warn'>예약 확정 전에는 요금이 청구되지 않습니다.</div> | ||
<ReserveFromPrice chargePerNight={chargePerNight} /> | ||
</StyledReserveForm> | ||
</StyledReserveFormWrapper>, | ||
portalElement | ||
) | ||
); | ||
}; | ||
|
||
export default ReserveForm; | ||
|
||
const StyledReserveFormWrapper = styled.div` | ||
z-index: 10; | ||
position: absolute; | ||
position: fixed; | ||
top: 0; | ||
width: 100%; | ||
height: 100%; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
background-color: rgba(0, 0, 0, 0.3); | ||
`; | ||
|
||
const StyledReserveForm = styled.div` | ||
padding: 36px 24px; | ||
width: 400px; | ||
height: 500px; | ||
background-color: green; | ||
height: 525px; | ||
background-color: ${({ theme }) => theme.colors.white}; | ||
border-radius: 10px; | ||
box-shadow: 0px 4px 10px rgba(51, 51, 51, 0.1), 0px 0px 4px rgba(51, 51, 51, 0.05); | ||
.reserve__header { | ||
margin-bottom: 1.5rem; | ||
} | ||
.reserve__info, | ||
.reserve__btn, | ||
.reserve__warn { | ||
margin-bottom: 1rem; | ||
} | ||
.reserve__warn { | ||
text-align: center; | ||
font-size: ${({ theme }) => theme.fontSize.small}; | ||
color: ${({ theme }) => theme.colors.gray3}; | ||
} | ||
`; |
39 changes: 39 additions & 0 deletions
39
FE/airbnb/src/components/reserveRoomList/reserveForm/ReserveFormHeader.tsx
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,39 @@ | ||
import styled from 'styled-components'; | ||
|
||
interface Props { | ||
className?: string; | ||
chargePerNight: number; | ||
review: number; | ||
} | ||
|
||
const ReserveFormHeader = ({ className, chargePerNight, review }: Props) => { | ||
return ( | ||
<StyledReserveFormHeader className={className}> | ||
<div> | ||
<span className='price'>₩{chargePerNight.toLocaleString()}</span> | ||
<span> / 박</span> | ||
</div> | ||
<div> | ||
<span className='review'>후기 {review}개</span> | ||
</div> | ||
</StyledReserveFormHeader> | ||
); | ||
}; | ||
|
||
export default ReserveFormHeader; | ||
|
||
const StyledReserveFormHeader = styled.div` | ||
display: flex; | ||
align-items: flex-end; | ||
justify-content: space-between; | ||
.price { | ||
font-size: ${({ theme }) => theme.fontSize.large}; | ||
font-weight: bold; | ||
} | ||
.review { | ||
font-size: ${({ theme }) => theme.fontSize.small}; | ||
color: ${({ theme }) => theme.colors.gray3}; | ||
text-decoration: underline; | ||
} | ||
`; |
Oops, something went wrong.