Merged in feat/LOY-422-new-upcoming-stays (pull request #3121)
feat(LOY-422): Upcoming Stays Redesign * feat(LOY-422): Upcoming Stays Redesign * feat(LOY-422): Carousel next/previous arrows * chore(LOY-422): add new material icon * refactor(LOY-422): restructure new and old upcoming stays * fix(LOY-422): handle less than 1 case * chore(LOY-422): remove uneeded id * chore(LOY-422): remove intl label for date edge case Approved-by: Matilda Landström
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
display: grid;
|
||||
gap: var(--Space-x3);
|
||||
align-items: center;
|
||||
grid-template-areas:
|
||||
grid-template-areas:
|
||||
"availableRoomsCount"
|
||||
"noAvailabilityAlert"
|
||||
"filters";
|
||||
@@ -26,7 +26,8 @@
|
||||
@media screen and (min-width: 768px) {
|
||||
.container {
|
||||
grid-template-columns: 1fr auto;
|
||||
grid-template-areas: "availableRoomsCount filters"
|
||||
"noAvailabilityAlert noAvailabilityAlert";
|
||||
grid-template-areas:
|
||||
"availableRoomsCount filters"
|
||||
"noAvailabilityAlert noAvailabilityAlert";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -276,7 +276,7 @@
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
font-display: block;
|
||||
src: url(/_static/shared/fonts/material-symbols/rounded-1db5531f.woff2)
|
||||
src: url(/_static/shared/fonts/material-symbols/rounded-1b8067b7.woff2)
|
||||
format('woff2');
|
||||
}
|
||||
|
||||
|
||||
8
packages/trpc/env/server.ts
vendored
8
packages/trpc/env/server.ts
vendored
@@ -36,6 +36,13 @@ export const env = createEnv({
|
||||
SENTRY_ENVIRONMENT: z.string().default("development"),
|
||||
PUBLIC_URL: z.string().default(""),
|
||||
SALESFORCE_PREFERENCE_BASE_URL: z.string(),
|
||||
NEW_STAYS_ON_MY_PAGES: z
|
||||
.string()
|
||||
// only allow "true" or "false"
|
||||
.refine((s) => s === "true" || s === "false")
|
||||
// transform to boolean
|
||||
.transform((s) => s === "true")
|
||||
.default("false"),
|
||||
},
|
||||
emptyStringAsUndefined: true,
|
||||
runtimeEnv: {
|
||||
@@ -56,5 +63,6 @@ export const env = createEnv({
|
||||
SENTRY_ENVIRONMENT: process.env.SENTRY_ENVIRONMENT,
|
||||
PUBLIC_URL: process.env.NEXT_PUBLIC_PUBLIC_URL,
|
||||
SALESFORCE_PREFERENCE_BASE_URL: process.env.SALESFORCE_PREFERENCE_BASE_URL,
|
||||
NEW_STAYS_ON_MY_PAGES: process.env.NEW_STAYS_ON_MY_PAGES,
|
||||
},
|
||||
})
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { createCounter } from "@scandic-hotels/common/telemetry"
|
||||
import { safeTry } from "@scandic-hotels/common/utils/safeTry"
|
||||
|
||||
import { env } from "../../../../env/server"
|
||||
import { router } from "../../.."
|
||||
import * as api from "../../../api"
|
||||
import { Transactions } from "../../../enums/transactions"
|
||||
@@ -184,6 +185,20 @@ export const userQueryRouter = router({
|
||||
language
|
||||
)
|
||||
|
||||
if (env.NEW_STAYS_ON_MY_PAGES) {
|
||||
if (updatedData.length <= 1) {
|
||||
// If there are 1 or fewer stays, return null since NextStay handles this
|
||||
return null
|
||||
}
|
||||
|
||||
// If there are multiple stays, filter out the first one since NextStay shows it
|
||||
const filteredData = updatedData.slice(1)
|
||||
return {
|
||||
data: filteredData,
|
||||
nextCursor,
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
data: updatedData,
|
||||
nextCursor,
|
||||
|
||||
Reference in New Issue
Block a user