add address

This commit is contained in:
2026-01-03 17:14:15 -03:00
parent 57b23d7cd2
commit e5e64c504d
7 changed files with 98 additions and 56 deletions

View File

@@ -34,8 +34,9 @@ import { Payment } from './payment'
import { Assigned } from './assigned'
import { Review } from './review'
import { useWizardStore, type WizardState } from './store'
import { useState } from 'react'
import { useWizardStore } from './store'
import { useEffect, useState } from 'react'
import { useWorksapce } from '@/components/workspace-switcher'
export function meta({}: Route.MetaArgs) {
return [{ title: 'Comprar matrículas' }]
@@ -65,7 +66,9 @@ export default function Route({
}: Route.ComponentProps) {
const fetcher = useFetcher()
const [mounted, setMounted] = useState(false)
const { index, kind, setIndex, setKind, reset, ...state } = useWizardStore()
const { address } = useWorksapce()
const { index, kind, setIndex, setKind, reset, update, ...state } =
useWizardStore()
const onSubmit = async () => {
await fetcher.submit(JSON.stringify(state), {
@@ -79,6 +82,12 @@ export default function Route({
setMounted(true)
})
useEffect(() => {
if (address) {
update({ address })
}
}, [address])
if (!mounted) {
return <Skeleton />
}