Skip to content

Commit cb0ac7f

Browse files
committed
feat: initialize enterprise contact form
1 parent b069f7c commit cb0ac7f

File tree

7 files changed

+102
-12
lines changed

7 files changed

+102
-12
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
"use client"
2+
3+
import { Button } from "@/components/ui/buttons/Button"
4+
import Input from "@/components/ui/input"
5+
import { Textarea } from "@/components/ui/textarea"
6+
7+
type EnterpriseContactFormProps = {
8+
emailPlaceholder: string
9+
bodyPlaceholder: string
10+
buttonLabel: string
11+
}
12+
13+
const EnterpriseContactForm = ({
14+
emailPlaceholder,
15+
bodyPlaceholder,
16+
buttonLabel,
17+
}: EnterpriseContactFormProps) => (
18+
<div className="w-full max-w-[440px] space-y-6">
19+
<Input type="email" className="w-full" placeholder={emailPlaceholder} />
20+
<Textarea className="" placeholder={bodyPlaceholder} />
21+
<Button
22+
onClick={() => {
23+
console.log("Submit form!")
24+
}}
25+
size="lg"
26+
customEventOptions={{
27+
eventCategory: "enterprise",
28+
eventAction: "CTA",
29+
eventName: "bottom_mail",
30+
}}
31+
>
32+
{buttonLabel}
33+
</Button>
34+
</div>
35+
)
36+
37+
export default EnterpriseContactForm
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import dynamic from "next/dynamic"
2+
3+
import Loading from "./loading"
4+
5+
export default dynamic(() => import("."), { ssr: false, loading: Loading })
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { Skeleton } from "@/components/ui/skeleton"
2+
3+
const Loading = () => (
4+
<div className="w-full max-w-[440px] space-y-6">
5+
<Skeleton className="h-[42px] w-full" />
6+
<Skeleton className="h-[200px] w-full" />
7+
</div>
8+
)
9+
10+
export default Loading

app/[locale]/enterprise/page.tsx

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ import { getMetadata } from "@/lib/utils/metadata"
4848
import { BASE_TIME_UNIT } from "@/lib/constants"
4949

5050
import CasesColumn from "./_components/CasesColumn"
51+
import EnterpriseContactForm from "./_components/ContactForm/lazy"
5152
import FeatureCard from "./_components/FeatureCard"
5253
import { ENTERPRISE_MAILTO } from "./constants"
5354
import type { Case, EcosystemPlayer, Feature } from "./types"
@@ -95,6 +96,7 @@ const Page = async ({ params }: { params: { locale: Lang } }) => {
9596
const { locale } = params
9697

9798
const t = await getTranslations({ locale, namespace: "page-enterprise" })
99+
const tCommon = await getTranslations({ locale, namespace: "common" })
98100

99101
const [
100102
{ txCount, txCostsMedianUsd },
@@ -492,16 +494,11 @@ const Page = async ({ params }: { params: { locale: Lang } }) => {
492494
<p className="max-w-prose px-6 text-center md:px-8">
493495
{t("page-enterprise-team-description")}
494496
</p>
495-
<ButtonLink
496-
href={ENTERPRISE_MAILTO}
497-
customEventOptions={{
498-
eventCategory: "enterprise",
499-
eventAction: "CTA",
500-
eventName: "bottom_mail",
501-
}}
502-
>
503-
{t("page-enterprise-hero-cta")}
504-
</ButtonLink>
497+
<EnterpriseContactForm
498+
buttonLabel={tCommon("set-up-a-call")}
499+
emailPlaceholder={tCommon("your-email")}
500+
bodyPlaceholder={t("page-enterprise-team-form-placeholder")}
501+
/>
505502
</section>
506503
</MainArticle>
507504
</div>

src/components/ui/textarea.tsx

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import * as React from "react"
2+
import { cva, type VariantProps } from "class-variance-authority"
3+
4+
import { cn } from "@/lib/utils/cn"
5+
6+
const textareaVariants = cva(
7+
"focus-visible:ring-ring flex min-h-[200px] w-full rounded border border-body bg-background px-3 py-2 text-base ring-offset-background placeholder:text-disabled focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
8+
{
9+
variants: {
10+
size: {
11+
md: "p-2",
12+
sm: "p-1 text-sm",
13+
},
14+
},
15+
defaultVariants: {
16+
size: "md",
17+
},
18+
}
19+
)
20+
21+
export interface TextareaProps
22+
extends Omit<React.ComponentProps<"textarea">, "size">,
23+
VariantProps<typeof textareaVariants> {}
24+
25+
const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
26+
({ className, size, ...props }, ref) => {
27+
return (
28+
<textarea
29+
className={cn(textareaVariants({ size, className }))}
30+
ref={ref}
31+
{...props}
32+
/>
33+
)
34+
}
35+
)
36+
Textarea.displayName = "Textarea"
37+
38+
export { Textarea }

src/intl/en/common.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,7 @@
415415
"secret-leader-election": "Secret leader election",
416416
"security": "Security",
417417
"see-contributors": "See contributors",
418+
"set-up-a-call": "Set up a call",
418419
"set-up-local-env": "Set up local environment",
419420
"sharding": "Sharding",
420421
"show-all": "Show all",
@@ -464,5 +465,6 @@
464465
"withdrawals": "Staking withdrawals",
465466
"wrapped-ether": "Wrapped Ether",
466467
"yes": "Yes",
468+
"your-email": "Your e-mail",
467469
"zero-knowledge-proofs": "Zero-knowledge proofs"
468470
}

src/intl/en/page-enterprise.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@
4040
"page-enterprise-reason-3-header": "Reduced risk",
4141
"page-enterprise-reason-4-content": "The only programmable distributed ledger infrastructure that has never gone down, and has thrived through multiple existential threats.",
4242
"page-enterprise-reason-4-header": "Battle-tested",
43-
"page-enterprise-team-description": "We will answer your questions, help identify potential paths forward, provide technical support, and connect you with relevant industry leaders.",
44-
"page-enterprise-team-header": "EF Enterprise Team",
43+
"page-enterprise-team-description": "We will answer your questions, help identify potential paths forward, provide technical support and connect you with relevant industry leaders.",
44+
"page-enterprise-team-header": "Ethereum Enterprise Team",
45+
"page-enterprise-team-form-placeholder": "Tell us about your project",
4546
"page-enterprise-why-description": "Ethereum supports enterprise compliance with transparent, auditable infrastructure that aligns with GDPR and KYC while protecting sensitive data in private or consortium environments.",
4647
"page-enterprise-why-header": "Why Ethereum"
4748
}

0 commit comments

Comments
 (0)