feat(LOY-243): add change name disclaimer to profile
This commit is contained in:
@@ -17,6 +17,7 @@ import { trpc } from "@/lib/trpc/client"
|
|||||||
|
|
||||||
import { editProfile } from "@/actions/editProfile"
|
import { editProfile } from "@/actions/editProfile"
|
||||||
import Dialog from "@/components/Dialog"
|
import Dialog from "@/components/Dialog"
|
||||||
|
import ChangeNameDisclaimer from "@/components/MyPages/Profile/ChangeNameDisclaimer"
|
||||||
import Button from "@/components/TempDesignSystem/Button"
|
import Button from "@/components/TempDesignSystem/Button"
|
||||||
import Title from "@/components/TempDesignSystem/Text/Title"
|
import Title from "@/components/TempDesignSystem/Text/Title"
|
||||||
import { toast } from "@/components/TempDesignSystem/Toasts"
|
import { toast } from "@/components/TempDesignSystem/Toasts"
|
||||||
@@ -120,6 +121,7 @@ export default function Form({ user }: EditFormProps) {
|
|||||||
}, [trigger])
|
}, [trigger])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<>
|
||||||
<section className={styles.container}>
|
<section className={styles.container}>
|
||||||
<div className={styles.title}>
|
<div className={styles.title}>
|
||||||
<Title as="h4" color="red" level="h1" textTransform="capitalize">
|
<Title as="h4" color="red" level="h1" textTransform="capitalize">
|
||||||
@@ -173,7 +175,6 @@ export default function Form({ user }: EditFormProps) {
|
|||||||
})}
|
})}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form
|
<form
|
||||||
/**
|
/**
|
||||||
* Ignoring since ts doesn't recognize that tRPC
|
* Ignoring since ts doesn't recognize that tRPC
|
||||||
@@ -189,5 +190,8 @@ export default function Form({ user }: EditFormProps) {
|
|||||||
</FormProvider>
|
</FormProvider>
|
||||||
</form>
|
</form>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<ChangeNameDisclaimer />
|
||||||
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
.changeNameDisclaimer {
|
||||||
|
display: flex;
|
||||||
|
gap: var(--Space-x1);
|
||||||
|
color: var(--Text-Secondary);
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
"use client"
|
||||||
|
|
||||||
|
import { useIntl } from "react-intl"
|
||||||
|
|
||||||
|
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||||
|
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||||
|
|
||||||
|
import Link from "@/components/TempDesignSystem/Link"
|
||||||
|
|
||||||
|
import styles from "./changeNameDisclaimer.module.css"
|
||||||
|
|
||||||
|
export default function ChangeNameDisclaimer() {
|
||||||
|
const intl = useIntl()
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={styles.changeNameDisclaimer}>
|
||||||
|
<MaterialIcon icon="info" />
|
||||||
|
<Typography variant="Body/Paragraph/mdRegular">
|
||||||
|
<p>
|
||||||
|
{intl.formatMessage(
|
||||||
|
{
|
||||||
|
defaultMessage:
|
||||||
|
"Need to change your name? Please get in touch with member support at <phone>+46 8 517 517 00</phone> or <email>member@scandichotels.com</email>.",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
phone([str]) {
|
||||||
|
return (
|
||||||
|
<Link
|
||||||
|
href={`tel:${str.replaceAll(" ", "")}`}
|
||||||
|
textDecoration="underline"
|
||||||
|
weight="bold"
|
||||||
|
>
|
||||||
|
{str}
|
||||||
|
</Link>
|
||||||
|
)
|
||||||
|
},
|
||||||
|
email(str) {
|
||||||
|
return (
|
||||||
|
<Link
|
||||||
|
href={`mailto:${str}`}
|
||||||
|
textDecoration="underline"
|
||||||
|
weight="bold"
|
||||||
|
>
|
||||||
|
{str}
|
||||||
|
</Link>
|
||||||
|
)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
)}
|
||||||
|
</p>
|
||||||
|
</Typography>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -16,6 +16,8 @@ import { getLang } from "@/i18n/serverContext"
|
|||||||
import { isValidCountry } from "@/utils/countries"
|
import { isValidCountry } from "@/utils/countries"
|
||||||
import { isValidLang } from "@/utils/languages"
|
import { isValidLang } from "@/utils/languages"
|
||||||
|
|
||||||
|
import ChangeNameDisclaimer from "./ChangeNameDisclaimer"
|
||||||
|
|
||||||
import styles from "./profile.module.css"
|
import styles from "./profile.module.css"
|
||||||
|
|
||||||
export default async function Profile() {
|
export default async function Profile() {
|
||||||
@@ -173,6 +175,9 @@ export default async function Profile() {
|
|||||||
</Typography>
|
</Typography>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<ChangeNameDisclaimer />
|
||||||
|
|
||||||
<Divider color="burgundy" opacity={8} />
|
<Divider color="burgundy" opacity={8} />
|
||||||
<CreditCardSlot />
|
<CreditCardSlot />
|
||||||
{/* <MembershipCardSlot /> */}
|
{/* <MembershipCardSlot /> */}
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
display: grid;
|
display: grid;
|
||||||
gap: var(--Space-x3);
|
gap: var(--Space-x3);
|
||||||
padding: var(--Space-x2) var(--Space-x2) var(--Space-x4);
|
padding: var(--Space-x2) var(--Space-x2) var(--Space-x4);
|
||||||
color: var(--Text-Default);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
|
|||||||
Reference in New Issue
Block a user