fix: correct Shortcuts
This commit is contained in:
@@ -66,9 +66,13 @@ export default function Content({ user, lang, content }: ContentProps) {
|
||||
/>
|
||||
)
|
||||
case ContentEntries.AccountPageContentShortcuts:
|
||||
const shortcuts = item.shortcuts.shortcuts.map(
|
||||
(shortcut) => shortcut.linkConnection.edges[0].node
|
||||
)
|
||||
const shortcuts = item.shortcuts.shortcuts.map((shortcut) => {
|
||||
return {
|
||||
text: shortcut.text,
|
||||
openInNewTab: shortcut.open_in_new_tab,
|
||||
...shortcut.linkConnection.edges[0].node,
|
||||
}
|
||||
})
|
||||
return (
|
||||
<Shortcuts
|
||||
shortcuts={shortcuts}
|
||||
|
||||
@@ -26,8 +26,9 @@ export default function Shortcuts({
|
||||
className={styles.link}
|
||||
href={shortcut.url}
|
||||
key={shortcut.title}
|
||||
target={shortcut.openInNewTab ? "_blank" : undefined}
|
||||
>
|
||||
<span>{shortcut.title}</span>
|
||||
<span>{shortcut.text ? shortcut.text : shortcut.title}</span>
|
||||
<Image
|
||||
alt="Chevron Icon"
|
||||
height={20}
|
||||
|
||||
@@ -7,6 +7,8 @@ fragment AccountPageContentShortcuts on AccountPageContentShortcuts {
|
||||
title
|
||||
preamble
|
||||
shortcuts {
|
||||
text
|
||||
open_in_new_tab
|
||||
linkConnection {
|
||||
edges {
|
||||
node {
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
import { ReactNode } from "react"
|
||||
|
||||
export type ShortcutsProps = {
|
||||
shortcuts: { url: string; title: string }[]
|
||||
shortcuts: {
|
||||
url: string
|
||||
title: string
|
||||
openInNewTab?: boolean
|
||||
text?: string
|
||||
}[]
|
||||
title: string | ReactNode
|
||||
subtitle?: string
|
||||
openInNewTab?: boolean
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { AllRequestResponse } from "../utils/all"
|
||||
import type { Typename } from "../utils/typename"
|
||||
import type { Edges } from "../utils/edges"
|
||||
import { PageLink } from "../utils/pageLink"
|
||||
|
||||
import { RTEDocument } from "@/types/rte/node"
|
||||
import type { Edges } from "../utils/edges"
|
||||
import type { Typename } from "../utils/typename"
|
||||
|
||||
export enum DynamicContentComponents {
|
||||
membership_overview = "membership_overview",
|
||||
@@ -20,8 +21,9 @@ export enum ContentEntries {
|
||||
}
|
||||
|
||||
type Shortcut = {
|
||||
text: string
|
||||
linkConnection: Edges<PageLink>
|
||||
open_in_new_tab: boolean
|
||||
text: string
|
||||
}
|
||||
|
||||
type DynamicContent = {
|
||||
|
||||
Reference in New Issue
Block a user