signup_form_store.tsx 593 B

1234567891011121314151617181920212223242526272829
  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. gender: ""
  18. },
  19. setSignUpFormData: (newFormData) =>
  20. set((state) => ({
  21. signUpFormData: {
  22. ...state.signUpFormData,
  23. ...newFormData,
  24. },
  25. })),
  26. }));
  27. export default useSignUpStore;