feat(reviews): add CMS field for Google review button URL
Add googleReviewUrl text field to HomePage.sectionTitles group so editors can update the Google review link without a deploy. Falls back to the hardcoded URL when the field is empty. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
40ced357df
commit
c3274b0bd6
4 changed files with 17 additions and 3 deletions
|
|
@ -97,7 +97,12 @@ export default async function HomePage() {
|
|||
)
|
||||
case 'reviews':
|
||||
return (
|
||||
<Reviews key={key} data={reviews} title={home?.sectionTitles?.reviews ?? undefined} />
|
||||
<Reviews
|
||||
key={key}
|
||||
data={reviews}
|
||||
title={home?.sectionTitles?.reviews ?? undefined}
|
||||
googleReviewUrl={home?.sectionTitles?.googleReviewUrl}
|
||||
/>
|
||||
)
|
||||
case 'faq':
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -97,9 +97,10 @@ const VISIBLE_SIDES = 2
|
|||
interface ReviewsProps {
|
||||
data?: ReviewCMS[]
|
||||
title?: string
|
||||
googleReviewUrl?: string | null
|
||||
}
|
||||
|
||||
export function Reviews({ data, title }: ReviewsProps) {
|
||||
export function Reviews({ data, title, googleReviewUrl }: ReviewsProps) {
|
||||
const reviews = data && data.length > 0 ? data : STATIC_REVIEWS
|
||||
const n = reviews.length
|
||||
|
||||
|
|
@ -243,7 +244,7 @@ export function Reviews({ data, title }: ReviewsProps) {
|
|||
{/* CTA */}
|
||||
<div className="mt-6 flex justify-center">
|
||||
<a
|
||||
href={GOOGLE_REVIEW_URL}
|
||||
href={googleReviewUrl ?? GOOGLE_REVIEW_URL}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="inline-flex items-center gap-2 rounded-[64px] border-2 border-[#f28b4a] px-7 py-3 text-[16px] font-bold text-[#272727] transition-colors hover:bg-[#f28b4a] hover:text-white"
|
||||
|
|
|
|||
|
|
@ -135,6 +135,13 @@ export const HomePage: GlobalConfig = {
|
|||
{ name: 'birthday', type: 'text' },
|
||||
{ name: 'gallery', type: 'text' },
|
||||
{ name: 'reviews', type: 'text' },
|
||||
{
|
||||
name: 'googleReviewUrl',
|
||||
type: 'text',
|
||||
label: 'Посилання кнопки «Залиште відгук у Google»',
|
||||
defaultValue: 'https://g.page/r/shumiland/review',
|
||||
admin: { description: 'Посилання на сторінку відгуків Google' },
|
||||
},
|
||||
{ name: 'news', type: 'text' },
|
||||
],
|
||||
},
|
||||
|
|
|
|||
|
|
@ -87,6 +87,7 @@ export interface HomePageSectionTitles {
|
|||
birthday?: string | null
|
||||
gallery?: string | null
|
||||
reviews?: string | null
|
||||
googleReviewUrl?: string | null
|
||||
news?: string | null
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue