feat(LOY-195): digital team member card button on my pages overview
This commit is contained in:
@@ -57,6 +57,7 @@ NEXT_PUBLIC_HIDE_FOR_NEXT_RELEASE="false"
|
|||||||
ENABLE_BOOKING_WIDGET="false"
|
ENABLE_BOOKING_WIDGET="false"
|
||||||
ENABLE_BOOKING_WIDGET_HOTELRESERVATION_PATH="false"
|
ENABLE_BOOKING_WIDGET_HOTELRESERVATION_PATH="false"
|
||||||
ENABLE_SURPRISES="true"
|
ENABLE_SURPRISES="true"
|
||||||
|
ENABLE_DTMC="true"
|
||||||
|
|
||||||
SHOW_SITE_WIDE_ALERT="false"
|
SHOW_SITE_WIDE_ALERT="false"
|
||||||
SHOW_SIGNUP_FLOW="true"
|
SHOW_SIGNUP_FLOW="true"
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { getProfile } from "@/lib/trpc/memoizedRequests"
|
import { getProfile } from "@/lib/trpc/memoizedRequests"
|
||||||
|
|
||||||
|
import DigitalTeamMemberCard from "@/components/MyPages/DigitalTeamMemberCard"
|
||||||
import SectionContainer from "@/components/Section/Container"
|
import SectionContainer from "@/components/Section/Container"
|
||||||
import SectionHeader from "@/components/Section/Header"
|
import SectionHeader from "@/components/Section/Header"
|
||||||
import SectionLink from "@/components/Section/Link"
|
import SectionLink from "@/components/Section/Link"
|
||||||
@@ -30,9 +31,10 @@ export default async function Overview({
|
|||||||
link={link}
|
link={link}
|
||||||
preamble={subtitle}
|
preamble={subtitle}
|
||||||
title={title}
|
title={title}
|
||||||
headingAs={"h3"}
|
headingAs="h3"
|
||||||
headingLevel={"h1"}
|
headingLevel="h1"
|
||||||
/>
|
/>
|
||||||
|
<DigitalTeamMemberCard user={user} />
|
||||||
<Hero color="red">
|
<Hero color="red">
|
||||||
<Friend membership={user.membership} name={user.name}>
|
<Friend membership={user.membership} name={user.name}>
|
||||||
<MembershipNumber color="burgundy" membership={user.membership} />
|
<MembershipNumber color="burgundy" membership={user.membership} />
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
.card {
|
||||||
|
padding: var(--Space-x2) var(--Space-x15);
|
||||||
|
border-radius: var(--Corner-radius-md);
|
||||||
|
border: 0;
|
||||||
|
cursor: pointer;
|
||||||
|
background: var(--Surface-Brand-Primary-1-OnSurface-Default);
|
||||||
|
color: var(--Text-Brand-OnPrimary-3-Accent);
|
||||||
|
|
||||||
|
&:focus,
|
||||||
|
&:hover {
|
||||||
|
background:
|
||||||
|
linear-gradient(
|
||||||
|
0deg,
|
||||||
|
rgb(255 255 255 / 10%) 0%,
|
||||||
|
rgb(255 255 255 / 10%) 100%
|
||||||
|
),
|
||||||
|
var(--Surface-Brand-Primary-1-OnSurface-Default);
|
||||||
|
}
|
||||||
|
&:disabled {
|
||||||
|
background: var(--Surface-UI-Fill-Disabled);
|
||||||
|
color: var(--Text-Interactive-Disabled);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.text {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
gap: var(--Space-x1);
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||||
|
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||||
|
|
||||||
|
import { env } from "@/env/server"
|
||||||
|
|
||||||
|
import { getIntl } from "@/i18n"
|
||||||
|
|
||||||
|
import styles from "./digitalTeamMemberCard.module.css"
|
||||||
|
|
||||||
|
import type { User } from "@/types/user"
|
||||||
|
|
||||||
|
interface DigitalTeamMemberCardProps {
|
||||||
|
user: User
|
||||||
|
}
|
||||||
|
|
||||||
|
export default async function DigitalTeamMemberCard(
|
||||||
|
// TODO: Make a check whether user is eligible for benefits or not
|
||||||
|
_props: DigitalTeamMemberCardProps
|
||||||
|
) {
|
||||||
|
if (!env.ENABLE_DTMC) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
const intl = await getIntl()
|
||||||
|
|
||||||
|
return (
|
||||||
|
<button className={styles.card} type="button">
|
||||||
|
<Typography variant="Body/Paragraph/mdBold">
|
||||||
|
<span className={styles.text}>
|
||||||
|
{/* @ts-expect-error Icon is supported in font, just not in React Material Symbols package */}
|
||||||
|
<MaterialIcon icon="id_card" size={24} color="CurrentColor" />
|
||||||
|
{intl.formatMessage({ defaultMessage: "Show Team Member Card" })}
|
||||||
|
</span>
|
||||||
|
</Typography>
|
||||||
|
</button>
|
||||||
|
)
|
||||||
|
}
|
||||||
8
apps/scandic-web/env/server.ts
vendored
8
apps/scandic-web/env/server.ts
vendored
@@ -126,6 +126,13 @@ const _env = createEnv({
|
|||||||
// transform to boolean
|
// transform to boolean
|
||||||
.transform((s) => s === "true")
|
.transform((s) => s === "true")
|
||||||
.default("false"),
|
.default("false"),
|
||||||
|
ENABLE_DTMC: z
|
||||||
|
.string()
|
||||||
|
// only allow "true" or "false"
|
||||||
|
.refine((s) => s === "true" || s === "false")
|
||||||
|
// transform to boolean
|
||||||
|
.transform((s) => s === "true")
|
||||||
|
.default("false"),
|
||||||
SHOW_SITE_WIDE_ALERT: z
|
SHOW_SITE_WIDE_ALERT: z
|
||||||
.string()
|
.string()
|
||||||
// only allow "true" or "false"
|
// only allow "true" or "false"
|
||||||
@@ -267,6 +274,7 @@ const _env = createEnv({
|
|||||||
USE_NEW_REWARD_MODEL: process.env.USE_NEW_REWARD_MODEL,
|
USE_NEW_REWARD_MODEL: process.env.USE_NEW_REWARD_MODEL,
|
||||||
ENABLE_BOOKING_WIDGET: process.env.ENABLE_BOOKING_WIDGET,
|
ENABLE_BOOKING_WIDGET: process.env.ENABLE_BOOKING_WIDGET,
|
||||||
ENABLE_SURPRISES: process.env.ENABLE_SURPRISES,
|
ENABLE_SURPRISES: process.env.ENABLE_SURPRISES,
|
||||||
|
ENABLE_DTMC: process.env.ENABLE_DTMC,
|
||||||
SHOW_SITE_WIDE_ALERT: process.env.SHOW_SITE_WIDE_ALERT,
|
SHOW_SITE_WIDE_ALERT: process.env.SHOW_SITE_WIDE_ALERT,
|
||||||
SENTRY_ENVIRONMENT: process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT,
|
SENTRY_ENVIRONMENT: process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT,
|
||||||
SENTRY_SERVER_SAMPLERATE: process.env.SENTRY_SERVER_SAMPLERATE,
|
SENTRY_SERVER_SAMPLERATE: process.env.SENTRY_SERVER_SAMPLERATE,
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -269,7 +269,7 @@
|
|||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-display: block;
|
font-display: block;
|
||||||
src: url(/_static/fonts/material-symbols/rounded-a03ed056.woff2)
|
src: url(/_static/fonts/material-symbols/rounded-481ed751.woff2)
|
||||||
format('woff2');
|
format('woff2');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -120,6 +120,7 @@ const icons = [
|
|||||||
'hot_tub',
|
'hot_tub',
|
||||||
'houseboat',
|
'houseboat',
|
||||||
'hvac',
|
'hvac',
|
||||||
|
'id_card',
|
||||||
'imagesmode',
|
'imagesmode',
|
||||||
'info',
|
'info',
|
||||||
'iron',
|
'iron',
|
||||||
|
|||||||
Reference in New Issue
Block a user