Merge branch 'main' into B2B-88
This commit is contained in:
@@ -9,20 +9,17 @@ import {
|
||||
import { Trans } from '@kit/ui/trans';
|
||||
|
||||
import { withI18n } from '~/lib/i18n/with-i18n';
|
||||
import { MedReportTitle } from '@/components/MedReportTitle';
|
||||
|
||||
function Home() {
|
||||
return (
|
||||
<div className={'mt-4 flex flex-col space-y-24 py-14'}>
|
||||
<div className={'container mx-auto'}>
|
||||
<Hero
|
||||
title={
|
||||
<>
|
||||
<span>Med Report</span>
|
||||
</>
|
||||
}
|
||||
title={<MedReportTitle />}
|
||||
subtitle={
|
||||
<span>
|
||||
Lihtne, mugav ja kiire ülevaade Sinu tervise seisundist
|
||||
<Trans i18nKey={'marketing:heroSubtitle'} />
|
||||
</span>
|
||||
}
|
||||
cta={<MainCallToActionButton />}
|
||||
@@ -56,8 +53,8 @@ function MainCallToActionButton() {
|
||||
</CtaButton>
|
||||
|
||||
<CtaButton variant={'link'}>
|
||||
<Link href={'/contact'}>
|
||||
<Trans i18nKey={'common:contactUs'} />
|
||||
<Link href={'/register-company'}>
|
||||
<Trans i18nKey={'account:createCompanyAccount'} />
|
||||
</Link>
|
||||
</CtaButton>
|
||||
</div>
|
||||
|
||||
11
app/(public)/layout.tsx
Normal file
11
app/(public)/layout.tsx
Normal file
@@ -0,0 +1,11 @@
|
||||
import { withI18n } from '~/lib/i18n/with-i18n';
|
||||
|
||||
function SiteLayout(props: React.PropsWithChildren) {
|
||||
return (
|
||||
<div className={'flex min-h-[100vh] flex-col justify-center items-center'}>
|
||||
{props.children}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default withI18n(SiteLayout);
|
||||
90
app/(public)/register-company/page.tsx
Normal file
90
app/(public)/register-company/page.tsx
Normal file
@@ -0,0 +1,90 @@
|
||||
"use client";
|
||||
|
||||
import { MedReportTitle } from "@/components/MedReportTitle";
|
||||
import React from "react";
|
||||
import { yupResolver } from "@hookform/resolvers/yup";
|
||||
import { useForm } from "react-hook-form";
|
||||
import { companySchema } from "@/lib/validations/companySchema";
|
||||
import { CompanySubmitData } from "@/lib/types/company";
|
||||
import { submitCompanyRegistration } from "@/lib/services/register-company.service";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { Label } from "@kit/ui/label";
|
||||
import { Input } from "@kit/ui/input";
|
||||
import { SubmitButton } from "@/components/ui/submit-button";
|
||||
import { FormItem } from "@kit/ui/form";
|
||||
import { Trans } from "@kit/ui/trans";
|
||||
|
||||
export default function RegisterCompany() {
|
||||
const router = useRouter();
|
||||
const {
|
||||
register,
|
||||
handleSubmit,
|
||||
formState: { errors, isValid, isSubmitting },
|
||||
} = useForm({
|
||||
resolver: yupResolver(companySchema),
|
||||
mode: "onChange",
|
||||
});
|
||||
|
||||
async function onSubmit(data: CompanySubmitData) {
|
||||
const formData = new FormData();
|
||||
Object.entries(data).forEach(([key, value]) => {
|
||||
if (value !== undefined) formData.append(key, value);
|
||||
});
|
||||
|
||||
try {
|
||||
await submitCompanyRegistration(formData);
|
||||
router.push("/register-company/success");
|
||||
} catch (err: unknown) {
|
||||
if (err instanceof Error) {
|
||||
alert("Server validation error: " + err.message);
|
||||
}
|
||||
alert("Server validation error");
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex flex-row border rounded-3xl border-border max-w-5xl overflow-hidden">
|
||||
<div className="flex flex-col text-center py-14 px-12 w-1/2">
|
||||
<MedReportTitle />
|
||||
<h1 className="pt-8">Ettevõtte andmed</h1>
|
||||
<p className="pt-2 text-muted-foreground text-sm">
|
||||
Pakkumise saamiseks palun sisesta ettevõtte andmed millega MedReport
|
||||
kasutada kavatsed.
|
||||
</p>
|
||||
<form
|
||||
onSubmit={handleSubmit(onSubmit)}
|
||||
noValidate
|
||||
className="flex gap-7 flex-col text-left pt-8 px-6"
|
||||
>
|
||||
<FormItem>
|
||||
<Label>Ettevõtte nimi</Label>
|
||||
<Input {...register("companyName")} />
|
||||
</FormItem>
|
||||
<FormItem>
|
||||
<Label>Kontaktisik</Label>
|
||||
<Input {...register("contactPerson")} />
|
||||
</FormItem>
|
||||
<FormItem>
|
||||
<Label>E-mail</Label>
|
||||
<Input type="email" {...register("email")}></Input>
|
||||
</FormItem>
|
||||
<FormItem>
|
||||
<Label>Telefon</Label>
|
||||
<Input type="tel" {...register("phone")} />
|
||||
</FormItem>
|
||||
<SubmitButton
|
||||
disabled={!isValid || isSubmitting}
|
||||
pendingText="Saatmine..."
|
||||
type="submit"
|
||||
formAction={submitCompanyRegistration}
|
||||
className="mt-4 hover:bg-primary/90"
|
||||
>
|
||||
<Trans i18nKey={'account:requestCompanyAccount'} />
|
||||
</SubmitButton>
|
||||
</form>
|
||||
</div>
|
||||
<div className="w-1/2 min-w-[460px] bg-[url(/assets/med-report-logo-big.png)] bg-cover bg-center bg-no-repeat">
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
26
app/(public)/register-company/success/page.tsx
Normal file
26
app/(public)/register-company/success/page.tsx
Normal file
@@ -0,0 +1,26 @@
|
||||
import { MedReportTitle } from "@/components/MedReportTitle";
|
||||
import { Button } from "@/packages/ui/src/shadcn/button";
|
||||
import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
|
||||
export default function CompanyRegistrationSuccess() {
|
||||
return (
|
||||
<div className="pt-2 px-16 pb-12 border rounded-3xl border-border">
|
||||
<MedReportTitle />
|
||||
<div className="flex flex-col items-center px-4">
|
||||
<Image
|
||||
src="/assets/success.png"
|
||||
alt="Success"
|
||||
className="pt-6 pb-8"
|
||||
width={326}
|
||||
height={195}
|
||||
/>
|
||||
<h1 className="pb-2">Päring edukalt saadetud!</h1>
|
||||
<p className=" text-muted-foreground text-sm">Saadame teile esimesel võimalusel vastuse</p>
|
||||
</div>
|
||||
<Button className="w-full mt-8">
|
||||
<Link href="/">Tagasi kodulehele</Link>
|
||||
</Button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
22
app/(public)/sign-in/page.tsx
Normal file
22
app/(public)/sign-in/page.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
import { Button } from '@kit/ui/button';
|
||||
import Link from "next/link";
|
||||
import React from "react";
|
||||
|
||||
export default async function SignIn() {
|
||||
return (
|
||||
<div className="flex flex-col gap-2">
|
||||
<Button variant="outline">
|
||||
<Link href="/">Smart-ID</Link>
|
||||
</Button>
|
||||
<Button variant="outline">
|
||||
<Link href="/">Mobiil-ID</Link>
|
||||
</Button>
|
||||
<Button variant="outline">
|
||||
<Link href="/">ID-Kaart</Link>
|
||||
</Button>
|
||||
<Button variant="outline">
|
||||
<Link href="/register-company">Loo ettevõtte konto</Link>
|
||||
</Button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
BIN
app/icon.ico
Normal file
BIN
app/icon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.9 KiB |
Reference in New Issue
Block a user