Эх сурвалжийг харах

feat: end creatin state for add user to auth

Bax 4 өдөр өмнө
parent
commit
02657214de
17 өөрчлөгдсөн 483 нэмэгдсэн , 106 устгасан
  1. 0 3
      mobile_app/Wabi/app/build.gradle.kts
  2. 13 5
      mobile_app/Wabi/app/src/main/java/com/example/wabi/domain/supabase/SupabaseServiceImpl.kt
  3. 7 0
      mobile_app/Wabi/app/src/main/java/com/example/wabi/models/screens/SignUpState.kt
  4. 1 0
      mobile_app/Wabi/app/src/main/java/com/example/wabi/view/components/texts/Error/ErrorList.kt
  5. 2 2
      mobile_app/Wabi/app/src/main/java/com/example/wabi/view/screeens/catalog/Catalog.kt
  6. 13 0
      mobile_app/Wabi/app/src/main/java/com/example/wabi/view/screeens/catalog/CatalogVeiwModel.kt
  7. 9 12
      mobile_app/Wabi/app/src/main/java/com/example/wabi/view/screeens/logIn/LogIn.kt
  8. 77 13
      mobile_app/Wabi/app/src/main/java/com/example/wabi/view/screeens/logIn/LogInViewModel.kt
  9. 5 3
      mobile_app/Wabi/app/src/main/java/com/example/wabi/view/screeens/logIn/items/EmailForReset.kt
  10. 7 0
      mobile_app/Wabi/app/src/main/java/com/example/wabi/view/screeens/logIn/items/LogInStateDestinations.kt
  11. 6 6
      mobile_app/Wabi/app/src/main/java/com/example/wabi/view/screeens/logIn/items/SignIn.kt
  12. 14 62
      mobile_app/Wabi/app/src/main/java/com/example/wabi/view/screeens/logIn/items/SignUp.kt
  13. 21 0
      mobile_app/Wabi/app/src/main/java/com/example/wabi/view/screeens/logIn/items/signUpItems/CreatePofile.kt
  14. 82 0
      mobile_app/Wabi/app/src/main/java/com/example/wabi/view/screeens/logIn/items/signUpItems/EmailAndPassword.kt
  15. 6 0
      mobile_app/Wabi/app/src/main/java/com/example/wabi/view/screeens/logIn/items/signUpItems/SignUpStateDestination.kt
  16. 18 0
      mobile_app/Wabi/app/src/main/java/com/example/wabi/view/screeens/logIn/items/signUpItems/SingUpDestinations.kt
  17. 202 0
      mobile_app/new/wabi/.idea/workspace.xml

+ 0 - 3
mobile_app/Wabi/app/build.gradle.kts

@@ -81,9 +81,6 @@ dependencies {
     implementation("io.coil-kt:coil-compose:2.2.2")
     implementation("io.coil-kt:coil-svg:2.2.2")
 
-    //serialization
-
-
     // hilt
     implementation("com.google.dagger:hilt-android:2.48")
     kapt("com.google.dagger:hilt-compiler:2.48")

+ 13 - 5
mobile_app/Wabi/app/src/main/java/com/example/wabi/domain/supabase/SupabaseServiceImpl.kt

@@ -41,7 +41,17 @@ class SupabaseServiceImpl @Inject constructor(private val supabase: SupabaseClie
     }
 
     override suspend fun signUp(userEmail: String, userPasword: String): Response {
-        TODO("Not yet implemented")
+        return try {
+            var user = supabase.auth.signUpWith(Email) {
+                email = userEmail
+                password = userPasword
+            }
+            Log.d("signUp", "The user was created")
+            Response(user.toString())
+        } catch (ex: Exception) {
+            Log.e("signUp", ex.message.toString())
+            Response("", ex.message.toString())
+        }
     }
 
     override suspend fun addUser(user: User): Response {
@@ -57,8 +67,8 @@ class SupabaseServiceImpl @Inject constructor(private val supabase: SupabaseClie
         }.countOrNull()!!
 
         Log.d("email is exists", "count users with added email: ${count.toString()}")
-
-        return count == 0.toLong()
+        Log.d("email is exists", "result: ${count == 1.toLong()}")
+        return count == 1.toLong()
     }
 
     override suspend fun resetPasswordForEmail(userEmail: String): Response {
@@ -81,6 +91,4 @@ class SupabaseServiceImpl @Inject constructor(private val supabase: SupabaseClie
             )
         ).decodeList<Basket>()
     }
-
-
 }

+ 7 - 0
mobile_app/Wabi/app/src/main/java/com/example/wabi/models/screens/SignUpState.kt

