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
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
const CompanySettingsPage = () => {
return <div>Company settings page</div>;
import CompanyForm from "@/components/onboarding/conpany-form";
import { withServerSession } from "@/server/auth";

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

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

export default CompanySettingsPage;
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,7 @@ import { Input } from "@/components/ui/input";
import { Button } from "@/components/ui/button";
import { useSession } from "next-auth/react";

import {
Form,
FormControl,
FormField,
FormItem,
FormLabel,
FormMessage,
} from "@/components/ui/form";
import { Form, FormItem, FormLabel, FormMessage } from "@/components/ui/form";

const ProfileSettingsPage = () => {
const { data } = useSession();
Expand Down
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/conpany-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/conpany-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;
2 changes: 1 addition & 1 deletion src/components/onboarding/company.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const OnboardingCompany = ({
const isSubmitting = form.formState.isSubmitting;

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">
<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">
Expand Down
Loading
Loading