Merged in chore/delete-unused-files (pull request #3346)
chore: Delete unused files * Delete unused files Ignore design-system for now Approved-by: Joakim Jäderberg
This commit is contained in:
@@ -1,110 +0,0 @@
|
||||
import { Suspense } from "react"
|
||||
|
||||
import ButtonLink from "@scandic-hotels/design-system/ButtonLink"
|
||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||
import { TrackingSDK } from "@scandic-hotels/tracking/TrackingSDK"
|
||||
|
||||
import Blocks from "@/components/Blocks"
|
||||
import HeaderDynamicContent from "@/components/Headers/DynamicContent"
|
||||
import Hero from "@/components/Hero"
|
||||
import { HeroVideo } from "@/components/HeroVideo"
|
||||
import MeetingPackageWidget from "@/components/MeetingPackageWidget"
|
||||
import Sidebar from "@/components/Sidebar"
|
||||
import SidebarSkeleton from "@/components/Sidebar/SidebarSkeleton"
|
||||
import LinkChips from "@/components/TempDesignSystem/LinkChips"
|
||||
|
||||
import { staticPageVariants } from "./variants"
|
||||
|
||||
import styles from "./staticPage.module.css"
|
||||
|
||||
import type { StaticPageProps } from "./staticPage"
|
||||
|
||||
export default async function StaticPage({
|
||||
content,
|
||||
tracking,
|
||||
pageType,
|
||||
}: StaticPageProps) {
|
||||
const { blocks, hero_image, hero_video, header, meeting_package } = content
|
||||
|
||||
return (
|
||||
<>
|
||||
<section className={staticPageVariants({ pageType })}>
|
||||
<header className={styles.header}>
|
||||
<div className={styles.headerContent}>
|
||||
{header ? (
|
||||
<>
|
||||
<div className={styles.headerIntro}>
|
||||
<Typography variant="Title/lg">
|
||||
<h1 className={styles.heading}>{header.heading}</h1>
|
||||
</Typography>
|
||||
<Typography variant="Body/Lead text">
|
||||
<p>{header.preamble}</p>
|
||||
</Typography>
|
||||
</div>
|
||||
{header.top_primary_button?.url ? (
|
||||
<ButtonLink
|
||||
href={header.top_primary_button.url}
|
||||
size="Medium"
|
||||
variant="Tertiary"
|
||||
className={styles.button}
|
||||
>
|
||||
{header.top_primary_button.title}
|
||||
</ButtonLink>
|
||||
) : null}
|
||||
{header.navigation_links ? (
|
||||
<LinkChips chips={header.navigation_links} />
|
||||
) : null}
|
||||
{"dynamic_content" in header &&
|
||||
header.dynamic_content !== null &&
|
||||
header.dynamic_content !== undefined ? (
|
||||
<HeaderDynamicContent {...header.dynamic_content} />
|
||||
) : null}
|
||||
</>
|
||||
) : null}
|
||||
</div>
|
||||
</header>
|
||||
|
||||
{hero_video || hero_image ? (
|
||||
<div className={styles.heroWrapper}>
|
||||
{hero_video ? (
|
||||
<HeroVideo
|
||||
className={styles.heroVideo}
|
||||
src={hero_video.src}
|
||||
focalPoint={hero_video.focalPoint}
|
||||
captions={hero_video.captions}
|
||||
/>
|
||||
) : null}
|
||||
{!hero_video && hero_image ? (
|
||||
<Hero
|
||||
className={styles.heroImage}
|
||||
alt={hero_image.meta.alt || hero_image.meta.caption || ""}
|
||||
src={hero_image.url}
|
||||
focalPoint={hero_image.focalPoint}
|
||||
dimensions={hero_image.dimensions}
|
||||
/>
|
||||
) : null}
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
<div className={styles.contentContainer}>
|
||||
<main className={styles.mainContent}>
|
||||
{pageType === "collection" && meeting_package?.show_widget && (
|
||||
<MeetingPackageWidget
|
||||
destination={meeting_package.location}
|
||||
className={styles.meetingPackageWidget}
|
||||
/>
|
||||
)}
|
||||
{blocks ? <Blocks blocks={blocks} /> : null}
|
||||
</main>
|
||||
|
||||
{"sidebar" in content && content.sidebar?.length ? (
|
||||
<Suspense fallback={<SidebarSkeleton />}>
|
||||
<Sidebar blocks={content.sidebar} />
|
||||
</Suspense>
|
||||
) : null}
|
||||
</div>
|
||||
</section>
|
||||
<TrackingSDK pageData={tracking} />
|
||||
</>
|
||||
)
|
||||
}
|
||||
@@ -1,112 +0,0 @@
|
||||
.page {
|
||||
padding-bottom: var(--Space-x9);
|
||||
}
|
||||
|
||||
.header {
|
||||
background-color: var(--Base-Surface-Subtle-Normal);
|
||||
padding-bottom: var(--Space-x4);
|
||||
}
|
||||
|
||||
.headerContent {
|
||||
display: grid;
|
||||
gap: var(--Space-x3);
|
||||
max-width: var(--max-width-content);
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.headerIntro {
|
||||
display: grid;
|
||||
max-width: var(--max-width-text-block);
|
||||
gap: var(--Space-x3);
|
||||
}
|
||||
|
||||
.heading {
|
||||
color: var(--Text-Heading);
|
||||
text-wrap: balance;
|
||||
hyphens: auto;
|
||||
}
|
||||
|
||||
.heroWrapper {
|
||||
padding: var(--Space-x4) var(--Space-x2);
|
||||
}
|
||||
|
||||
.heroImage,
|
||||
.heroVideo {
|
||||
max-width: var(--max-width-content);
|
||||
margin: 0 auto;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.contentContainer {
|
||||
width: 100%;
|
||||
padding: var(--Space-x4) var(--Space-x2) 0;
|
||||
}
|
||||
|
||||
.content .contentContainer {
|
||||
display: grid;
|
||||
grid-template-areas:
|
||||
"main"
|
||||
"sidebar";
|
||||
gap: var(--Space-x4);
|
||||
align-items: start;
|
||||
}
|
||||
|
||||
.mainContent {
|
||||
display: grid;
|
||||
width: 100%;
|
||||
gap: var(--Space-x6);
|
||||
margin: 0 auto;
|
||||
max-width: var(--max-width-content);
|
||||
}
|
||||
|
||||
.content .mainContent {
|
||||
grid-area: main;
|
||||
}
|
||||
|
||||
.meetingPackageWidget {
|
||||
border-radius: var(--Corner-radius-lg);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.button {
|
||||
width: fit-content;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.contentContainer {
|
||||
padding: var(--Space-x4) 0;
|
||||
max-width: var(--max-width-content);
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.heroContainer {
|
||||
padding: var(--Space-x4) 0;
|
||||
}
|
||||
|
||||
.headerIntro {
|
||||
gap: var(--Space-x3);
|
||||
}
|
||||
}
|
||||
|
||||
/* Meeting booking widget changes design at 948px */
|
||||
@media screen and (min-width: 948px) {
|
||||
.meetingPackageWidget {
|
||||
background-color: var(--Base-Surface-Primary-light-Normal);
|
||||
box-shadow: 0px 4px 24px 0px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1367px) {
|
||||
.content .contentContainer {
|
||||
grid-template-areas: "main sidebar";
|
||||
grid-template-columns: var(--max-width-text-block) 1fr;
|
||||
gap: var(--Space-x9);
|
||||
}
|
||||
|
||||
.mainContent {
|
||||
gap: var(--Space-x9);
|
||||
padding: 0;
|
||||
max-width: none;
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
import type { TrackingSDKPageData } from "@scandic-hotels/tracking/types"
|
||||
import type { CollectionPage } from "@scandic-hotels/trpc/types/collectionPage"
|
||||
import type { ContentPage } from "@scandic-hotels/trpc/types/contentPage"
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
|
||||
import type { staticPageVariants } from "./variants"
|
||||
|
||||
export interface StaticPageProps
|
||||
extends Omit<React.HTMLAttributes<HTMLDivElement>, "content">,
|
||||
VariantProps<typeof staticPageVariants> {
|
||||
pageType?: "collection" | "content"
|
||||
content: CollectionPage["collection_page"] | ContentPage["content_page"]
|
||||
tracking: TrackingSDKPageData
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
import { cva } from "class-variance-authority"
|
||||
|
||||
import styles from "./staticPage.module.css"
|
||||
|
||||
export const staticPageVariants = cva(styles.page, {
|
||||
variants: {
|
||||
pageType: {
|
||||
collection: styles.collection,
|
||||
content: styles.content,
|
||||
},
|
||||
},
|
||||
defaultVariants: {
|
||||
pageType: "content",
|
||||
},
|
||||
})
|
||||
@@ -1,9 +0,0 @@
|
||||
import type { FocalPoint } from "@scandic-hotels/common/utils/imageVault"
|
||||
import type { Image } from "@scandic-hotels/trpc/types/image"
|
||||
|
||||
export interface HeroProps {
|
||||
alt: string
|
||||
src: string
|
||||
focalPoint?: FocalPoint
|
||||
dimensions?: Image["dimension"]
|
||||
}
|
||||
@@ -1,102 +0,0 @@
|
||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||
import Link from "@scandic-hotels/design-system/OldDSLink"
|
||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||
|
||||
import { getMembershipCards } from "@/lib/trpc/memoizedRequests"
|
||||
|
||||
import { getIntl } from "@/i18n"
|
||||
|
||||
import styles from "./membershipcards.module.css"
|
||||
|
||||
export default async function MembershipCardSlot() {
|
||||
const intl = await getIntl()
|
||||
const membershipCards = await getMembershipCards()
|
||||
|
||||
return (
|
||||
<section className={styles.container}>
|
||||
<div className={styles.content}>
|
||||
<Typography variant="Title/Subtitle/md">
|
||||
<h3>
|
||||
{intl.formatMessage({
|
||||
id: "myPages.myMembershipCards",
|
||||
defaultMessage: "My membership cards",
|
||||
})}
|
||||
</h3>
|
||||
</Typography>
|
||||
</div>
|
||||
{(membershipCards || []).map((card, idx) => (
|
||||
<div className={styles.card} key={idx}>
|
||||
<Typography variant="Title/Subtitle/md">
|
||||
<h4 className={styles.subTitle}>
|
||||
{intl.formatMessage(
|
||||
{
|
||||
id: "myPages.nameWithCardMembershipType",
|
||||
defaultMessage: "Name: {cardMembershipType}",
|
||||
},
|
||||
{
|
||||
cardMembershipType: card.membershipType,
|
||||
}
|
||||
)}
|
||||
</h4>
|
||||
</Typography>
|
||||
<span>
|
||||
{intl.formatMessage(
|
||||
{
|
||||
id: "myPages.currentPointsWithPoints",
|
||||
defaultMessage: "Current Points: {points, number}",
|
||||
},
|
||||
{ points: card.currentPoints }
|
||||
)}
|
||||
</span>
|
||||
<span>
|
||||
{intl.formatMessage(
|
||||
{
|
||||
id: "myPages.memberSinceWithValue",
|
||||
defaultMessage: "Member Since: {value}",
|
||||
},
|
||||
{
|
||||
value: card.memberSince,
|
||||
}
|
||||
)}
|
||||
</span>
|
||||
<span data-hj-suppress>
|
||||
{intl.formatMessage(
|
||||
{
|
||||
id: "myPages.numberWithValue",
|
||||
defaultMessage: "Number: {membershipNumber}",
|
||||
},
|
||||
{
|
||||
membershipNumber: card.membershipNumber,
|
||||
}
|
||||
)}
|
||||
</span>
|
||||
<span>
|
||||
{intl.formatMessage(
|
||||
{
|
||||
id: "myPages.expirationDateWithDate",
|
||||
defaultMessage: "Expiration Date: {expirationDate}",
|
||||
},
|
||||
{
|
||||
expirationDate: card.expirationDate?.split("T")[0],
|
||||
}
|
||||
)}
|
||||
</span>
|
||||
</div>
|
||||
))}
|
||||
<Link href="#" variant="icon">
|
||||
<MaterialIcon icon="add_circle" color="CurrentColor" />
|
||||
<Typography
|
||||
variant="Body/Paragraph/mdRegular"
|
||||
className={styles.addNewCardText}
|
||||
>
|
||||
<p>
|
||||
{intl.formatMessage({
|
||||
id: "myPages.addNewCard",
|
||||
defaultMessage: "Add new card",
|
||||
})}
|
||||
</p>
|
||||
</Typography>
|
||||
</Link>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
.container {
|
||||
display: grid;
|
||||
gap: var(--Space-x3);
|
||||
max-width: 510px;
|
||||
}
|
||||
|
||||
.content {
|
||||
display: grid;
|
||||
gap: var(--Space-x1);
|
||||
}
|
||||
|
||||
.card {
|
||||
margin-top: var(--Space-x4);
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
grid-template-rows: repeat(3, auto);
|
||||
gap: var(--Space-x1);
|
||||
}
|
||||
|
||||
.subTitle {
|
||||
grid-column: span 2;
|
||||
}
|
||||
|
||||
.addNewCardText {
|
||||
text-decoration: underline;
|
||||
color: var(--Scandic-Brand-Burgundy);
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
|
||||
import type { linkVariants } from "./variants"
|
||||
|
||||
export interface SectionLinkProps
|
||||
extends React.PropsWithChildren<React.HTMLAttributes<HTMLSpanElement>>,
|
||||
VariantProps<typeof linkVariants> {
|
||||
link?: { href: string; text: string }
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
import type { ApiImage } from "@scandic-hotels/trpc/types/hotel"
|
||||
|
||||
export type PreviewImagesProps = {
|
||||
images: ApiImage[]
|
||||
hotelName: string
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
import type { User } from "@scandic-hotels/trpc/types/user"
|
||||
|
||||
export interface FriendProps
|
||||
extends React.PropsWithChildren<Pick<User, "membership" | "name">> {}
|
||||
@@ -1,5 +0,0 @@
|
||||
export type PointsColumnProps = {
|
||||
title: string
|
||||
subtitle?: string
|
||||
value?: number | null
|
||||
}
|
||||
Reference in New Issue
Block a user