Merged in feature/hardcoded-mypages-links (pull request #1325)
Feature/hardcoded mypages links * feat: wip use hardcoded links * Merge branch 'master' of bitbucket.org:scandic-swap/web into feature/hardcoded-mypages-links * feat: use hardcoded links for my pages to support dynamic links * cleanup * code fixes * refactor: restructure MyPagesMobileDropdown component for improved readability * use util timeout function Approved-by: Christian Andolf Approved-by: Linus Flood
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
import { MembershipLevelEnum } from "@/constants/membershipLevels"
|
||||
import {
|
||||
getMembershipLevelSafely,
|
||||
getMyPagesNavigation,
|
||||
getName,
|
||||
} from "@/lib/trpc/memoizedRequests"
|
||||
import { getMembershipLevelSafely, getName } from "@/lib/trpc/memoizedRequests"
|
||||
import { serverClient } from "@/lib/trpc/server"
|
||||
|
||||
import LoginButton from "@/components/LoginButton"
|
||||
import {
|
||||
getPrimaryLinks,
|
||||
getSecondaryLinks,
|
||||
} from "@/components/MyPages/menuItems"
|
||||
import { getIntl } from "@/i18n"
|
||||
import { getLang } from "@/i18n/serverContext"
|
||||
|
||||
import Avatar from "../Avatar"
|
||||
import MyPagesMenu, { MyPagesMenuSkeleton } from "../MyPagesMenu"
|
||||
@@ -18,12 +19,15 @@ import MyPagesMobileMenu, {
|
||||
import styles from "./myPagesMenuWrapper.module.css"
|
||||
|
||||
export default async function MyPagesMenuWrapper() {
|
||||
const [intl, myPagesNavigation, user, membership] = await Promise.all([
|
||||
getIntl(),
|
||||
getMyPagesNavigation(),
|
||||
getName(),
|
||||
getMembershipLevelSafely(),
|
||||
])
|
||||
const lang = getLang()
|
||||
const [intl, user, membership, primaryLinks, secondaryLinks] =
|
||||
await Promise.all([
|
||||
getIntl(),
|
||||
getName(),
|
||||
getMembershipLevelSafely(),
|
||||
getPrimaryLinks({ lang }),
|
||||
getSecondaryLinks({ lang }),
|
||||
])
|
||||
|
||||
const membershipLevel = membership?.membershipLevel
|
||||
? await serverClient().contentstack.loyaltyLevels.byLevel({
|
||||
@@ -38,13 +42,15 @@ export default async function MyPagesMenuWrapper() {
|
||||
<MyPagesMenu
|
||||
membershipLevel={membershipLevel}
|
||||
membership={membership}
|
||||
navigation={myPagesNavigation}
|
||||
primaryLinks={primaryLinks}
|
||||
secondaryLinks={secondaryLinks}
|
||||
user={user}
|
||||
/>
|
||||
<MyPagesMobileMenu
|
||||
membershipLevel={membershipLevel}
|
||||
membership={membership}
|
||||
navigation={myPagesNavigation}
|
||||
primaryLinks={primaryLinks}
|
||||
secondaryLinks={secondaryLinks}
|
||||
user={user}
|
||||
/>
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user