@@ -0,0 +1,7 @@
+package com.example.wabi.models.screens
+
+data class SignUpState(
+    var email: String = "",
+    var passwordOne: String = "",
+    var passwordTwo: String = ""
+)

+ 1 - 0
mobile_app/Wabi/app/src/main/java/com/example/wabi/view/components/texts/Error/ErrorList.kt

@@ -9,4 +9,5 @@ object ErrorList {
     const val emailNotExists = "Аккаунта с данной почтной не существует"
     const val passDontMatch = "Пароли не совпадают!"
     const val noCorrectCode = "Не верный код!"
+    const val emptyData = "Данные заполнены не до конца!"
 }

+ 2 - 2
mobile_app/Wabi/app/src/main/java/com/example/wabi/view/screeens/catalog/Catalog.kt

@@ -1,10 +1,10 @@
 package com.example.wabi.view.screeens.catalog
 
 import androidx.compose.runtime.Composable
-import androidx.compose.ui.Modifier
+import androidx.hilt.navigation.compose.hiltViewModel
 import androidx.navigation.NavHostController
 
 @Composable
-fun Catalog(navHostController: NavHostController) {
+fun Catalog(navHostController: NavHostController, vm: CatalogVeiwModel = hiltViewModel()) {
 
 }

+ 13 - 0
mobile_app/Wabi/app/src/main/java/com/example/wabi/view/screeens/catalog/CatalogVeiwModel.kt

@@ -0,0 +1,13 @@
+package com.example.wabi.view.screeens.catalog
+
+import androidx.lifecycle.ViewModel
+import com.example.wabi.domain.supabase.SupabaseServiceImpl
+import dagger.hilt.android.lifecycle.HiltViewModel
+import javax.inject.Inject
+
+
+@HiltViewModel
+class CatalogVeiwModel @Inject constructor(private val supabase: SupabaseServiceImpl) :
+    ViewModel() {
+
+    }

+ 9 - 12
mobile_app/Wabi/app/src/main/java/com/example/wabi/view/screeens/logIn/LogIn.kt

@@ -14,14 +14,14 @@ import androidx.compose.ui.Modifier
 import androidx.hilt.navigation.compose.hiltViewModel
 import androidx.navigation.NavHostController
 import com.example.wabi.view.screeens.logIn.items.EmailForReset
+import com.example.wabi.view.screeens.logIn.items.LogInStateDestinations
 import com.example.wabi.view.screeens.logIn.items.SignIn
 import com.example.wabi.view.screeens.logIn.items.SignUp
 
 @Composable
 fun LogIn(navHostController: NavHostController, vm: LogInViewModel = hiltViewModel()) {
-    val data = vm.data
     val printError = remember { mutableStateOf(false) }
-    val numbserState = remember { mutableIntStateOf(0) }
+    val loginState = remember { mutableIntStateOf(LogInStateDestinations.signIn) }
 
     Column(
         modifier = Modifier
@@ -30,27 +30,24 @@ fun LogIn(navHostController: NavHostController, vm: LogInViewModel = hiltViewMod
         verticalArrangement = Arrangement.SpaceAround,
         horizontalAlignment = Alignment.CenterHorizontally
     ) {
-        when (numbserState.intValue) {
-            0 -> {
+        when (loginState.intValue) {
+            LogInStateDestinations.signIn -> {
                 SignIn(
                     navController = navHostController,
                     printError = printError,
-                    state = numbserState,
-                    data = data,
+                    state = loginState,
                     vm = vm
                 )
             }
 
-            1 -> {
-                EmailForReset(data.email, vm, numbserState)
+            LogInStateDestinations.signUp -> {
+                SignUp(vm, loginState)
             }
 
-            2 -> {
-                SignUp(data.email, vm, numbserState)
+            LogInStateDestinations.resetPassword -> {
+                EmailForReset(vm, loginState)
             }
         }
-
     }
 
-
 }

+ 77 - 13
mobile_app/Wabi/app/src/main/java/com/example/wabi/view/screeens/logIn/LogInViewModel.kt

@@ -12,7 +12,11 @@ import com.example.wabi.domain.repository.PrefManager
 import com.example.wabi.domain.repository.UserShareDate
 import com.example.wabi.domain.supabase.SupabaseServiceImpl
 import com.example.wabi.models.screens.SignInState
+import com.example.wabi.models.screens.SignUpState
+import com.example.wabi.view.screeens.logIn.items.signUpItems.SignUpStateDestination
 import dagger.hilt.android.lifecycle.HiltViewModel
+import kotlinx.coroutines.flow.MutableStateFlow
+import kotlinx.coroutines.flow.asStateFlow
 import kotlinx.coroutines.launch
 import javax.inject.Inject
 
@@ -20,24 +24,37 @@ import javax.inject.Inject
 class LogInViewModel @Inject constructor(
     private val supabase: SupabaseServiceImpl, private val nav: NavigationProvider
 ) : ViewModel() {
-    private val _data = mutableStateOf(SignInState())
-    val data: SignInState get() = _data.value
 
-    fun updateData(newData: SignInState) {
-        _data.value = newData
+    private val _signInData = mutableStateOf(SignInState())
+    val signInData: SignInState get() = _signInData.value
+
+    private val _signUpData = mutableStateOf(SignUpState())
+    val signUpData: SignUpState get() = _signUpData.value
+
+    private var _emailExists = MutableStateFlow<Boolean>(false)
+    val emailExists = _emailExists.asStateFlow()
+
+    fun updateDataSignIn(newData: SignInState) {
+        _signInData.value = newData
+    }
+
+    fun updateDataSignUp(newData: SignUpState) {
+        _signUpData.value = newData
     }
 
     fun signIn(navController: NavHostController, printError: MutableState<Boolean>) {
-        if (data.email != "" && data.password != "") {
+        if (_signInData.value.email != "" && _signInData.value.password != "") {
             viewModelScope.launch {
-                val response = supabase.signIn(_data.value.email, _data.value.password)
+                val response = supabase.signIn(_signInData.value.email, _signInData.value.password)
                 if (response.error == "") {
 
                     UserShareDate.userIsLogging.value = true
                     printError.value = false
 
                     PrefManager.initPrefManager(UserShareDate.context!!)
-                    PrefManager.saveDataCurrentUser(data.email, data.password)
+                    PrefManager.saveDataCurrentUser(
+                        _signInData.value.email, _signInData.value.password
+                    )
 
                     nav.goToNextScreen(
                         navHostController = navController, Routes.LOGIN, Routes.PROFILE
@@ -54,17 +71,63 @@ class LogInViewModel @Inject constructor(
         return email != "" && android.util.Patterns.EMAIL_ADDRESS.matcher(email).matches()
     }
 
-    fun checkEmailExists(email: String): Boolean {
-        var result = true
-
+    fun checkEmailExists(email: String) {
         viewModelScope.launch {
-            result = supabase.emailIsExists(email)
+            _emailExists.value = supabase.emailIsExists(email)
+            Log.d("email is exists", "result: ${_emailExists.value}")
         }
+    }
 
-        return result
+    fun signUp(
+        printError: MutableState<Int>, stationChanger: MutableState<Int>
+    ) {
+        if (_signUpData.value.email != "" && _signUpData.value.passwordOne != "" && _signUpData.value.passwordTwo != "") {
+            if (checkCorrectPassword(_signUpData.value.passwordOne) && checkCorrectPassword(
+                    _signUpData.value.passwordTwo
+                )
+            ) {
+                if (_signUpData.value.passwordOne == _signUpData.value.passwordTwo) {
+                    viewModelScope.launch {
+                        val checkEmail = supabase.emailIsExists(_signUpData.value.email)
+                        if (!checkEmail) {
+                            printError.value = 0
+
+                            val response = supabase.signUp(
+                                userEmail = _signUpData.value.email,
+                                userPasword = _signUpData.value.passwordOne
+                            )
+
+                            if (response.error == "") {
+
+                                //UserShareDate.userIsLogging.value = true
+                                PrefManager.initPrefManager(UserShareDate.context!!)
+                                PrefManager.saveDataCurrentUser(
+                                    _signInData.value.email, _signInData.value.password
+                                )
+
+                                stationChanger.value = SignUpStateDestination.createProfile
+
+                                Log.d("signUn", "go to created profile")
+                            } else {
+                                Log.d("signUn", "Error registration!")
+                            }
+                        } else {
+                            printError.value = 1
+                        }
+                    }
+                } else {
+                    printError.value = 3
+                }
+            } else {
+                printError.value = 2
+            }
+        } else {
+            printError.value = 4
+        }
     }
 
-    fun checkCorrectPassword(password: String): Boolean {
+
+    private fun checkCorrectPassword(password: String): Boolean {
         return password.length > 5
     }
 
@@ -76,4 +139,5 @@ class LogInViewModel @Inject constructor(
         }
         return result
     }
+
 }

+ 5 - 3
mobile_app/Wabi/app/src/main/java/com/example/wabi/view/screeens/logIn/items/EmailForReset.kt

@@ -20,16 +20,18 @@ import com.example.wabi.view.components.texts.MainText
 import com.example.wabi.view.screeens.logIn.LogInViewModel
 
 @Composable
-fun EmailForReset(email: String, vm: LogInViewModel, state: MutableState<Int>) {
+fun EmailForReset(vm: LogInViewModel, state: MutableState<Int>) {
+    val data = vm.signInData
+
     var correctEmail = remember { mutableStateOf(false) }
-    val currentEmail = remember { mutableStateOf(email) }
+    val currentEmail = remember { mutableStateOf(data.email) }
     val messageVisible = remember { mutableStateOf(false) }
 
     Row(
         modifier = Modifier.fillMaxWidth()
     ) {
         ButtonBack(onClick = {
-            state.value = 0
+            state.value = LogInStateDestinations.signIn
         }, modifier = Modifier.padding(10.dp))
     }
     HeaderText(text = "Восстановите\nпароль")

+ 7 - 0
mobile_app/Wabi/app/src/main/java/com/example/wabi/view/screeens/logIn/items/LogInStateDestinations.kt

@@ -0,0 +1,7 @@
+package com.example.wabi.view.screeens.logIn.items
+
+data object LogInStateDestinations {
+    const val signIn = 0
+    const val signUp = 1
+    const val resetPassword = 2
+}

+ 6 - 6
mobile_app/Wabi/app/src/main/java/com/example/wabi/view/screeens/logIn/items/SignIn.kt

@@ -13,7 +13,6 @@ import androidx.compose.ui.Alignment
 import androidx.compose.ui.Modifier
 import androidx.compose.ui.unit.dp
 import androidx.navigation.NavHostController
-import com.example.wabi.models.screens.SignInState
 import com.example.wabi.ui.theme.WabiTheme
 import com.example.wabi.view.components.buttons.ButtonLink
 import com.example.wabi.view.components.buttons.MainButton
@@ -30,9 +29,10 @@ fun SignIn(
     navController: NavHostController,
     printError: MutableState<Boolean>,
     state: MutableState<Int>,
-    data: SignInState,
     vm: LogInViewModel
 ) {
+    val data = vm.signInData
+
     HeaderText(
         text = "Добро\n" + "пожаловать!"
     )
@@ -43,7 +43,7 @@ fun SignIn(
     ) {
         MainTextField(
             value = data.email,
-            input = { vm.updateData(data.copy(email = it)) },
+            input = { vm.updateDataSignIn(data.copy(email = it)) },
             placeholder = "Почта",
             lable = "Введите почту:",
             trailingText = ""
@@ -51,7 +51,7 @@ fun SignIn(
         Spacer(modifier = Modifier.height(10.dp))
         PasswordTextField(
             value = data.password,
-            input = { vm.updateData(data.copy(password = it)) },
+            input = { vm.updateDataSignIn(data.copy(password = it)) },
             placeholder = "Пароль",
             lable = "Введите пароль:"
         )
@@ -66,7 +66,7 @@ fun SignIn(
         )
         ButtonLink(
             onClick = {
-                state.value = 2
+                state.value = LogInStateDestinations.signUp
             },
             textContent = "Зарегистирируйтесь!",
             modifier = Modifier.offset(y = (-15).dp),
@@ -83,7 +83,7 @@ fun SignIn(
         Spacer(Modifier.height(5.dp))
         ButtonLink(
             onClick = {
-                state.value = 1
+                state.value = LogInStateDestinations.resetPassword
             }, textContent = "Забыли пароль?", colorContent = WabiTheme.colors.mainColor
         )
     }

+ 14 - 62
mobile_app/Wabi/app/src/main/java/com/example/wabi/view/screeens/logIn/items/SignUp.kt

@@ -1,88 +1,40 @@
 package com.example.wabi.view.screeens.logIn.items
 
-import androidx.compose.foundation.layout.Column
 import androidx.compose.foundation.layout.Row
-import androidx.compose.foundation.layout.Spacer
 import androidx.compose.foundation.layout.fillMaxWidth
-import androidx.compose.foundation.layout.height
 import androidx.compose.foundation.layout.padding
 import androidx.compose.runtime.Composable
 import androidx.compose.runtime.MutableState
-import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.mutableIntStateOf
 import androidx.compose.runtime.remember
 import androidx.compose.ui.Modifier
 import androidx.compose.ui.unit.dp
 import com.example.wabi.view.components.buttons.ButtonBack
-import com.example.wabi.view.components.buttons.MainButton
-import com.example.wabi.view.components.textFields.MainTextField
-import com.example.wabi.view.components.textFields.PasswordTextField
-import com.example.wabi.view.components.texts.Error.ErrorList
-import com.example.wabi.view.components.texts.Error.ErrorPrint
-import com.example.wabi.view.components.texts.HeaderText
-import com.example.wabi.view.components.texts.MainText
 import com.example.wabi.view.screeens.logIn.LogInViewModel
+import com.example.wabi.view.screeens.logIn.items.signUpItems.CreatePofile
+import com.example.wabi.view.screeens.logIn.items.signUpItems.EmailAndPassword
+import com.example.wabi.view.screeens.logIn.items.signUpItems.SignUpStateDestination
+import com.example.wabi.view.screeens.logIn.items.signUpItems.SingUpDestinations
 
 @Composable
-fun SignUp(email: String, vm: LogInViewModel, state: MutableState<Int>) {
-    val errorState = remember { mutableStateOf(0) }
-    val currentEmail = remember { mutableStateOf(email) }
-    val password = remember { mutableStateOf("") }
-    val singUpState = remember { mutableStateOf(0) }
+fun SignUp(vm: LogInViewModel, screenState: MutableState<Int>) {
+    val singUpState = remember { mutableIntStateOf(SignUpStateDestination.emailAndPassword) }
 
     Row(
         modifier = Modifier.fillMaxWidth()
     ) {
         ButtonBack(onClick = {
-            state.value = 0
+            screenState.value = LogInStateDestinations.signIn
         }, modifier = Modifier.padding(10.dp))
     }
-    HeaderText(text = "Приветствуем!")
 
-    MainText(
-        text = "Создайте свою личную\nкорзину!"
-    )
-
-    ErrorPrint(
-        text = when (errorState.value) {
-            1 -> ErrorList.existAccountWithEmail
-            2 -> ErrorList.passwordNoCorrect
-            else -> ""
-        }
-    )
-
-    Column(
-        modifier = Modifier.fillMaxWidth()
-    ) {
-        MainTextField(
-            value = currentEmail.value,
-            input = { currentEmail.value = it },
-            placeholder = "Почта",
-            lable = "Введите почту:",
-            trailingText = ""
+    when (singUpState.intValue) {
+        SignUpStateDestination.emailAndPassword -> EmailAndPassword(
+            station = SingUpDestinations.emailAndPassword, stationChanger = singUpState, vm = vm
         )
-        Spacer(modifier = Modifier.height(10.dp))
-        PasswordTextField(
-            value = password.value,
-            input = { password.value = it },
-            placeholder = "Пароль",
-            lable = "Введите пароль:"
+
+        SignUpStateDestination.createProfile -> CreatePofile(
+            station = SingUpDestinations.emailAndPassword, vm = vm
         )
     }
-
-    MainButton(
-        onClick = {
-            if (vm.checkCorrectPassword(password.value)) {
-                if (!vm.checkEmailExists(currentEmail.value)) {
-                    errorState.value = 0
-                } else {
-                    errorState.value = 1
-                }
-            } else {
-                errorState.value = 2
-            }
-        },
-        enabled = password.value != "" && vm.validateEmail(currentEmail.value),
-        textContent = "Далее",
-        modifier = Modifier.padding(30.dp, 0.dp)
-    )
 }

+ 21 - 0
mobile_app/Wabi/app/src/main/java/com/example/wabi/view/screeens/logIn/items/signUpItems/CreatePofile.kt

@@ -0,0 +1,21 @@
+package com.example.wabi.view.screeens.logIn.items.signUpItems
+
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import com.example.wabi.view.components.texts.HeaderText
+import com.example.wabi.view.components.texts.MainText
+import com.example.wabi.view.screeens.logIn.LogInViewModel
+
+@Composable
+fun CreatePofile(
+    station: SingUpDestinations,
+    modifier: Modifier = Modifier,
+    vm: LogInViewModel,
+) {
+    HeaderText(text = station.header)
+
+    MainText(
+        text = station.description
+    )
+
+}

+ 82 - 0
mobile_app/Wabi/app/src/main/java/com/example/wabi/view/screeens/logIn/items/signUpItems/EmailAndPassword.kt

@@ -0,0 +1,82 @@
+package com.example.wabi.view.screeens.logIn.items.signUpItems
+
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.Spacer
+import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.height
+import androidx.compose.foundation.layout.padding
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.MutableState
+import androidx.compose.runtime.mutableIntStateOf
+import androidx.compose.runtime.remember
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.unit.dp
+import com.example.wabi.view.components.buttons.MainButton
+import com.example.wabi.view.components.textFields.MainTextField
+import com.example.wabi.view.components.textFields.PasswordTextField
+import com.example.wabi.view.components.texts.Error.ErrorList
+import com.example.wabi.view.components.texts.Error.ErrorPrint
+import com.example.wabi.view.components.texts.HeaderText
+import com.example.wabi.view.components.texts.MainText
+import com.example.wabi.view.screeens.logIn.LogInViewModel
+
+@Composable
+fun EmailAndPassword(
+    station: SingUpDestinations,
+    modifier: Modifier = Modifier,
+    vm: LogInViewModel,
+    stationChanger: MutableState<Int>
+) {
+    val errorState = remember { mutableIntStateOf(0) }
+    val data = vm.signUpData
+
+    HeaderText(text = station.header)
+
+    MainText(
+        text = station.description
+    )
+
+    ErrorPrint(
+        text = when (errorState.intValue) {
+            1 -> ErrorList.existAccountWithEmail
+            2 -> ErrorList.passwordNoCorrect
+            3 -> ErrorList.passDontMatch
+            4 -> ErrorList.emptyData
+            else -> ""
+        }
+    )
+
+    Column(
+        modifier = Modifier.fillMaxWidth()
+    ) {
+        MainTextField(
+            value = data.email,
+            input = { vm.updateDataSignUp(data.copy(email = it)) },
+            placeholder = "Почта",
+            lable = "Введите почту:",
+            trailingText = ""
+        )
+        Spacer(modifier = Modifier.height(10.dp))
+        PasswordTextField(
+            value = data.passwordOne,
+            input = { vm.updateDataSignUp(data.copy(passwordOne = it)) },
+            placeholder = "Пароль",
+            lable = "Введите пароль:"
+        )
+        Spacer(modifier = Modifier.height(10.dp))
+        PasswordTextField(
+            value = data.passwordTwo,
+            input = { vm.updateDataSignUp(data.copy(passwordTwo = it)) },
+            placeholder = "Пароль",
+            lable = "Повторите пароль:"
+        )
+    }
+
+    MainButton(
+        onClick = {
+            vm.signUp(printError = errorState, stationChanger = stationChanger)
+        }, enabled = data.passwordOne != "" && data.passwordTwo != "" && vm.validateEmail(
+            data.email
+        ), textContent = station.buttonName, modifier = Modifier.padding(30.dp, 0.dp)
+    )
+}

+ 6 - 0
mobile_app/Wabi/app/src/main/java/com/example/wabi/view/screeens/logIn/items/signUpItems/SignUpStateDestination.kt

@@ -0,0 +1,6 @@
+package com.example.wabi.view.screeens.logIn.items.signUpItems
+
+data object SignUpStateDestination {
+    const val emailAndPassword = 0
+    const val createProfile = 1
+}

+ 18 - 0
mobile_app/Wabi/app/src/main/java/com/example/wabi/view/screeens/logIn/items/signUpItems/SingUpDestinations.kt

@@ -0,0 +1,18 @@
+package com.example.wabi.view.screeens.logIn.items.signUpItems
+
+sealed class SingUpDestinations(
+    val header: String = "",
+    val description: String = "",
+    val buttonName: String = ""
+) {
+    object emailAndPassword : SingUpDestinations(
+        header = "Приветствуем",
+        description = "Создайте свою личную\nкорзину!",
+        buttonName = "Далее"
+    )
+    object profile : SingUpDestinations(
+        header = "Создайте\nпрофиль",
+        description = "Будьте уникальны!",
+        buttonName = "Сохранить"
+    )
+}

+ 202 - 0
mobile_app/new/wabi/.idea/workspace.xml

@@ -0,0 +1,202 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="AndroidLayouts">
+    <shared>
+      <config />
+    </shared>
+  </component>
+  <component name="AutoImportSettings">
+    <option name="autoReloadType" value="NONE" />
+  </component>
+  <component name="ChangeListManager">
+    <list default="true" id="21b3d92b-fd7e-4612-a134-20c6a430b8d2" name="Changes" comment="" />
+    <option name="SHOW_DIALOG" value="false" />
+    <option name="HIGHLIGHT_CONFLICTS" value="true" />
+    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
+    <option name="LAST_RESOLUTION" value="IGNORE" />
+  </component>
+  <component name="ClangdSettings">
+    <option name="formatViaClangd" value="false" />
+  </component>
+  <component name="ExecutionTargetManager" SELECTED_TARGET="device_and_snapshot_combo_box_target[DeviceId(pluginId=LocalEmulator, isTemplate=false, identifier=path=C:\Users\bax\.android\avd\Medium_Phone.avd)]" />
+  <component name="ExternalProjectsData">
+    <projectState path="$PROJECT_DIR$">
+      <ProjectState />
+    </projectState>
+  </component>
+  <component name="ExternalProjectsManager">
+    <system id="GRADLE">
+      <state>
+        <task path="$PROJECT_DIR$/app">
+          <activation />
+        </task>
+        <projects_view>
+          <tree_state>
+            <expand>
+              <path>
+                <item name="" type="6a2764b6:ExternalProjectsStructure$RootNode" />
+                <item name="Wabi" type="f1a62948:ProjectNode" />
+              </path>
+              <path>
+                <item name="" type="6a2764b6:ExternalProjectsStructure$RootNode" />
+                <item name="Wabi" type="f1a62948:ProjectNode" />
+                <item name="app" type="2d1252cf:ModuleNode" />
+              </path>
+              <path>
+                <item name="" type="6a2764b6:ExternalProjectsStructure$RootNode" />
+                <item name="Wabi" type="f1a62948:ProjectNode" />
+                <item name="app" type="2d1252cf:ModuleNode" />
+                <item name="Tasks" type="e4a08cd1:TasksNode" />
+              </path>
+              <path>
+                <item name="" type="6a2764b6:ExternalProjectsStructure$RootNode" />
+                <item name="Wabi" type="f1a62948:ProjectNode" />
+                <item name="app" type="2d1252cf:ModuleNode" />
+                <item name="Tasks" type="e4a08cd1:TasksNode" />
+                <item name="other" type="c8890929:TasksNode$1" />
+              </path>
+            </expand>
+            <select />
+          </tree_state>
+        </projects_view>
+      </state>
+    </system>
+  </component>
+  <component name="FileTemplateManagerImpl">
+    <option name="RECENT_TEMPLATES">
+      <list>
+        <option value="Kotlin Interface" />
+        <option value="Kotlin Object" />
+        <option value="Kotlin Data Class" />
+        <option value="Kotlin File" />
+        <option value="Kotlin Class" />
+      </list>
+    </option>
+  </component>
+  <component name="Git.Settings">
+    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/../../.." />
+  </component>
+  <component name="ProjectColorInfo">{
+  &quot;associatedIndex&quot;: 8
+}</component>
+  <component name="ProjectId" id="2pCytqLWoPIbbENJ60gH1roMmsG" />
+  <component name="ProjectLevelVcsManager" settingsEditedManually="true">
+    <ConfirmationsSetting value="2" id="Add" />
+  </component>
+  <component name="ProjectViewState">
+    <option name="hideEmptyMiddlePackages" value="true" />
+    <option name="showLibraryContents" value="true" />
+  </component>
+  <component name="PropertiesComponent"><![CDATA[{
+  "keyToString": {
+    "Android App.app.executor": "Run",
+    "RunOnceActivity.ShowReadmeOnStart": "true",
+    "RunOnceActivity.cidr.known.project.marker": "true",
+    "RunOnceActivity.readMode.enableVisualFormatting": "true",
+    "cf.first.check.clang-format": "false",
+    "cidr.known.project.marker": "true",
+    "com.google.services.firebase.aqiPopupShown": "true",
+    "git-widget-placeholder": "master",
+    "kotlin-language-version-configured": "true",
+    "last_opened_file_path": "D:/Progect/mobile/Wabi/mobile_app/Wabi",
+    "project.structure.last.edited": "Dependencies",
+    "project.structure.proportion": "0.17",
+    "project.structure.side.proportion": "0.2",
+    "settings.editor.selected.configurable": "project.propVCSSupport.DirectoryMappings",
+    "show.do.not.copy.http.proxy.settings.to.gradle": "false"
+  },
+  "keyToStringList": {
+    "kotlin-gradle-user-dirs": [
+      "C:\\Users\\bax\\.gradle"
+    ]
+  }
+}]]></component>
+  <component name="RecentsManager">
+    <key name="CopyFile.RECENT_KEYS">
+      <recent name="D:\Progect\mobile\Wabi\mobile_app\new\wabi\app\src\main\java\com\example\wabi\view\components\textFields" />
+      <recent name="D:\Progect\mobile\Wabi\mobile_app\new\wabi\app\src\main\java\com\example\wabi\view\screeens\signIn\items" />
+      <recent name="D:\Progect\mobile\Wabi\mobile_app\new\wabi\app\src\main\java\com\example\wabi\view\components\texts\Error" />
+      <recent name="D:\Progect\mobile\Wabi\mobile_app\new\wabi\app\src\main\java\com\example\wabi\view\components\buttons" />
+      <recent name="D:\Progect\mobile\Wabi\mobile_app\new\wabi\app\src\main\java\com\example\wabi\models\supabase" />
+    </key>
+  </component>
+  <component name="RunManager">
+    <configuration name="app" type="AndroidRunConfigurationType" factoryName="Android App" activateToolWindowBeforeRun="false">
+      <module name="Wabi.app.main" />
+      <option name="DEPLOY" value="true" />
+      <option name="DEPLOY_APK_FROM_BUNDLE" value="false" />
+      <option name="DEPLOY_AS_INSTANT" value="false" />
+      <option name="ARTIFACT_NAME" value="" />
+      <option name="PM_INSTALL_OPTIONS" value="" />
+      <option name="ALL_USERS" value="false" />
+      <option name="ALWAYS_INSTALL_WITH_PM" value="false" />
+      <option name="CLEAR_APP_STORAGE" value="false" />
+      <option name="DYNAMIC_FEATURES_DISABLED_LIST" value="" />
+      <option name="ACTIVITY_EXTRA_FLAGS" value="" />
+      <option name="MODE" value="default_activity" />
+      <option name="CLEAR_LOGCAT" value="false" />
+      <option name="SHOW_LOGCAT_AUTOMATICALLY" value="false" />
+      <option name="TARGET_SELECTION_MODE" value="DEVICE_AND_SNAPSHOT_COMBO_BOX" />
+      <option name="SELECTED_CLOUD_MATRIX_CONFIGURATION_ID" value="-1" />
+      <option name="SELECTED_CLOUD_MATRIX_PROJECT_ID" value="" />
+      <option name="DEBUGGER_TYPE" value="Auto" />
+      <Auto>
+        <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
+        <option name="SHOW_STATIC_VARS" value="true" />
+        <option name="WORKING_DIR" value="" />
+        <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
+        <option name="SHOW_OPTIMIZED_WARNING" value="true" />
+        <option name="ATTACH_ON_WAIT_FOR_DEBUGGER" value="false" />
+        <option name="DEBUG_SANDBOX_SDK" value="false" />
+      </Auto>
+      <Hybrid>
+        <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
+        <option name="SHOW_STATIC_VARS" value="true" />
+        <option name="WORKING_DIR" value="" />
+        <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
+        <option name="SHOW_OPTIMIZED_WARNING" value="true" />
+        <option name="ATTACH_ON_WAIT_FOR_DEBUGGER" value="false" />
+        <option name="DEBUG_SANDBOX_SDK" value="false" />
+      </Hybrid>
+      <Java>
+        <option name="ATTACH_ON_WAIT_FOR_DEBUGGER" value="false" />
+        <option name="DEBUG_SANDBOX_SDK" value="false" />
+      </Java>
+      <Native>
+        <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
+        <option name="SHOW_STATIC_VARS" value="true" />
+        <option name="WORKING_DIR" value="" />
+        <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
+        <option name="SHOW_OPTIMIZED_WARNING" value="true" />
+        <option name="ATTACH_ON_WAIT_FOR_DEBUGGER" value="false" />
+        <option name="DEBUG_SANDBOX_SDK" value="false" />
+      </Native>
+      <Profilers>
+        <option name="ADVANCED_PROFILING_ENABLED" value="false" />
+        <option name="STARTUP_PROFILING_ENABLED" value="false" />
+        <option name="STARTUP_CPU_PROFILING_ENABLED" value="false" />
+        <option name="STARTUP_CPU_PROFILING_CONFIGURATION_NAME" value="Java/Kotlin Method Sample (legacy)" />
+        <option name="STARTUP_NATIVE_MEMORY_PROFILING_ENABLED" value="false" />
+        <option name="NATIVE_MEMORY_SAMPLE_RATE_BYTES" value="2048" />
+      </Profilers>
+      <option name="DEEP_LINK" value="" />
+      <option name="ACTIVITY_CLASS" value="" />
+      <option name="SEARCH_ACTIVITY_IN_GLOBAL_SCOPE" value="false" />
+      <option name="SKIP_ACTIVITY_VALIDATION" value="false" />
+      <method v="2">
+        <option name="Android.Gradle.BeforeRunTask" enabled="true" />
+      </method>
+    </configuration>
+  </component>
+  <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
+  <component name="TaskManager">
+    <task active="true" id="Default" summary="Default task">
+      <changelist id="21b3d92b-fd7e-4612-a134-20c6a430b8d2" name="Changes" comment="" />
+      <created>1732284569873</created>
+      <option name="number" value="Default" />
+      <option name="presentableId" value="Default" />
+      <updated>1732284569873</updated>
+    </task>
+    <servers />
+  </component>
+</project>