Skip to content

Commit 04f03a2

Browse files
onboarding
1 parent db4a9cf commit 04f03a2

3 files changed

Lines changed: 67 additions & 49 deletions

File tree

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import Link from "next/link";
2+
import { Button } from "@/components/ui/button";
3+
import { __unsafePrisma } from "@/prisma";
4+
import { createInviteLink } from "@/lib/utils";
5+
import { env, isMemberApprovalRequired } from "@sourcebot/shared";
6+
import { MemberApprovalRequiredSettingsCard } from "@/app/(app)/settings/security/components/memberApprovalRequiredSettingsCard";
7+
import { InviteLinkEnabledSettingsCard } from "@/app/(app)/settings/security/components/inviteLinkEnabledSettingsCard";
8+
import { Org } from "@sourcebot/db";
9+
10+
interface AccessSettingsStepProps {
11+
nextStep: number;
12+
org: Org;
13+
}
14+
15+
export async function AccessSettingsStep({ nextStep, org }: AccessSettingsStepProps) {
16+
const inviteLink = createInviteLink(env.AUTH_URL, org.inviteLinkId);
17+
18+
return (
19+
<div className="space-y-6">
20+
<MemberApprovalRequiredSettingsCard
21+
memberApprovalRequired={isMemberApprovalRequired(org)}
22+
/>
23+
<InviteLinkEnabledSettingsCard
24+
inviteLinkEnabled={org.inviteLinkEnabled}
25+
inviteLink={inviteLink}
26+
/>
27+
<Button asChild className="w-full">
28+
<Link href={`/onboard?step=${nextStep}`}>Continue →</Link>
29+
</Button>
30+
</div>
31+
);
32+
}

packages/web/src/app/onboard/components/configureOrgStep.tsx

Lines changed: 0 additions & 16 deletions
This file was deleted.

packages/web/src/app/onboard/page.tsx

Lines changed: 35 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { SourcebotLogo } from "@/app/components/sourcebotLogo"
55
import { auth } from "@/auth";
66
import { WelcomeStep } from "./components/welcomeStep";
77
import { OwnerSignupStep } from "./components/ownerSignupStep";
8-
import { ConfigureOrgStep } from "./components/configureOrgStep";
8+
import { AccessSettingsStep } from "./components/accessSettingsStep";
99
import { TrialStep, TrialStepTitle, TrialStepSubtitle } from "./components/trialStep";
1010
import { AlreadyLicensedStep } from "./components/alreadyLicensedStep";
1111
import { SINGLE_TENANT_ORG_ID } from "@/lib/constants";
@@ -116,7 +116,12 @@ export default async function Onboarding(props: OnboardingProps) {
116116
</a>
117117
</>
118118
),
119-
component: <ConfigureOrgStep nextStep={steps.length + 1} />,
119+
component: (
120+
<AccessSettingsStep
121+
nextStep={steps.length + 1}
122+
org={org}
123+
/>
124+
)
120125
});
121126

122127
const finalStepIndex = steps.length;
@@ -156,38 +161,35 @@ export default async function Onboarding(props: OnboardingProps) {
156161
{steps.map((step, index) => (
157162
<div key={step.id} className="flex items-center group">
158163
<div className="flex items-center space-x-4 flex-1">
159-
<div className="relative">
160-
{/* Connecting line */}
161-
{index < steps.length - 1 && (
162-
<div
163-
className={`absolute top-10 left-1/2 transform -translate-x-1/2 w-0.5 h-8 transition-all duration-300 ${
164-
index < currentStep ? "bg-primary" : "bg-border"
165-
}`}
166-
/>
167-
)}
168-
{/* Circle - positioned above the line with z-index */}
169-
<div
170-
className={`relative z-10 w-10 h-10 rounded-full border-2 flex items-center justify-center font-semibold text-sm transition-all duration-300 ${
171-
index < currentStep
172-
? "bg-primary border-primary text-primary-foreground"
173-
: index === currentStep
174-
? "bg-primary border-primary text-primary-foreground scale-110 shadow-lg"
175-
: "bg-background border-border text-muted-foreground"
176-
}`}
177-
>
178-
{index < currentStep ? (
179-
<svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
180-
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2.5} d="M5 13l4 4L19 7" />
181-
</svg>
182-
) : (
183-
<span>{index + 1}</span>
184-
)}
185-
</div>
186-
</div>
164+
<div className="relative">
165+
{/* Connecting line */}
166+
{index < steps.length - 1 && (
167+
<div
168+
className={`absolute top-10 left-1/2 transform -translate-x-1/2 w-0.5 h-8 transition-all duration-300 ${index < currentStep ? "bg-primary" : "bg-border"
169+
}`}
170+
/>
171+
)}
172+
{/* Circle - positioned above the line with z-index */}
173+
<div
174+
className={`relative z-10 w-10 h-10 rounded-full border-2 flex items-center justify-center font-semibold text-sm transition-all duration-300 ${index < currentStep
175+
? "bg-primary border-primary text-primary-foreground"
176+
: index === currentStep
177+
? "bg-primary border-primary text-primary-foreground scale-110 shadow-lg"
178+
: "bg-background border-border text-muted-foreground"
179+
}`}
180+
>
181+
{index < currentStep ? (
182+
<svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
183+
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2.5} d="M5 13l4 4L19 7" />
184+
</svg>
185+
) : (
186+
<span>{index + 1}</span>
187+
)}
188+
</div>
189+
</div>
187190
<div className="flex-1">
188-
<div className={`font-medium text-sm transition-all duration-200 ${
189-
index <= currentStep ? "text-foreground" : "text-muted-foreground"
190-
}`}>
191+
<div className={`font-medium text-sm transition-all duration-200 ${index <= currentStep ? "text-foreground" : "text-muted-foreground"
192+
}`}>
191193
{step.title}
192194
</div>
193195
</div>

0 commit comments

Comments
 (0)