Skip to content

Commit 1c1a027

Browse files
committed
Add loading... info
1 parent 4558c4a commit 1c1a027

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

components/onboarding.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ const OnboardingForm: React.FC = () => {
218218
const [formValues, setFormValues] = useState<FormValues>({});
219219
const [showGenderDefs, setShowGenderDefs] = useState(false);
220220
const [sliderValue, setSliderValue] = useState(0);
221+
const [isSubmitting, setIsSubmitting] = useState(false);
221222

222223
const featureNames = ['connections'];
223224
const [allFeatures, _setAllFeatures] = useState(() =>
@@ -256,6 +257,7 @@ const OnboardingForm: React.FC = () => {
256257
const currentQuestion = visibleQuestions[step];
257258

258259
const onSubmit: SubmitHandler<FormValues> = async () => {
260+
setIsSubmitting(true);
259261
setError('');
260262
const allValues = {...formValues, ...getValues()};
261263
console.log(JSON.stringify(allValues, null, 2));
@@ -680,7 +682,7 @@ const OnboardingForm: React.FC = () => {
680682
type="submit"
681683
className="rounded-full px-6 py-2 font-semibold bg-red-700 text-white hover:bg-red-800 transition-colors"
682684
>
683-
Submit
685+
{isSubmitting ? 'Saving...' : 'Submit'}
684686
</button>
685687
)}
686688
</div>

0 commit comments

Comments
 (0)