Explorar o código

fix: update onboard verst

Bax hai 3 días
pai
achega
8c6a0ba13a
Modificáronse 17 ficheiros con 274 adicións e 106 borrados
  1. 2 2
      mobile_app/wabi/.idea/deploymentTargetSelector.xml
  2. 0 1
      mobile_app/wabi/app/src/main/java/com/example/wabi/domain/navigation/Navigation.kt
  3. 1 0
      mobile_app/wabi/app/src/main/java/com/example/wabi/domain/network/SupabaseService.kt
  4. 9 0
      mobile_app/wabi/app/src/main/java/com/example/wabi/domain/network/SupabaseServiceImpl.kt
  5. 4 1
      mobile_app/wabi/app/src/main/java/com/example/wabi/view/MainActivity.kt
  6. 3 0
      mobile_app/wabi/app/src/main/java/com/example/wabi/view/common_elements/text/error/ErrorList.kt
  7. 5 0
      mobile_app/wabi/app/src/main/java/com/example/wabi/view/screens/basket/Basket.kt
  8. 5 0
      mobile_app/wabi/app/src/main/java/com/example/wabi/view/screens/catalog/Catalog.kt
  9. 24 16
      mobile_app/wabi/app/src/main/java/com/example/wabi/view/screens/onboard/items/OnBoardState.kt
  10. 10 5
      mobile_app/wabi/app/src/main/java/com/example/wabi/view/screens/onboard/screeen/Onboard.kt
  11. 5 0
      mobile_app/wabi/app/src/main/java/com/example/wabi/view/screens/profile/Profile.kt
  12. 15 78
      mobile_app/wabi/app/src/main/java/com/example/wabi/view/screens/signIn/SignIn.kt
  13. 6 0
      mobile_app/wabi/app/src/main/java/com/example/wabi/view/screens/signIn/SignInViewModel.kt
  14. 66 0
      mobile_app/wabi/app/src/main/java/com/example/wabi/view/screens/signIn/states/EmailForReset.kt
  15. 98 0
      mobile_app/wabi/app/src/main/java/com/example/wabi/view/screens/signIn/states/Login.kt
  16. 9 1
      mobile_app/wabi/app/src/main/java/com/example/wabi/view/screens/signUp/SignUp.kt
  17. 12 2
      mobile_app/wabi/app/src/main/java/com/example/wabi/view/screens/signUp/SignUpViewModel.kt

+ 2 - 2
mobile_app/wabi/.idea/deploymentTargetSelector.xml

@@ -4,10 +4,10 @@
     <selectionStates>
       <SelectionState runConfigName="app">
         <option name="selectionMode" value="DROPDOWN" />
-        <DropdownSelection timestamp="2024-11-21T16:23:24.477613900Z">
+        <DropdownSelection timestamp="2024-11-21T19:07:52.072326Z">
           <Target type="DEFAULT_BOOT">
             <handle>
-              <DeviceId pluginId="LocalEmulator" identifier="path=C:\Users\bax\.android\avd\Medium_Phone_API_30.avd" />
+              <DeviceId pluginId="LocalEmulator" identifier="path=C:\Users\bax\.android\avd\Medium_Phone.avd" />
             </handle>
           </Target>
         </DropdownSelection>

+ 0 - 1
mobile_app/wabi/app/src/main/java/com/example/wabi/domain/navigation/Navigation.kt

