Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: company update page #149

Merged
merged 11 commits into from
Mar 1, 2024
4 changes: 2 additions & 2 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
generator client {
provider = "prisma-client-js"
binaryTargets = ["native", "rhel-openssl-1.0.x"]
provider = "prisma-client-js"
binaryTargets = ["native", "rhel-openssl-1.0.x"]
}

datasource db {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
const CompanySettingsPage = () => {
return <div>Company settings page</div>;
import CompanyForm from "@/components/onboarding/company-form";
import { withServerSession } from "@/server/auth";
import { getCompany } from "@/server/company";

const CompanySettingsPage = async () => {
const session = await withServerSession();
const user = session.user;

const companyResponse = await getCompany(user.id, user.companyId);

return (
<CompanyForm
companyServerResponse={companyResponse}
formType="edit-company"
currentUser={user}
/>
);
};

export default CompanySettingsPage;
21 changes: 19 additions & 2 deletions src/app/(authenticated)/(dashboard)/company/new/page.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,28 @@
import OnboardingCompany from "@/components/onboarding/company";
import { Navbar } from "@/components/navbar";
import CompanyForm from "@/components/onboarding/company-form";
import { withServerSession } from "@/server/auth";

const OnboardingPage = async () => {
const session = await withServerSession();
const user = session.user;

return <OnboardingCompany formType="create-company" currentUser={user} />;
return (
<div className="flex min-h-screen justify-center bg-gradient-to-br from-indigo-50 via-white to-cyan-100 px-5 pb-5 pt-20">
<Navbar />

<div className="border-rounded w-full max-w-2xl border bg-white p-10 shadow">
<div className="mb-5">
<h1 className="text-2xl font-semibold tracking-tight">
Welcome to OpenCap!
</h1>
<p className="text-sm text-muted-foreground">
You are almost there. Please complete the form below to continue
</p>
</div>
<CompanyForm formType="create-company" currentUser={user} />
</div>
</div>
);
};

export default OnboardingPage;
21 changes: 19 additions & 2 deletions src/app/(authenticated)/onboarding/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import OnboardingCompany from "@/components/onboarding/company";
import { Navbar } from "@/components/navbar";
import CompanyForm from "@/components/onboarding/company-form";
import { withServerSession } from "@/server/auth";
import { redirect } from "next/navigation";

Expand All @@ -12,7 +13,23 @@ const OnboardingPage = async () => {
redirect("/dashboard");
}

return <OnboardingCompany currentUser={user} />;
return (
<div className="flex min-h-screen justify-center bg-gradient-to-br from-indigo-50 via-white to-cyan-100 px-5 pb-5 pt-20">
<Navbar />

<div className="border-rounded w-full max-w-2xl border bg-white p-10 shadow">
<div className="mb-5">
<h1 className="text-2xl font-semibold tracking-tight">
Welcome to OpenCap!
</h1>
<p className="text-sm text-muted-foreground">
You are almost there. Please complete the form below to continue
</p>
</div>
<CompanyForm formType="onboarding" currentUser={user} />
</div>
</div>
);
};

export default OnboardingPage;
Loading
Loading