signup_form_store.tsx 580 B

12345678910111213141516171819202122232425262728
  1. import { create } from "zustand";
  2. import { SignUpFormState } from "../types/signUpFormData";
  3. const useSignUpStore = create<SignUpFormState>((set) => ({
  4. signUpFormData: {
  5. phone: "",
  6. phoneVerificationStatus: false,
  7. name: "",
  8. password: "",
  9. email: "",
  10. birthDate: "",
  11. isUberDriver: undefined,
  12. vehicleType: "",
  13. vehicleModel: "",
  14. licensePlate: "",
  15. address: "",
  16. paymentMethod: "",
  17. },
  18. setSignUpFormData: (newFormData) =>
  19. set((state) => ({
  20. signUpFormData: {
  21. ...state.signUpFormData,
  22. ...newFormData,
  23. },
  24. })),
  25. }));
  26. export default useSignUpStore;