@@ -23,7 +23,6 @@ fun Navigation(
     NavHost(
         navController = controller, startDestination = Routes.BASKET
     ) {
-
         composable(Routes.BASKET) {
             visibleBB.value = true
             Log.d("Navigation ->", "nav to ${Routes.BASKET}")

+ 1 - 0
mobile_app/wabi/app/src/main/java/com/example/wabi/domain/network/SupabaseService.kt

@@ -10,5 +10,6 @@ interface SupabaseService {
     suspend fun verifyEmail(email: String)
     suspend fun updateUserData(email: String, password: String, nickname: String, theme: Int = 0, imgeLink: String?)
     suspend fun isSession(): Boolean
+    suspend fun resetPassword(email: String): Response
 }
 

+ 9 - 0
mobile_app/wabi/app/src/main/java/com/example/wabi/domain/network/SupabaseServiceImpl.kt

@@ -51,4 +51,13 @@ class SupabaseServiceImpl @Inject constructor(private val supabase: SupabaseClie
         return supabase.auth.currentUserOrNull() != null
     }
 
+    override suspend fun resetPassword(email: String): Response {
+        return try {
+            var response = supabase.auth.resetPasswordForEmail(email)
+            Response(response.toString())
+        } catch (e: Exception) {
+            Log.d("reset password", e.message.toString())
+            Response("", e.message.toString())
+        }
+    }
 }

+ 4 - 1
mobile_app/wabi/app/src/main/java/com/example/wabi/view/MainActivity.kt

@@ -54,8 +54,11 @@ class MainActivity : ComponentActivity() {
                     }) { paddingValues ->
                     Log.d("Start", "Session: ${UserData.isSession.value}")
                     Box(
-                        modifier = Modifier.padding(paddingValues)
+                        modifier = Modifier
+                            .padding(paddingValues)
+                            .fillMaxSize()
                     ) {
+
                         Navigation(
                             controller = navHostController,
                             visibleBB = visibleBB,

+ 3 - 0
mobile_app/wabi/app/src/main/java/com/example/wabi/view/common_elements/text/error/ErrorList.kt

@@ -3,7 +3,10 @@ package com.example.wabi.view.common_elements.text.error
 //список отображаемых ошибок
 object ErrorList {
     val errorPassOrEmail = "Пароль или почта не верны!"
+    val emailNoCorrect = "Введёная почта не корректна!"
+    val passwordNoCorrect = "Пароль должен быть больше 5 символов!"
     val existAccountWithEmail = "Акккаунт с данной почтой уже существует!"
+    val emailNotExists = "Аккаунта с данной почтной не существует"
     val passDontMatch = "Пароли не совпадают!"
     val noCorrectCode = "Не верный код!"
 }

+ 5 - 0
mobile_app/wabi/app/src/main/java/com/example/wabi/view/screens/basket/Basket.kt

@@ -5,10 +5,15 @@ import androidx.compose.material3.Text
 import androidx.compose.runtime.Composable
 import androidx.hilt.navigation.compose.hiltViewModel
 import androidx.navigation.NavHostController
+import com.example.wabi.domain.navigation.Routes
+import com.example.wabi.domain.repository.UserData
 
 
 @Composable
 fun Basket(navController: NavHostController, vm: BasketVM = hiltViewModel()) {
+
+    UserData.currentScreen = Routes.BASKET
+
 //        CostRow(
 //            cost = 9999999.99,
 //            linkUserBasket = "ссылка",

+ 5 - 0
mobile_app/wabi/app/src/main/java/com/example/wabi/view/screens/catalog/Catalog.kt

@@ -4,9 +4,14 @@ import androidx.compose.foundation.layout.Row
 import androidx.compose.material3.Text
 import androidx.compose.runtime.Composable
 import androidx.navigation.NavHostController
+import com.example.wabi.domain.navigation.Routes
+import com.example.wabi.domain.repository.UserData
 
 @Composable
 fun Catalog(navController: NavHostController) {
+
+    UserData.currentScreen = Routes.CATALOG
+
     Row {
         Text("Это каталог")
     }

+ 24 - 16
mobile_app/wabi/app/src/main/java/com/example/wabi/view/screens/onboard/items/OnBoardState.kt

@@ -27,7 +27,8 @@ fun OnBoardState(onboardItem: OnBoardItem, modifier: Modifier = Modifier) {
         Column(
             modifier = modifier
                 .background(color = WabiTheme.colors.onBoardLight)
-                .fillMaxWidth(),
+                .fillMaxWidth()
+                .height(400.dp),
             verticalArrangement = Arrangement.Center,
             horizontalAlignment = Alignment.CenterHorizontally
         ) {
@@ -36,20 +37,27 @@ fun OnBoardState(onboardItem: OnBoardItem, modifier: Modifier = Modifier) {
                 contentDescription = "onboardItem",
             )
         }
-        Spacer(modifier = Modifier.height(30.dp))
-        Text(
-            text = onboardItem.title,
-            style = WabiTheme.fonts.headerFont,
-            color = WabiTheme.colors.accentColorOne,
-        )
-        Spacer(modifier = Modifier.height(10.dp))
-        Text(
-            text = onboardItem.mainText,
-            style = WabiTheme.fonts.mainFont,
-            color = WabiTheme.colors.onBoardLight,
-            modifier = Modifier.padding(50.dp, 0.dp),
-            minLines = 3,
-            maxLines = 3
-        )
+        Column(
+            modifier = modifier
+                .background(color = WabiTheme.colors.onBoardDark)
+                .fillMaxWidth(),
+            horizontalAlignment = Alignment.CenterHorizontally
+        ) {
+            Spacer(modifier = Modifier.height(30.dp))
+            Text(
+                text = onboardItem.title,
+                style = WabiTheme.fonts.headerFont,
+                color = WabiTheme.colors.accentColorOne,
+            )
+            Spacer(modifier = Modifier.height(10.dp))
+            Text(
+                text = onboardItem.mainText,
+                style = WabiTheme.fonts.mainFont,
+                color = WabiTheme.colors.onBoardLight,
+                modifier = Modifier.padding(50.dp, 0.dp),
+                minLines = 3,
+                maxLines = 3
+            )
+        }
     }
 }

+ 10 - 5
mobile_app/wabi/app/src/main/java/com/example/wabi/view/screens/onboard/screeen/Onboard.kt

@@ -4,6 +4,7 @@ import androidx.compose.foundation.background
 import androidx.compose.foundation.layout.Arrangement
 import androidx.compose.foundation.layout.Column
 import androidx.compose.foundation.layout.Spacer
+import androidx.compose.foundation.layout.fillMaxHeight
 import androidx.compose.foundation.layout.fillMaxSize
 import androidx.compose.foundation.layout.fillMaxWidth
 import androidx.compose.foundation.layout.height
@@ -21,6 +22,8 @@ import androidx.compose.ui.Modifier
 import androidx.compose.ui.unit.dp
 import androidx.hilt.navigation.compose.hiltViewModel
 import androidx.navigation.NavHostController
+import com.example.wabi.domain.navigation.Routes
+import com.example.wabi.domain.repository.UserData
 import com.example.wabi.model.appModels.screens.OnBoardItem
 import com.example.wabi.ui.theme.WabiTheme
 import com.example.wabi.view.common_elements.button.ButtonLink
@@ -38,7 +41,7 @@ fun Onboard(
     val pages = listOf(
         OnBoardItem.First, OnBoardItem.Second, OnBoardItem.Third
     )
-
+    UserData.currentScreen = Routes.ONBOARD
     val pagerState = rememberPagerState(initialPage = 0) { pages.size }
 
     val noEnd = remember {
@@ -59,11 +62,13 @@ fun Onboard(
             .verticalScroll(rememberScrollState())
             .background(color = WabiTheme.colors.onBoardDark)
             .fillMaxSize(),
-        verticalArrangement = Arrangement.SpaceBetween,
+        verticalArrangement = Arrangement.SpaceEvenly,
         horizontalAlignment = Alignment.CenterHorizontally
     ) {
-        HorizontalPager(state = pagerState) { index ->
-            OnBoardState(onboardItem = pages[index], modifier = Modifier.height(370.dp))
+        HorizontalPager(
+            state = pagerState, modifier = Modifier
+        ) { index ->
+            OnBoardState(onboardItem = pages[index], modifier = Modifier.fillMaxHeight())
         }
 
         Spacer(modifier = Modifier.height(40.dp))
@@ -97,6 +102,6 @@ fun Onboard(
             textContent = noEnd.value[1],
             enabled = noEnd.value[1].isNotEmpty()
         )
-        Spacer(modifier = Modifier.height(40.dp))
+        Spacer(modifier = Modifier.height(100.dp))
     }
 }

+ 5 - 0
mobile_app/wabi/app/src/main/java/com/example/wabi/view/screens/profile/Profile.kt

@@ -4,9 +4,14 @@ import androidx.compose.foundation.layout.Row
 import androidx.compose.material3.Text
 import androidx.compose.runtime.Composable
 import androidx.navigation.NavHostController
+import com.example.wabi.domain.navigation.Routes
+import com.example.wabi.domain.repository.UserData
 
 @Composable
 fun Profile(navController: NavHostController) {
+
+    UserData.currentScreen = Routes.PROFILE
+
     Row {
         Text("Это профиль")
     }

+ 15 - 78
mobile_app/wabi/app/src/main/java/com/example/wabi/view/screens/signIn/SignIn.kt

@@ -2,37 +2,26 @@ package com.example.wabi.view.screens.signIn
 
 import androidx.compose.foundation.layout.Arrangement
 import androidx.compose.foundation.layout.Column
-import androidx.compose.foundation.layout.Spacer
 import androidx.compose.foundation.layout.fillMaxSize
-import androidx.compose.foundation.layout.fillMaxWidth
-import androidx.compose.foundation.layout.height
-import androidx.compose.foundation.layout.offset
-import androidx.compose.foundation.layout.padding
 import androidx.compose.foundation.rememberScrollState
 import androidx.compose.foundation.verticalScroll
-import androidx.compose.material3.Text
 import androidx.compose.runtime.Composable
 import androidx.compose.runtime.mutableStateOf
 import androidx.compose.runtime.remember
 import androidx.compose.ui.Alignment
 import androidx.compose.ui.Modifier
-import androidx.compose.ui.unit.dp
 import androidx.hilt.navigation.compose.hiltViewModel
 import androidx.navigation.NavHostController
 import com.example.wabi.domain.navigation.Routes
 import com.example.wabi.domain.repository.UserData
-import com.example.wabi.ui.theme.WabiTheme
-import com.example.wabi.view.common_elements.button.ButtonLink
-import com.example.wabi.view.common_elements.button.MainButton
-import com.example.wabi.view.common_elements.text.error.ErrorList
-import com.example.wabi.view.common_elements.text.error.ErrorPrint
-import com.example.wabi.view.common_elements.textfields.MainTextField
-import com.example.wabi.view.common_elements.textfields.PasswordTextField
+import com.example.wabi.view.screens.signIn.states.EmailForReset
+import com.example.wabi.view.screens.signIn.states.Login
 
 @Composable
 fun SignIn(navController: NavHostController, vm: SignInViewModel = hiltViewModel()) {
     val data = vm.data
     val printError = remember { mutableStateOf(false) }
+    val visible = remember { mutableStateOf(true) }
 
     UserData.currentScreen = Routes.SIGNIN
 
@@ -43,70 +32,18 @@ fun SignIn(navController: NavHostController, vm: SignInViewModel = hiltViewModel
         verticalArrangement = Arrangement.SpaceAround,
         horizontalAlignment = Alignment.CenterHorizontally
     ) {
-
-        Text(
-            text = "Добро\nпожаловать!",
-            style = WabiTheme.fonts.headerFont,
-            maxLines = 2,
-            minLines = 2,
-            color = WabiTheme.colors.mainColor
-        )
-        Text(
-            text = "Войдите, чтобы\nпользоваться функциями приложения",
-            style = WabiTheme.fonts.mainFont,
-            color = WabiTheme.colors.mainColor
-        )
-        ErrorPrint(text = if (printError.value) ErrorList.errorPassOrEmail else "")
-        Column(
-            modifier = Modifier.fillMaxWidth()
-        ) {
-            MainTextField(
-                value = data.email,
-                input = { vm.updateData(data.copy(email = it)) },
-                placeholder = "Почта",
-                lable = "Введите почту:",
-                trailingText = ""
-            )
-            Spacer(modifier = Modifier.height(10.dp))
-            PasswordTextField(
-                value = data.password,
-                input = { vm.updateData(data.copy(password = it)) },
-                placeholder = "Пароль",
-                lable = "Введите пароль:"
-            )
-        }
-        Column(
-            horizontalAlignment = Alignment.CenterHorizontally
-        ) {
-            Text(
-                text = "Нет аккаунта?",
-                style = WabiTheme.fonts.acentFont,
-                color = WabiTheme.colors.mainColor
-            )
-            ButtonLink(
-                onClick = {
-                    vm.goToRegistration(navController = navController)
-                },
-                textContent = "Зарегистирируйтесь!",
-                modifierButton = Modifier.offset(y = (-15).dp),
-                colorContent = WabiTheme.colors.mainColor
-            )
-            MainButton(
-                onClick = {
-                    vm.signIn(navController = navController, printError = printError)
-                },
-                enabled = data.email != "" && data.password != "",
-                textContent = "Войти",
-                modifierButton = Modifier
-                    .padding(30.dp, 0.dp)
-                    .fillMaxWidth()
-            )
-            Spacer(Modifier.height(5.dp))
-            ButtonLink(
-                onClick = {
-                    //привязать переход на страницу регистрации
-                }, textContent = "Забыли пароль?", colorContent = WabiTheme.colors.mainColor
+        if (visible.value) {
+            Login(
+                navController = navController,
+                printError = printError,
+                visible = visible,
+                data = data,
+                vm = vm
             )
+        } else {
+            EmailForReset(data.email, vm, visible)
         }
     }
-}
+}
+
+

+ 6 - 0
mobile_app/wabi/app/src/main/java/com/example/wabi/view/screens/signIn/SignInViewModel.kt

@@ -49,4 +49,10 @@ class SignInViewModel @Inject constructor(
             )
         }
     }
+
+    fun validateEmail(email: String): Boolean {
+        return email != "" && android.util.Patterns.EMAIL_ADDRESS.matcher(email).matches()
+    }
+
+
 }

+ 66 - 0
mobile_app/wabi/app/src/main/java/com/example/wabi/view/screens/signIn/states/EmailForReset.kt

@@ -0,0 +1,66 @@
+package com.example.wabi.view.screens.signIn.states
+
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.Row
+import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.padding
+import androidx.compose.material3.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.MutableState
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.remember
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.unit.dp
+import com.example.wabi.ui.theme.WabiTheme
+import com.example.wabi.view.common_elements.button.ButtonBack
+import com.example.wabi.view.common_elements.button.MainButton
+import com.example.wabi.view.common_elements.text.error.ErrorList
+import com.example.wabi.view.common_elements.text.error.ErrorPrint
+import com.example.wabi.view.common_elements.textfields.MainTextField
+import com.example.wabi.view.screens.signIn.SignInViewModel
+
+@Composable
+fun EmailForReset(email: String, vm: SignInViewModel, visible: MutableState<Boolean>) {
+    var correctEmail = remember { mutableStateOf(false) }
+    val currentEmail = remember { mutableStateOf(email) }
+    Row(
+        modifier = Modifier.fillMaxWidth()
+    ) {
+        ButtonBack(onClick = {
+            visible.value = true
+        }, modifier = Modifier.padding(10.dp))
+    }
+    Text(
+        text = "Восстановите\nпароль",
+        style = WabiTheme.fonts.headerFont,
+        maxLines = 2,
+        minLines = 2,
+        color = WabiTheme.colors.mainColor
+    )
+    Text(
+        text = "Для восстановления\nпароля введите\nсвою почту",
+        style = WabiTheme.fonts.mainFont,
+        color = WabiTheme.colors.mainColor
+    )
+    ErrorPrint(text = if (correctEmail.value) ErrorList.emailNotExists else "")
+
+    Column() {
+        MainTextField(
+            value = currentEmail.value,
+            input = { currentEmail.value = it },
+            placeholder = "Почта",
+            lable = "Введите почту:",
+            trailingText = ""
+        )
+    }
+
+    MainButton(
+        onClick = {},
+        enabled = vm.validateEmail(currentEmail.value),
+        textContent = "Отправить код",
+        modifierButton = Modifier
+            .padding(30.dp, 0.dp)
+            .fillMaxWidth()
+    )
+
+}

+ 98 - 0
mobile_app/wabi/app/src/main/java/com/example/wabi/view/screens/signIn/states/Login.kt

@@ -0,0 +1,98 @@
+package com.example.wabi.view.screens.signIn.states
+
+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.offset
+import androidx.compose.foundation.layout.padding
+import androidx.compose.material3.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.MutableState
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.unit.dp
+import androidx.navigation.NavHostController
+import com.example.wabi.model.screens.SignInState
+import com.example.wabi.ui.theme.WabiTheme
+import com.example.wabi.view.common_elements.button.ButtonLink
+import com.example.wabi.view.common_elements.button.MainButton
+import com.example.wabi.view.common_elements.text.error.ErrorList
+import com.example.wabi.view.common_elements.text.error.ErrorPrint
+import com.example.wabi.view.common_elements.textfields.MainTextField
+import com.example.wabi.view.common_elements.textfields.PasswordTextField
+import com.example.wabi.view.screens.signIn.SignInViewModel
+
+@Composable
+fun Login(
+    navController: NavHostController,
+    printError: MutableState<Boolean>,
+    visible: MutableState<Boolean>,
+    data: SignInState,
+    vm: SignInViewModel
+) {
+    Text(
+        text = "Добро\nпожаловать!",
+        style = WabiTheme.fonts.headerFont,
+        maxLines = 2,
+        minLines = 2,
+        color = WabiTheme.colors.mainColor
+    )
+    Text(
+        text = "Войдите, чтобы\nпользоваться функциями приложения",
+        style = WabiTheme.fonts.mainFont,
+        color = WabiTheme.colors.mainColor
+    )
+    ErrorPrint(text = if (printError.value) ErrorList.errorPassOrEmail else "")
+    Column(
+        modifier = Modifier.fillMaxWidth()
+    ) {
+        MainTextField(
+            value = data.email,
+            input = { vm.updateData(data.copy(email = it)) },
+            placeholder = "Почта",
+            lable = "Введите почту:",
+            trailingText = ""
+        )
+        Spacer(modifier = Modifier.height(10.dp))
+        PasswordTextField(
+            value = data.password,
+            input = { vm.updateData(data.copy(password = it)) },
+            placeholder = "Пароль",
+            lable = "Введите пароль:"
+        )
+    }
+    Column(
+        horizontalAlignment = Alignment.CenterHorizontally
+    ) {
+        Text(
+            text = "Нет аккаунта?",
+            style = WabiTheme.fonts.acentFont,
+            color = WabiTheme.colors.mainColor
+        )
+        ButtonLink(
+            onClick = {
+                vm.goToRegistration(navController = navController)
+            },
+            textContent = "Зарегистирируйтесь!",
+            modifierButton = Modifier.offset(y = (-15).dp),
+            colorContent = WabiTheme.colors.mainColor
+        )
+        MainButton(
+            onClick = {
+                vm.signIn(navController = navController, printError = printError)
+            },
+            enabled = data.password != "" && vm.validateEmail(data.email),
+            textContent = "Войти",
+            modifierButton = Modifier
+                .padding(30.dp, 0.dp)
+                .fillMaxWidth()
+        )
+        Spacer(Modifier.height(5.dp))
+        ButtonLink(
+            onClick = {
+                visible.value = false
+            }, textContent = "Забыли пароль?", colorContent = WabiTheme.colors.mainColor
+        )
+    }
+}

+ 9 - 1
mobile_app/wabi/app/src/main/java/com/example/wabi/view/screens/signUp/SignUp.kt

@@ -1,13 +1,17 @@
 package com.example.wabi.view.screens.signUp
 
 import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.Row
 import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.padding
 import androidx.compose.runtime.Composable
 import androidx.compose.ui.Modifier
+import androidx.compose.ui.unit.dp
 import androidx.hilt.navigation.compose.hiltViewModel
 import androidx.navigation.NavHostController
 import com.example.wabi.domain.navigation.Routes
 import com.example.wabi.domain.repository.UserData
+import com.example.wabi.view.common_elements.button.ButtonBack
 
 
 @Composable
@@ -15,7 +19,11 @@ fun SignUp(navController: NavHostController, vm: SignUpViewModel = hiltViewModel
 
     // val states = listOf()
     UserData.currentScreen = Routes.SIGNUP
-
+    Row {
+        ButtonBack(onClick = {
+            vm.goToSignIn(navController)
+        }, modifier = Modifier.padding(10.dp))
+    }
     Column(
         modifier = Modifier.fillMaxWidth()
     ) {

+ 12 - 2
mobile_app/wabi/app/src/main/java/com/example/wabi/view/screens/signUp/SignUpViewModel.kt

@@ -1,12 +1,22 @@
 package com.example.wabi.view.screens.signUp
 
 import androidx.lifecycle.ViewModel
+import androidx.navigation.NavHostController
+import com.example.wabi.domain.navigation.NavigationFun
+import com.example.wabi.domain.navigation.Routes
 import com.example.wabi.domain.network.SupabaseServiceImpl
 import dagger.hilt.android.lifecycle.HiltViewModel
 import javax.inject.Inject
 
 @HiltViewModel
-class SignUpViewModel @Inject constructor(private val sup: SupabaseServiceImpl) : ViewModel()
-{
+class SignUpViewModel @Inject constructor(
+    private val sup: SupabaseServiceImpl, private val nav: NavigationFun
+) : ViewModel() {
+    fun goToSignIn(navController: NavHostController) {
+        nav.NextScreen(navController, whereFrom = Routes.SIGNUP, where = Routes.SIGNIN)
+    }
 
+    fun validateEmail(email: String): Boolean {
+        return android.util.Patterns.EMAIL_ADDRESS.matcher(email).matches()
+    }
 }