fix: add cta text on card grid block
This commit is contained in:
@@ -1,5 +1,3 @@
|
|||||||
import { _ } from "@/lib/translation"
|
|
||||||
|
|
||||||
import Title from "@/components/Title"
|
import Title from "@/components/Title"
|
||||||
|
|
||||||
import Button from "../Button"
|
import Button from "../Button"
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ query GetLoyaltyPage($locale: String!, $url: String!) {
|
|||||||
title
|
title
|
||||||
subtitle
|
subtitle
|
||||||
open_in_new_tab
|
open_in_new_tab
|
||||||
|
cta_text
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ const loyaltyPageBlockCardGrid = z.object({
|
|||||||
totalCount: z.number(),
|
totalCount: z.number(),
|
||||||
}),
|
}),
|
||||||
open_in_new_tab: z.boolean(),
|
open_in_new_tab: z.boolean(),
|
||||||
|
cta_text: z.string().optional(),
|
||||||
})
|
})
|
||||||
),
|
),
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import GetLoyaltyPage from "@/lib/graphql/Query/LoyaltyPage.graphql"
|
import GetLoyaltyPage from "@/lib/graphql/Query/LoyaltyPage.graphql"
|
||||||
import { request } from "@/lib/graphql/request"
|
import { request } from "@/lib/graphql/request"
|
||||||
|
import { _ } from "@/lib/translation"
|
||||||
import { badRequestError } from "@/server/errors/trpc"
|
import { badRequestError } from "@/server/errors/trpc"
|
||||||
import { publicProcedure, router } from "@/server/trpc"
|
import { publicProcedure, router } from "@/server/trpc"
|
||||||
|
|
||||||
@@ -77,8 +78,7 @@ export const loyaltyPageQueryRouter = router({
|
|||||||
link: card.referenceConnection.totalCount
|
link: card.referenceConnection.totalCount
|
||||||
? {
|
? {
|
||||||
href: card.referenceConnection.edges[0].node.url,
|
href: card.referenceConnection.edges[0].node.url,
|
||||||
title:
|
title: card.cta_text || _("Read more"),
|
||||||
card.referenceConnection.edges[0].node.title,
|
|
||||||
}
|
}
|
||||||
: undefined,
|
: undefined,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user