Feat/lokalise rebuild * chore(lokalise): update translation ids * chore(lokalise): easier to switch between projects * chore(lokalise): update translation ids * . * . * . * . * . * . * chore(lokalise): update translation ids * chore(lokalise): update translation ids * . * . * . * chore(lokalise): update translation ids * chore(lokalise): update translation ids * . * . * chore(lokalise): update translation ids * chore(lokalise): update translation ids * chore(lokalise): new translations * merge * switch to errors for missing id's * merge * sync translations Approved-by: Linus Flood
75 lines
2.0 KiB
TypeScript
75 lines
2.0 KiB
TypeScript
"use client"
|
|
|
|
import { useIntl } from "react-intl"
|
|
|
|
import ButtonLink from "@scandic-hotels/design-system/ButtonLink"
|
|
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
|
import Modal from "@scandic-hotels/design-system/Modal"
|
|
import { Typography } from "@scandic-hotels/design-system/Typography"
|
|
|
|
import useWakeLock from "@/hooks/useWakeLock"
|
|
|
|
import DigitalTeamMemberCardContent from "./Content"
|
|
|
|
import styles from "./digitalTeamMemberCard.module.css"
|
|
|
|
import type { User } from "@scandic-hotels/trpc/types/user"
|
|
|
|
interface DigitalTeamMemberCardClientProps {
|
|
user: User
|
|
children: React.ReactElement
|
|
}
|
|
|
|
export default function DigitalTeamMemberCardClient({
|
|
user,
|
|
children,
|
|
}: DigitalTeamMemberCardClientProps) {
|
|
const intl = useIntl()
|
|
|
|
const { release, request } = useWakeLock({
|
|
reacquireOnPageVisible: true,
|
|
})
|
|
|
|
function onOpenChange(isOpen: boolean) {
|
|
if (isOpen) {
|
|
request() // Acquire wake lock when modal opens
|
|
} else {
|
|
release() // Release wake lock when modal closes
|
|
}
|
|
}
|
|
|
|
return (
|
|
<Modal
|
|
trigger={children}
|
|
className={styles.modal}
|
|
onOpenChange={onOpenChange}
|
|
>
|
|
<DigitalTeamMemberCardContent user={user} />
|
|
|
|
<Typography variant="Body/Paragraph/mdRegular">
|
|
<p className={styles.footer}>
|
|
{intl.formatMessage({
|
|
id: "myPages.bookDiscountedStaysForSelfFamilyAndFriends",
|
|
defaultMessage:
|
|
"Book discounted stays for yourself, family and friends!",
|
|
})}
|
|
</p>
|
|
</Typography>
|
|
<ButtonLink
|
|
href="https://scandic.fuseuniversal.com/topics/73727"
|
|
target="_blank"
|
|
variant="Tertiary"
|
|
typography="Body/Supporting text (caption)/smBold"
|
|
>
|
|
<span className={styles.link}>
|
|
{intl.formatMessage({
|
|
id: "myPages.checkOutAllYourBenefits",
|
|
defaultMessage: "Check out all your benefits",
|
|
})}
|
|
<MaterialIcon icon="open_in_new" size={20} color="CurrentColor" />
|
|
</span>
|
|
</ButtonLink>
|
|
</Modal>
|
|
)
|
|
}
|