Skip to content

Commit

Permalink
fix: gray out number when form is not created
Browse files Browse the repository at this point in the history
  • Loading branch information
ephraimduncan committed Jun 8, 2024
1 parent 22fa60a commit a6f6294
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions apps/web/src/app/(main)/onboarding/stepper.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { cn } from '@formbase/ui/utils/cn';

import { api } from '~/lib/trpc/server';

import { CodeExampleStep } from './form/code-example-step';
Expand All @@ -6,21 +8,30 @@ import { CreateFormStep } from './form/create-form-step';
const Stepper = async () => {
const onboardingForm = await api.form.getOnboardingForm();
const form = onboardingForm[0]?.formId;
const formId = form ?? null;

const steps = [
{
content: <CreateFormStep formId={form ?? null} />,
content: <CreateFormStep formId={formId} />,
},
{
content: <CodeExampleStep formId={form ?? null} />,
content: <CodeExampleStep formId={formId} />,
},
];

return (
<div>
{steps.map((step, index) => (
<div key={index} className="flex items-start space-x-5 mb-10">
<span className="w-6 h-6 flex items-center justify-center bg-primary text-primary-foreground rounded-full text-xs">
<span
className={cn(
'w-6 h-6 flex items-center justify-center bg-primary text-primary-foreground rounded-full text-xs',
{
'pointer-events-none opacity-50 select-none':
index === 1 && formId === null,
},
)}
>
{index + 1}
</span>

Expand Down

0 comments on commit a6f6294

Please sign in to comment.