Skip to content

Commit 3e3369a

Browse files
authored
Add: Add call-to-action button for the case study detail page (#159)
* Add: Add call-to-action button for the case study detail page * fix codee * add locales id * fix code
1 parent 8d98bdc commit 3e3369a

File tree

6 files changed

+103
-11
lines changed

6 files changed

+103
-11
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
"use client";
2+
3+
import { Button } from "@/components/ui/button";
4+
5+
type GetInTouchButtonProps = {
6+
index: string;
7+
buttonChatbotMessage: string;
8+
children: React.ReactNode;
9+
};
10+
11+
function getTopic(index: string): string {
12+
switch (index) {
13+
case "erp-fisheries":
14+
return "Transforming a fisheries tech team into a scalable product engine";
15+
case "ctoaas-media":
16+
return "Elevating a media-tech engineering team from feature factory to innovation powerhouse";
17+
default:
18+
return "";
19+
}
20+
}
21+
22+
export default function ButtonGetInTouch({
23+
index,
24+
buttonChatbotMessage,
25+
children
26+
}: GetInTouchButtonProps) {
27+
return (
28+
<Button
29+
variant="default"
30+
size="lg"
31+
className="bg-hyperjump-blue hover:bg-hyperjump-blue/90 w-3/4 md:w-auto"
32+
onClick={() => {
33+
window.dispatchEvent(
34+
new CustomEvent("prefillAIAgent", {
35+
detail: {
36+
message: `${buttonChatbotMessage} ${getTopic(index)}`
37+
}
38+
})
39+
);
40+
}}>
41+
{children}
42+
</Button>
43+
);
44+
}

app/[lang]/(hyperjump)/case-studies/[slug]/page.tsx

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import type { CaseStudy } from "../../data";
1515
import { caseStudyBy, getCaseStudies } from "../data";
1616
import { Content } from "./components/content";
1717
import { dynamicOpengraph } from "@/lib/default-metadata";
18+
import ButtonGetInTouch from "./components/button-get-in-touch";
1819

1920
type Params = { lang: SupportedLanguage; slug: string };
2021

@@ -62,20 +63,30 @@ export default async function CaseStudy({ params }: CaseStudyProps) {
6263
notFound();
6364
}
6465

66+
const cta = caseStudy.cta;
67+
6568
return (
6669
<main className="bg-white">
6770
<Hero heading={caseStudy.title} />
6871
<section className="mx-auto max-w-3xl px-4 md:px-20">
6972
<article className="prose prose-headings:mt-8 prose-headings:font-semibold prose-headings:text-black prose-h1:text-4xl prose-h2:text-3xl prose-h3:text-2xl prose-h4:text-xl prose-h5:text-lg prose-h6:text-md dark:prose-headings:text-white text-left">
7073
<Content slug={slug} lang={lang} />
7174
</article>
75+
76+
<div className="mt-12 flex flex-col items-center gap-4 text-center">
77+
<h3 className="text-hyperjump-black max-w-xl text-xl font-semibold md:text-2xl">
78+
{cta.heading}
79+
</h3>
80+
81+
<ButtonGetInTouch index={slug} buttonChatbotMessage={caseStudy.title}>
82+
{cta.label}
83+
</ButtonGetInTouch>
84+
</div>
7285
</section>
7386

7487
<section className="mt-5 px-4 md:px-20">
7588
<Recommendation
76-
caseStudies={getCaseStudies(lang).filter(
77-
(caseStudy) => caseStudy.slug !== slug
78-
)}
89+
caseStudies={getCaseStudies(lang).filter((cs) => cs.slug !== slug)}
7990
lang={lang}
8091
/>
8192
</section>

app/[lang]/(hyperjump)/case-studies/data.ts

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@ import {
44
caseStudyCtoaasMediaTitle,
55
caseStudyErpFisheriesCategory,
66
caseStudyErpFisheriesDesc,
7-
caseStudyErpFisheriesTitle
7+
caseStudyErpFisheriesTitle,
8+
caseStudyCtoaasMediaCtaHeading,
9+
caseStudyCtoaasMediaCtaLabel,
10+
caseStudyCtoaasMediaCtaSubject,
11+
caseStudyErpFisheriesCtaHeading,
12+
caseStudyErpFisheriesCtaLabel,
13+
caseStudyErpFisheriesCtaSubject
814
} from "@/locales/.generated/server";
915
import type { SupportedLanguage } from "@/locales/.generated/types";
1016

@@ -14,13 +20,23 @@ export const getCaseStudies = (lang: SupportedLanguage) => {
1420
slug: "erp-fisheries",
1521
title: caseStudyErpFisheriesTitle(lang),
1622
description: caseStudyErpFisheriesDesc(lang),
17-
category: caseStudyErpFisheriesCategory(lang)
23+
category: caseStudyErpFisheriesCategory(lang),
24+
cta: {
25+
heading: caseStudyErpFisheriesCtaHeading(lang),
26+
subject: caseStudyErpFisheriesCtaSubject(lang),
27+
label: caseStudyErpFisheriesCtaLabel(lang)
28+
}
1829
},
1930
{
2031
slug: "ctoaas-media",
2132
title: caseStudyCtoaasMediaTitle(lang),
2233
description: caseStudyCtoaasMediaDesc(lang),
23-
category: caseStudyCtoaasMediaCategory(lang)
34+
category: caseStudyCtoaasMediaCategory(lang),
35+
cta: {
36+
heading: caseStudyCtoaasMediaCtaHeading(lang),
37+
subject: caseStudyCtoaasMediaCtaSubject(lang),
38+
label: caseStudyCtoaasMediaCtaLabel(lang)
39+
}
2440
}
2541
];
2642
};

