diff --git a/app/[lang]/webview/refresh/page.tsx b/app/[lang]/webview/refresh/page.tsx
new file mode 100644
index 000000000..1fe6ee753
--- /dev/null
+++ b/app/[lang]/webview/refresh/page.tsx
@@ -0,0 +1,3 @@
+export default function Refresh() {
+ return Hey you've been refreshed
+}
diff --git a/components/Loyalty/Blocks/WebView/index.tsx b/components/Loyalty/Blocks/WebView/index.tsx
new file mode 100644
index 000000000..f5b5fea0f
--- /dev/null
+++ b/components/Loyalty/Blocks/WebView/index.tsx
@@ -0,0 +1,66 @@
+import JsonToHtml from "@/components/JsonToHtml"
+import DynamicContentBlock from "@/components/Loyalty/Blocks/DynamicContent"
+import Shortcuts from "@/components/MyPages/Blocks/Shortcuts"
+import { modWebviewLink } from "@/utils/webviews"
+
+import CardGrid from "../CardGrid"
+
+import type { BlocksProps } from "@/types/components/loyalty/blocks"
+import { LoyaltyBlocksTypenameEnum } from "@/types/components/loyalty/enums"
+import { LangParams } from "@/types/params"
+
+export function Blocks({ lang, blocks }: BlocksProps & LangParams) {
+ return blocks.map((block) => {
+ switch (block.__typename) {
+ case LoyaltyBlocksTypenameEnum.LoyaltyPageBlocksCardGrid:
+ const cardGrid = {
+ ...block.card_grid,
+ cards: block.card_grid.cards.map((card) => {
+ return {
+ ...card,
+ link: card.link
+ ? { ...card.link, href: modWebviewLink(card.link.href, lang) }
+ : undefined,
+ }
+ }),
+ }
+
+ return
+ case LoyaltyBlocksTypenameEnum.LoyaltyPageBlocksContent:
+ return (
+
+ )
+ case LoyaltyBlocksTypenameEnum.LoyaltyPageBlocksDynamicContent:
+ const dynamicContent = {
+ ...block.dynamic_content,
+ linK: block.dynamic_content.link
+ ? {
+ ...block.dynamic_content.link,
+ href: modWebviewLink(block.dynamic_content.link.href, lang),
+ }
+ : undefined,
+ }
+
+ return
+ case LoyaltyBlocksTypenameEnum.LoyaltyPageBlocksShortcuts:
+ const shortcuts = block.shortcuts.shortcuts.map((shortcut) => ({
+ ...shortcut,
+ url: modWebviewLink(shortcut.url, lang),
+ }))
+ return (
+
+ )
+ default:
+ return null
+ }
+ })
+}
diff --git a/components/MyPages/AccountPage/Webview/Content.tsx b/components/MyPages/AccountPage/Webview/Content.tsx
index 97fd548d9..29cee02f2 100644
--- a/components/MyPages/AccountPage/Webview/Content.tsx
+++ b/components/MyPages/AccountPage/Webview/Content.tsx
@@ -1,6 +1,7 @@
import JsonToHtml from "@/components/JsonToHtml"
import Overview from "@/components/MyPages/Blocks/Overview"
import Shortcuts from "@/components/MyPages/Blocks/Shortcuts"
+import { modWebviewLink } from "@/utils/webviews"
import {
AccountPageContentProps,
@@ -31,7 +32,7 @@ export default function Content({ lang, content }: ContentProps) {
href:
item.dynamic_content.link.linkConnection.edges[0].node
.original_url ||
- `/${lang}${item.dynamic_content.link.linkConnection.edges[0].node.url}`,
+ `/${lang}/webview${item.dynamic_content.link.linkConnection.edges[0].node.url}`,
text: item.dynamic_content.link.link_text,
}
: null
@@ -50,9 +51,15 @@ export default function Content({ lang, content }: ContentProps) {
/>
)
case ContentEntries.AccountPageContentShortcuts:
+ const shortcuts = item.shortcuts.shortcuts.map((shortcut) => {
+ return {
+ ...shortcut,
+ url: modWebviewLink(shortcut.url, lang),
+ }
+ })
return (
diff --git a/components/MyPages/Breadcrumbs/index.tsx b/components/MyPages/Breadcrumbs/index.tsx
index f0fa8d566..7ae70c5f4 100644
--- a/components/MyPages/Breadcrumbs/index.tsx
+++ b/components/MyPages/Breadcrumbs/index.tsx
@@ -1,3 +1,4 @@
+import { Lang } from "@/constants/languages"
import { _ } from "@/lib/translation"
import { serverClient } from "@/lib/trpc/server"
@@ -6,8 +7,17 @@ import BreadcrumbsWithLink from "./BreadcrumbWithLink"
import styles from "./breadcrumbs.module.css"
-export default async function Breadcrumbs() {
- const breadcrumbs = await serverClient().contentstack.breadcrumbs.get()
+export default async function Breadcrumbs({
+ href,
+ locale,
+}: {
+ href: string
+ locale: Lang
+}) {
+ const breadcrumbs = await serverClient().contentstack.breadcrumbs.get({
+ href,
+ locale,
+ })
return (