-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
21d6852
commit 379399f
Showing
5 changed files
with
159 additions
and
2 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,31 @@ | ||
import { useState } from 'react'; | ||
import Styles from './AddGuestsPopUp.module.css'; | ||
import Guest from './Guest/Guest'; | ||
|
||
const AddGuestsPopUp = () => { | ||
const [guestsList, setGuestsList] = useState({typeofGuest:0,numberOfGuests:0}); | ||
const guests = [ | ||
{index:1, title:'Adults', description:'Ages 13 or above', descriptionType:'string'}, | ||
{index:2, title:'Children', description:'Ages 2 - 12', descriptionType:'string'}, | ||
{index:3, title:'Infants', description:'Under 2', descriptionType:'string'}, | ||
{index:4, title:'Pets', description:'Bringing a service animal?', descriptionType:'link'} | ||
]; | ||
const handelGuestClick = (guest) =>{ | ||
setGuestsList(guest); | ||
} | ||
return( | ||
<div className={Styles.popup}> | ||
{guests.map((guest)=> | ||
<Guest | ||
key = {guest.index} | ||
title = {guest.title} | ||
description = {guest.description} | ||
descriptionType = {guest.descriptionType} | ||
onClick={(e)=>handelGuestClick(e)} | ||
/> | ||
) | ||
} | ||
</div> | ||
) | ||
} | ||
export default AddGuestsPopUp; |
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,11 @@ | ||
.popup { | ||
display: flex; | ||
flex-direction: column; | ||
max-width: 350px; | ||
max-height: 644px; | ||
background-color: white; | ||
border-radius: 32px; | ||
padding: 32px; | ||
color: black; | ||
display: block; | ||
} |
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 { useState } from 'react'; | ||
import Styles from './Guest.module.css'; | ||
|
||
const Guest = ({title, description, descriptionType, onClick}) => { | ||
const[count, setCount] = useState(0); | ||
const handelMinusCount = () => { | ||
{count > 0 && setCount(count - 1)}; | ||
onClick({typeofGuest:title,numberOfGuests:count - 1}); | ||
}; | ||
const handelPlusCount = () => { | ||
setCount(count + 1); | ||
onClick({typeofGuest:title,numberOfGuests:count + 1}); | ||
}; | ||
|
||
return( | ||
<div className={Styles.container}> | ||
<div className={Styles.detailContainer}> | ||
<div className={Styles.title}>{title}</div> | ||
{descriptionType === 'string' ? | ||
<div>{description}</div> : | ||
<div className={Styles.descriptionLink}>{description}</div> | ||
} | ||
</div> | ||
<div className={Styles.buttonContainer}> | ||
<button className={count !== 0 ? Styles.button : Styles.buttonDisable} onClick={handelMinusCount}>-</button> | ||
<div className={Styles.count}>{count}</div> | ||
<button className={Styles.button} onClick={handelPlusCount}>+</button> | ||
</div> | ||
|
||
</div> | ||
) | ||
} | ||
export default Guest; |
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,80 @@ | ||
.container { | ||
display: flex; | ||
flex-direction: row; | ||
width: 100%; | ||
border-top: 1px solid rgb(176, 176, 176); | ||
min-height: 50px; | ||
padding-top: 20px; | ||
padding-bottom: 20px; | ||
} | ||
.container:first-child { | ||
border-top: none; | ||
} | ||
.detailContainer { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: start; | ||
flex: 3; | ||
font-size: 14px; | ||
} | ||
.title { | ||
font-size: 16px; | ||
font-weight: 600; | ||
} | ||
.descriptionLink { | ||
text-decoration: underline; | ||
color: rgb(106, 106, 106); | ||
cursor: pointer; | ||
} | ||
.descriptionLink:hover { | ||
color: rgb(106, 106, 106); | ||
} | ||
.buttonContainer { | ||
display: flex; | ||
flex-direction: row; | ||
flex: 1; | ||
} | ||
.button { | ||
border-radius: 100%; | ||
background-color: white; | ||
color: black; | ||
border: 1px solid rgb(176, 176, 176); | ||
width: 25px; | ||
height: 25px; | ||
padding: 20px; | ||
text-align: center; | ||
display: inline-flex; | ||
font-size: 16px; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
text-decoration: none; | ||
color: rgb(106, 106, 106); | ||
} | ||
.button:hover { | ||
cursor: pointer; | ||
} | ||
.buttonDisable { | ||
border-radius: 100%; | ||
background-color: white; | ||
color: rgb(235, 235, 235); | ||
border: 1px solid rgb(235, 235, 235); | ||
width: 25px; | ||
height: 25px; | ||
padding: 20px; | ||
text-align: center; | ||
display: inline-flex; | ||
font-size: 16px; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
text-decoration: none; | ||
color: rgb(235, 235, 235); | ||
} | ||
.buttonDisable:hover { | ||
cursor: not-allowed; | ||
} | ||
.count { | ||
width: 15px; | ||
padding: 10px; | ||
} |
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