fix: production readiness things
This commit is contained in:
@@ -131,6 +131,8 @@ export const editProfile = protectedServerActionProcedure
|
|||||||
message: intl.formatMessage({ id: "Successfully updated profile!" }),
|
message: intl.formatMessage({ id: "Successfully updated profile!" }),
|
||||||
status: Status.success,
|
status: Status.success,
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
console.log(`[edit profile] body: ${JSON.stringify(body)}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
const apiResponse = await api.patch(api.endpoints.v1.profile, {
|
const apiResponse = await api.patch(api.endpoints.v1.profile, {
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
"use client"
|
"use client"
|
||||||
|
import { usePathname } from "next/navigation"
|
||||||
import { useIntl } from "react-intl"
|
import { useIntl } from "react-intl"
|
||||||
|
|
||||||
import { logout } from "@/constants/routes/handleAuth"
|
import { logout } from "@/constants/routes/handleAuth"
|
||||||
@@ -31,6 +32,28 @@ export function MainMenu({
|
|||||||
}: MainMenuProps) {
|
}: MainMenuProps) {
|
||||||
const intl = useIntl()
|
const intl = useIntl()
|
||||||
const lang = useLang()
|
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 {
|
const {
|
||||||
isHamburgerMenuOpen,
|
isHamburgerMenuOpen,
|
||||||
@@ -85,7 +108,7 @@ export function MainMenu({
|
|||||||
className={`${styles.listWrapper} ${isHamburgerMenuOpen ? styles.isOpen : ""}`}
|
className={`${styles.listWrapper} ${isHamburgerMenuOpen ? styles.isOpen : ""}`}
|
||||||
>
|
>
|
||||||
<ul className={styles.linkRow}>
|
<ul className={styles.linkRow}>
|
||||||
{!!user ? (
|
{!isThreeStaticPagesPathnames && !!user ? (
|
||||||
<>
|
<>
|
||||||
<li className={styles.mobileLinkRow}>
|
<li className={styles.mobileLinkRow}>
|
||||||
<Link
|
<Link
|
||||||
@@ -180,14 +203,14 @@ export function MainMenu({
|
|||||||
</ul>
|
</ul>
|
||||||
<div className={styles.buttonContainer}>
|
<div className={styles.buttonContainer}>
|
||||||
<div className={styles.myPagesDesktopLink}>
|
<div className={styles.myPagesDesktopLink}>
|
||||||
{user ? (
|
{!isThreeStaticPagesPathnames && user ? (
|
||||||
<Link className={styles.link} href={myPages[lang]}>
|
<Link className={styles.link} href={myPages[lang]}>
|
||||||
{intl.formatMessage({ id: "My pages" })}
|
{intl.formatMessage({ id: "My pages" })}
|
||||||
</Link>
|
</Link>
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
<BookingButton href={bookingHref} />
|
<BookingButton href={bookingHref} />
|
||||||
{myPagesMobileDropdown && user ? (
|
{!isThreeStaticPagesPathnames && myPagesMobileDropdown && user ? (
|
||||||
<div
|
<div
|
||||||
role="button"
|
role="button"
|
||||||
onClick={handleMyPagesMobileMenuClick}
|
onClick={handleMyPagesMobileMenuClick}
|
||||||
|
|||||||
Reference in New Issue
Block a user