data.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,6 @@
5050
}
5151
],
5252
"title": "Hyperjump Technology",
53-
"url": "https://hyperjump.tech"
53+
"url": "https://hyperjump.tech",
54+
"email": "solution@hyperjump.tech"
5455
}

locales/en/case-study.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,21 @@
1515
"erp_fisheries": {
1616
"title": "Transforming a fisheries tech team into a scalable product engine",
1717
"desc": "A junior but passionate tech team. Zero products in production. High impact at stake. We embedded deeply with their team to introduce structure, build confidence, and ship a functional MVP within 3 months. Through rigorous agile practices and full-system rollouts, we helped evolve a fragile tech org into a reliable product engine.",
18-
"category": "CTO as a Service"
18+
"category": "CTO as a Service",
19+
"cta": {
20+
"heading": "Ready to build your future? Let's discuss your transformation",
21+
"subject": "Media Transformation",
22+
"label": "Get In Touch"
23+
}
1924
},
2025
"ctoaas_media": {
2126
"title": "Elevating a media-tech engineering team from feature factory to innovation powerhouse",
2227
"desc": "When rapid growth outpaced engineering maturity, this team needed more than features, they needed transformation. We restructured their agile practices, automated DevOps, established measurable KPIs, and helped them move from task execution to true product ownership and experimentation.",
23-
"category": "CTO as a Service"
28+
"category": "CTO as a Service",
29+
"cta": {
30+
"heading": "Ready to transform your tech team? Let's talk about CTO-as-a-Service",
31+
"subject": "CTO as a Service",
32+
"label": "Get In Touch"
33+
}
2434
}
2535
}

locales/id/case-study.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,21 @@
1515
"erp_fisheries": {
1616
"title": "Mengubah tim teknologi perikanan menjadi mesin produk yang skalabel",
1717
"desc": "Tim teknologi yang masih junior namun penuh semangat. Tidak ada produk yang berjalan. Taruhan dampak besar. Kami terjun langsung mendampingi tim mereka untuk membangun struktur, meningkatkan kepercayaan diri, dan meluncurkan MVP yang fungsional dalam 3 bulan. Lewat praktik agile yang ketat dan peluncuran sistem penuh, kami bantu mengubah organisasi teknologi yang rapuh menjadi mesin produk yang andal.",
18-
"category": "CTO as a Service"
18+
"category": "CTO as a Service",
19+
"cta": {
20+
"heading": "Siap membangun masa depan Anda? Mari diskusikan transformasi Anda",
21+
"subject": "Transformasi Media",
22+
"label": "Hubungi Kami"
23+
}
1924
},
2025
"ctoaas_media": {
2126
"title": "Meningkatkan tim engineering media dari pabrik fitur menjadi pusat inovasi",
2227
"desc": "Ketika pertumbuhan cepat melampaui kematangan engineering, tim ini butuh lebih dari sekadar fitur, mereka butuh transformasi. Kami restrukturisasi praktik agile mereka, otomatisasi DevOps, tetapkan KPI terukur, dan bantu mereka beralih dari eksekutor tugas ke pemilik produk sejati yang inovatif.",
23-
"category": "CTO as a Service"
28+
"category": "CTO as a Service",
29+
"cta": {
30+
"heading": "Siap mentransformasi tim teknologi Anda? Mari berdiskusi tentang CTO-as-a-Service",
31+
"subject": "CTO sebagai Layanan",
32+
"label": "Hubungi Kami"
33+
}
2434
}
2535
}

0 commit comments

Comments
 (0)