Merged in feat/3614-basicInfo (pull request #3427)
feat(SW-3614): use new loyalty prop in basicProfile * feat(SW-3614): use new loyalty prop in basicProfile * PR fixes Approved-by: Matilda Landström
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import ButtonLink from "@scandic-hotels/design-system/ButtonLink"
|
||||
import Image from "@scandic-hotels/design-system/Image"
|
||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||
import { getEurobonusMembership } from "@scandic-hotels/trpc/routers/user/helpers"
|
||||
import { scandicMembershipTypes } from "@scandic-hotels/trpc/routers/user/helpers"
|
||||
|
||||
import { getProfile } from "@/lib/trpc/memoizedRequests"
|
||||
import { getBasicProfileSafely } from "@/lib/trpc/memoizedRequests"
|
||||
|
||||
import { getIntl } from "@/i18n"
|
||||
import desktopBackground from "@/public/_static/img/sas/sas-scandic-link-account-banner-desktop.png"
|
||||
@@ -17,12 +17,14 @@ export default async function SASLinkAccountBanner(
|
||||
props: DynamicContentProps["dynamic_content"]
|
||||
) {
|
||||
const intl = await getIntl()
|
||||
const user = await getProfile()
|
||||
const user = await getBasicProfileSafely()
|
||||
|
||||
if (!user || "error" in user || !user.loyalty) {
|
||||
return null
|
||||
}
|
||||
const sasMembership = getEurobonusMembership(user.loyalty)
|
||||
const sasMembership = user.loyalty.memberships?.some(
|
||||
(m) => m.membershipType === scandicMembershipTypes.SAS_EB
|
||||
)
|
||||
if (sasMembership) {
|
||||
return null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user