Skip to content

Commit

Permalink
automatically proceed after env is added
Browse files Browse the repository at this point in the history
  • Loading branch information
buckhalt committed Oct 9, 2024
1 parent 5ed72c5 commit 134e782
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -1,24 +1,12 @@
import { parseAsInteger, useQueryState } from 'nuqs';
import { Button } from '~/components/ui/Button';
import Heading from '~/components/ui/typography/Heading';
import Paragraph from '~/components/ui/typography/Paragraph';
import { EnvironmentForm } from '../EnvironmentForm';

function ConfigureEnvironment({
installationId,
hasUploadthingEnv,
}: {
installationId: string | null;
hasUploadthingEnv: boolean;
}) {
const [currentStep, setCurrentStep] = useQueryState(
'step',
parseAsInteger.withDefault(1),
);

const handleNextStep = () => {
void setCurrentStep(currentStep + 1);
};
return (
<div className="w-[30rem]">
<div className="mb-4">
Expand All @@ -28,7 +16,6 @@ function ConfigureEnvironment({
</Paragraph>
<EnvironmentForm installationId={installationId} />
</div>
{hasUploadthingEnv && <Button onClick={handleNextStep}>Proceed</Button>}
</div>
);
}
Expand Down
14 changes: 7 additions & 7 deletions app/(blobs)/(setup)/setup/Setup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,19 @@ export default function Setup({
void setStep(2);
return;
}
}, [hasAuth, step, setStep]);

if (step === 2 && hasUploadthingEnv) {
void setStep(3);
return;
}
}, [hasAuth, step, setStep, hasUploadthingEnv]);

return (
<motion.div className={cardClasses}>
<OnboardSteps />
<div className={mainClasses}>
{step === 1 && <CreateAccount />}
{step === 2 && (
<ConfigureEnvironment
installationId={installationId}
hasUploadthingEnv={hasUploadthingEnv}
/>
)}
{step === 2 && <ConfigureEnvironment installationId={installationId} />}
{step === 3 && (
<DeploymentSettings
sandboxMode={sandboxMode}
Expand Down

0 comments on commit 134e782

Please sign in to comment.