fix: production readiness things

This commit is contained in:
Michael Zetterberg
2024-08-26 16:31:23 +02:00
parent 6d0e01d4e4
commit 233374ca24
2 changed files with 28 additions and 3 deletions

View File

@@ -131,6 +131,8 @@ export const editProfile = protectedServerActionProcedure
message: intl.formatMessage({ id: "Successfully updated profile!" }),
status: Status.success,
}
} else {
console.log(`[edit profile] body: ${JSON.stringify(body)}`)
}
const apiResponse = await api.patch(api.endpoints.v1.profile, {

View File

@@ -1,4 +1,5 @@
"use client"
import { usePathname } from "next/navigation"
import { useIntl } from "react-intl"
import { logout } from "@/constants/routes/handleAuth"
@@ -31,6 +32,28 @@ export function MainMenu({
}: MainMenuProps) {
const intl = useIntl()
const lang = useLang()
const pathname = usePathname()
const isThreeStaticPagesPathnames = [
"/de/sponsoring",
"/en/sponsoring",
"/da/sponsorering",
"/fi/sponsorointi",
"/no/vi-sponser",
"/sv/vi-sponsrar",
"/de/scandic-entdecken/wlan",
"/en/explore-scandic/wifi",
"/da/oplev-scandic/wifi",
"/fi/koe-scandic/maksuton-internetyhteys",
"/no/utforsk-scandic/wifi",
"/sv/utforska-scandic/wi-fi",
"/de/kundenbetreuung/haufig-gestellte-fragen/nutzung-der-internetseite",
"/en/customer-service/frequently-asked-questions/using-the-website",
"/da/kundeservice/sporgsmal-og-svar/om-scandics-website",
"/fi/asiakaspalvelu/usein-kysytyt-kysymykset/tietoja-internetsivuista",
"/no/kundeservice/sporsmal-og-svar/bruk-av-nettsiden",
"/sv/kundservice/fragor-och-svar/om-scandics-webbplats",
].includes(pathname)
const {
isHamburgerMenuOpen,
@@ -85,7 +108,7 @@ export function MainMenu({
className={`${styles.listWrapper} ${isHamburgerMenuOpen ? styles.isOpen : ""}`}
>
<ul className={styles.linkRow}>
{!!user ? (
{!isThreeStaticPagesPathnames && !!user ? (
<>
<li className={styles.mobileLinkRow}>
<Link
@@ -180,14 +203,14 @@ export function MainMenu({
</ul>
<div className={styles.buttonContainer}>
<div className={styles.myPagesDesktopLink}>
{user ? (
{!isThreeStaticPagesPathnames && user ? (
<Link className={styles.link} href={myPages[lang]}>
{intl.formatMessage({ id: "My pages" })}
</Link>
) : null}
</div>
<BookingButton href={bookingHref} />
{myPagesMobileDropdown && user ? (
{!isThreeStaticPagesPathnames && myPagesMobileDropdown && user ? (
<div
role="button"
onClick={handleMyPagesMobileMenuClick}