feat(BOOK-378): Added email address to the hotel page intro section
Approved-by: Matilda Landström
This commit is contained in:
@@ -30,7 +30,7 @@ interface IntroSectionProps {
|
|||||||
hotelName: Hotel["name"]
|
hotelName: Hotel["name"]
|
||||||
location: HotelLocation
|
location: HotelLocation
|
||||||
tripAdvisor: HotelTripAdvisor
|
tripAdvisor: HotelTripAdvisor
|
||||||
phoneNumber: string
|
contactInformation: Hotel["contactInformation"]
|
||||||
}
|
}
|
||||||
|
|
||||||
export default async function IntroSection({
|
export default async function IntroSection({
|
||||||
@@ -39,7 +39,7 @@ export default async function IntroSection({
|
|||||||
location,
|
location,
|
||||||
address,
|
address,
|
||||||
tripAdvisor,
|
tripAdvisor,
|
||||||
phoneNumber,
|
contactInformation,
|
||||||
}: IntroSectionProps) {
|
}: IntroSectionProps) {
|
||||||
const intl = await getIntl()
|
const intl = await getIntl()
|
||||||
const { streetAddress, city, country } = address
|
const { streetAddress, city, country } = address
|
||||||
@@ -50,7 +50,7 @@ export default async function IntroSection({
|
|||||||
},
|
},
|
||||||
{ number: getSingleDecimal(distanceToCentre / 1000) }
|
{ number: getSingleDecimal(distanceToCentre / 1000) }
|
||||||
)
|
)
|
||||||
|
const { phoneNumber, email } = contactInformation
|
||||||
const formattedLocationText = `${streetAddress}, ${city} (${formattedDistanceText})`
|
const formattedLocationText = `${streetAddress}, ${city} (${formattedDistanceText})`
|
||||||
|
|
||||||
const showLocalCharges = country === Country.Finland
|
const showLocalCharges = country === Country.Finland
|
||||||
@@ -70,19 +70,35 @@ export default async function IntroSection({
|
|||||||
<h1 className={styles.title}>{hotelName}</h1>
|
<h1 className={styles.title}>{hotelName}</h1>
|
||||||
</Typography>
|
</Typography>
|
||||||
</div>
|
</div>
|
||||||
<address
|
<address className={styles.contactAddress}>
|
||||||
className={cx(styles.addressPhoneNumber, {
|
|
||||||
[styles.stacked]: showLocalCharges,
|
|
||||||
})}
|
|
||||||
>
|
|
||||||
<span className={styles.location}>
|
<span className={styles.location}>
|
||||||
<span className={styles.address}>
|
<MaterialIcon icon="location_on" color="CurrentColor" size={20} />
|
||||||
<MaterialIcon icon="location_on" color="CurrentColor" size={20} />
|
<Typography variant="Body/Supporting text (caption)/smRegular">
|
||||||
<Typography variant="Body/Supporting text (caption)/smRegular">
|
<p>{formattedLocationText}</p>
|
||||||
<p>{formattedLocationText}</p>
|
</Typography>
|
||||||
</Typography>
|
</span>
|
||||||
</span>
|
|
||||||
|
|
||||||
|
<div
|
||||||
|
className={cx(styles.contactInformation, {
|
||||||
|
[styles.stacked]: showLocalCharges,
|
||||||
|
})}
|
||||||
|
>
|
||||||
|
<div className={styles.phoneNumber}>
|
||||||
|
<Link
|
||||||
|
href={`tel:${phoneNumber}`}
|
||||||
|
size="small"
|
||||||
|
color="Text/Interactive/Secondary"
|
||||||
|
textDecoration="underline"
|
||||||
|
variant="icon"
|
||||||
|
>
|
||||||
|
<MaterialIcon icon="phone" color="CurrentColor" size={20} />
|
||||||
|
{phoneNumber}
|
||||||
|
</Link>
|
||||||
|
<LocalCallCharges
|
||||||
|
className={styles.localCharges}
|
||||||
|
country={country}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
{!showLocalCharges && (
|
{!showLocalCharges && (
|
||||||
<Divider
|
<Divider
|
||||||
className={styles.divider}
|
className={styles.divider}
|
||||||
@@ -90,23 +106,15 @@ export default async function IntroSection({
|
|||||||
color="Border/Divider/Default"
|
color="Border/Divider/Default"
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</span>
|
|
||||||
|
|
||||||
<div className={styles.phoneWrapper}>
|
|
||||||
<Link
|
<Link
|
||||||
href={`tel:${phoneNumber}`}
|
href={`mailto:${email}`}
|
||||||
size="small"
|
size="small"
|
||||||
color="Text/Interactive/Secondary"
|
color="Text/Interactive/Secondary"
|
||||||
textDecoration="underline"
|
|
||||||
variant="icon"
|
variant="icon"
|
||||||
>
|
>
|
||||||
<MaterialIcon icon="phone" color="CurrentColor" size={20} />
|
<MaterialIcon icon="email" color="CurrentColor" size={20} />
|
||||||
{phoneNumber}
|
{email}
|
||||||
</Link>
|
</Link>
|
||||||
<LocalCallCharges
|
|
||||||
className={styles.localCharges}
|
|
||||||
country={country}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</address>
|
</address>
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.localCharges::before {
|
.localCharges::before {
|
||||||
content: "(";
|
content: " (";
|
||||||
}
|
}
|
||||||
|
|
||||||
.localCharges::after {
|
.localCharges::after {
|
||||||
@@ -39,60 +39,44 @@
|
|||||||
gap: var(--Space-x2);
|
gap: var(--Space-x2);
|
||||||
}
|
}
|
||||||
|
|
||||||
.addressPhoneNumber {
|
.contactAddress,
|
||||||
font-style: normal;
|
.contactInformation {
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: var(--Space-x15);
|
gap: var(--Space-x1);
|
||||||
align-items: center;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.address {
|
.contactAddress {
|
||||||
color: var(--Text-Secondary);
|
font-style: normal;
|
||||||
gap: var(--Space-x05);
|
|
||||||
align-items: flex-start;
|
|
||||||
display: flex;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.location {
|
.location {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: var(--Space-x2);
|
gap: var(--Space-x05);
|
||||||
height: 100%;
|
align-items: center;
|
||||||
|
color: var(--Text-Secondary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.divider {
|
.phoneNumber {
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.phoneWrapper {
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: var(--Space-x15);
|
gap: var(--Space-x15);
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (min-width: 767px) {
|
@media screen and (max-width: 767px) {
|
||||||
.addressPhoneNumber {
|
.divider {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (min-width: 768px) {
|
||||||
|
.contactInformation:not(.stacked) {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
gap: var(--Space-x2);
|
gap: var(--Space-x2);
|
||||||
}
|
}
|
||||||
|
|
||||||
.addressPhoneNumber.stacked {
|
.phoneNumber {
|
||||||
display: grid;
|
|
||||||
gap: var(--Space-x15);
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.address {
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.phoneWrapper {
|
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
gap: var(--Space-x1);
|
gap: var(--Space-x1);
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.divider {
|
|
||||||
display: block;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ export default async function HotelPage({
|
|||||||
location={location}
|
location={location}
|
||||||
address={address}
|
address={address}
|
||||||
tripAdvisor={ratings?.tripAdvisor}
|
tripAdvisor={ratings?.tripAdvisor}
|
||||||
phoneNumber={contactInformation.phoneNumber}
|
contactInformation={contactInformation}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<AmenitiesList detailedFacilities={detailedFacilities} />
|
<AmenitiesList detailedFacilities={detailedFacilities} />
|
||||||
|
|||||||
Reference in New Issue
Block a user