Bladeren bron

feat: add patterns for view text

Bax 1 dag geleden
bovenliggende
commit
59b0de5c02
24 gewijzigde bestanden met toevoegingen van 459 en 102 verwijderingen
  1. 44 0
      mobile_app/new/wabi/.idea/inspectionProfiles/Project_Default.xml
  2. 12 10
      mobile_app/new/wabi/app/src/main/java/com/example/wabi/domain/navigation/Navigation.kt
  3. 7 0
      mobile_app/new/wabi/app/src/main/java/com/example/wabi/domain/repository/PrefManager.kt
  4. 3 1
      mobile_app/new/wabi/app/src/main/java/com/example/wabi/domain/supabase/SupabaseService.kt
  5. 10 2
      mobile_app/new/wabi/app/src/main/java/com/example/wabi/domain/supabase/SupabaseServiceImpl.kt
  6. 0 1
      mobile_app/new/wabi/app/src/main/java/com/example/wabi/models/system/Type.kt
  7. 2 1
      mobile_app/new/wabi/app/src/main/java/com/example/wabi/view/MainActivity.kt
  8. 3 3
      mobile_app/new/wabi/app/src/main/java/com/example/wabi/view/MainActivityViewModel.kt
  9. 5 3
      mobile_app/new/wabi/app/src/main/java/com/example/wabi/view/components/bars/bottom/BottomBar.kt
  10. 4 9
      mobile_app/new/wabi/app/src/main/java/com/example/wabi/view/components/bars/bottom/DestinationBB.kt
  11. 9 11
      mobile_app/new/wabi/app/src/main/java/com/example/wabi/view/components/buttons/ButtonLink.kt
  12. 62 0
      mobile_app/new/wabi/app/src/main/java/com/example/wabi/view/components/textFields/MainTextField.kt
  13. 104 0
      mobile_app/new/wabi/app/src/main/java/com/example/wabi/view/components/textFields/PasswordTextField.kt
  14. 30 0
      mobile_app/new/wabi/app/src/main/java/com/example/wabi/view/components/texts/AccentText.kt
  15. 31 0
      mobile_app/new/wabi/app/src/main/java/com/example/wabi/view/components/texts/HeaderText.kt
  16. 26 0
      mobile_app/new/wabi/app/src/main/java/com/example/wabi/view/components/texts/MainText.kt
  17. 7 8
      mobile_app/new/wabi/app/src/main/java/com/example/wabi/view/screeens/onboard/items/PartSlider.kt
  18. 4 3
      mobile_app/new/wabi/app/src/main/java/com/example/wabi/view/screeens/profile/Profile.kt
  19. 28 0
      mobile_app/new/wabi/app/src/main/java/com/example/wabi/view/screeens/profile/ProfileViewModel.kt
  20. 36 3
      mobile_app/new/wabi/app/src/main/java/com/example/wabi/view/screeens/signIn/SignIn.kt
  21. 7 1
      mobile_app/new/wabi/app/src/main/java/com/example/wabi/view/screeens/signIn/SignInViewModel.kt
  22. 8 13
      mobile_app/new/wabi/app/src/main/java/com/example/wabi/view/screeens/signIn/items/EmailForReset.kt
  23. 17 25
      mobile_app/new/wabi/app/src/main/java/com/example/wabi/view/screeens/signIn/items/Login.kt
  24. 0 8
      mobile_app/new/wabi/app/src/main/java/com/example/wabi/view/ui/theme/Type.kt

+ 44 - 0
mobile_app/new/wabi/.idea/inspectionProfiles/Project_Default.xml

@@ -0,0 +1,44 @@
+<component name="InspectionProjectProfileManager">
+  <profile version="1.0">
+    <option name="myName" value="Project Default" />
+    <inspection_tool class="ComposePreviewDimensionRespectsLimit" enabled="true" level="WARNING" enabled_by_default="true">
+      <option name="composableFile" value="true" />
+    </inspection_tool>
+    <inspection_tool class="ComposePreviewMustBeTopLevelFunction" enabled="true" level="ERROR" enabled_by_default="true">
+      <option name="composableFile" value="true" />
+    </inspection_tool>
+    <inspection_tool class="ComposePreviewNeedsComposableAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
+      <option name="composableFile" value="true" />
+    </inspection_tool>
+    <inspection_tool class="ComposePreviewNotSupportedInUnitTestFiles" enabled="true" level="ERROR" enabled_by_default="true">
+      <option name="composableFile" value="true" />
+    </inspection_tool>
+    <inspection_tool class="GlancePreviewDimensionRespectsLimit" enabled="true" level="WARNING" enabled_by_default="true">
+      <option name="composableFile" value="true" />
+    </inspection_tool>
+    <inspection_tool class="GlancePreviewMustBeTopLevelFunction" enabled="true" level="ERROR" enabled_by_default="true">
+      <option name="composableFile" value="true" />
+    </inspection_tool>
+    <inspection_tool class="GlancePreviewNeedsComposableAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
+      <option name="composableFile" value="true" />
+    </inspection_tool>
+    <inspection_tool class="GlancePreviewNotSupportedInUnitTestFiles" enabled="true" level="ERROR" enabled_by_default="true">
+      <option name="composableFile" value="true" />
+    </inspection_tool>
+    <inspection_tool class="PreviewAnnotationInFunctionWithParameters" enabled="true" level="ERROR" enabled_by_default="true">
+      <option name="composableFile" value="true" />
+    </inspection_tool>
+    <inspection_tool class="PreviewApiLevelMustBeValid" enabled="true" level="ERROR" enabled_by_default="true">
+      <option name="composableFile" value="true" />
+    </inspection_tool>
+    <inspection_tool class="PreviewFontScaleMustBeGreaterThanZero" enabled="true" level="ERROR" enabled_by_default="true">
+      <option name="composableFile" value="true" />
+    </inspection_tool>
+    <inspection_tool class="PreviewMultipleParameterProviders" enabled="true" level="ERROR" enabled_by_default="true">
+      <option name="composableFile" value="true" />
+    </inspection_tool>
+    <inspection_tool class="PreviewPickerAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
+      <option name="composableFile" value="true" />
+    </inspection_tool>
+  </profile>
+</component>

+ 12 - 10
mobile_app/new/wabi/app/src/main/java/com/example/wabi/domain/navigation/Navigation.kt

@@ -6,6 +6,7 @@ import androidx.compose.runtime.MutableState
 import androidx.navigation.NavHostController
 import androidx.navigation.compose.NavHost
 import androidx.navigation.compose.composable
+import com.example.wabi.domain.repository.UserShareDate
 import com.example.wabi.view.screeens.basket.Basket
 import com.example.wabi.view.screeens.catalog.Catalog
 import com.example.wabi.view.screeens.onboard.Onboard
@@ -36,17 +37,18 @@ fun Navigation(
             Log.d("navigation", "go to CATALOG")
             Catalog(navHostController)
         }
-        composable(Routes.SIGNIN) {
-            Log.d("navigation", "go to SIGNIN")
-            SignIn(navHostController)
-        }
         composable(Routes.PROFILE) {
-            Log.d("navigation", "go to PROFILE")
-            Profile(navHostController)
-        }
-        composable(Routes.SIGNUP) {
-            Log.d("navigation", "go to SIGNUP")
-            SignUp(navHostController)
+            if (UserShareDate.userIsLogging.value) {
+                Log.d("navigation", "go to PROFILE")
+                Profile(navHostController)
+            } else {
+                Log.d("navigation", "go to SIGNIN")
+                SignIn(navHostController)
+            }
         }
+//        composable(Routes.SIGNUP) {
+//            Log.d("navigation", "go to SIGNUP")
+//            SignUp(navHostController)
+//        }
     }
 }

+ 7 - 0
mobile_app/new/wabi/app/src/main/java/com/example/wabi/domain/repository/PrefManager.kt

@@ -2,6 +2,7 @@ package com.example.wabi.domain.repository
 
 import android.content.Context
 import android.content.SharedPreferences
+import android.util.Log
 
 object PrefManager {
     private lateinit var localDataSp: SharedPreferences
@@ -21,9 +22,13 @@ object PrefManager {
     fun saveDataCurrentUser(email: String, password: String) {
         localDataSp.edit().putString("email", email).apply()
         localDataSp.edit().putString("password", password).apply()
+
+        Log.d("pref manager", "user data was saved")
     }
 
     fun getDataCurrentUser(): List<String?> {
+        Log.d("pref manager", "user data was got")
+
         return listOf(
             localDataSp.getString("email", null),
             localDataSp.getString("password", null)
@@ -33,5 +38,7 @@ object PrefManager {
     fun clearDataCurrentUser() {
         localDataSp.edit().remove("email").apply()
         localDataSp.edit().remove("password").apply()
+
+        Log.d("pref manager", "user data was clean")
     }
 }

+ 3 - 1
mobile_app/new/wabi/app/src/main/java/com/example/wabi/domain/supabase/SupabaseService.kt

@@ -4,5 +4,7 @@ import com.example.wabi.models.responses.Response
 
 interface SupabaseService {
     suspend fun signIn(userEmail: String, userPasword: String): Response
-    suspend fun signOun(): Response
+    suspend fun signOut(): Response
+    suspend fun signUp(): Response
+    suspend fun addUser(): Response
 }

+ 10 - 2
mobile_app/new/wabi/app/src/main/java/com/example/wabi/domain/supabase/SupabaseServiceImpl.kt

@@ -24,9 +24,9 @@ class SupabaseServiceImpl @Inject constructor(private val supabase: SupabaseClie
         }
     }
 
-    override suspend fun signOun(): Response {
+    override suspend fun signOut(): Response {
         return try {
-            var response = supabase.auth.signOut()
+            val response = supabase.auth.signOut()
             Log.d("signOut", "The user logged out")
             Response(response.toString())
         } catch (e: Exception) {
@@ -34,4 +34,12 @@ class SupabaseServiceImpl @Inject constructor(private val supabase: SupabaseClie
             Response("", e.message.toString())
         }
     }
+
+    override suspend fun signUp(): Response {
+        TODO("Not yet implemented")
+    }
+
+    override suspend fun addUser(): Response {
+        TODO("Not yet implemented")
+    }
 }

+ 0 - 1
mobile_app/new/wabi/app/src/main/java/com/example/wabi/models/system/Type.kt

@@ -12,6 +12,5 @@ data class Type(
     val buttonFont: TextStyle,
     val forTextField: TextStyle,
     val error: TextStyle,
-    val link: TextStyle,
     val code: TextStyle
 )

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

@@ -42,6 +42,7 @@ class MainActivity : ComponentActivity() {
             PrefManager.initPrefManager(UserShareDate.context!!)
 
             WabiTheme(themeState = PrefManager.userTheme) {
+
                 Scaffold(modifier = Modifier.fillMaxSize(),
                     containerColor = WabiTheme.colors.backgroundColor,
                     bottomBar = {
@@ -57,7 +58,6 @@ class MainActivity : ComponentActivity() {
                             .fillMaxSize()
                             .padding(innerPadding)
                     ) {
-
                         InitApp(navHostController, isBottomBar)
                     }
                 }
@@ -72,6 +72,7 @@ fun InitApp(
     isBottomBar: MutableState<Boolean>,
     vm: MainActivityViewModel = hiltViewModel()
 ) {
+    vm.checkUserlogging()
     Navigation(
         navHostController, start = if (PrefManager.onboard) {
             Routes.ONBOARD

+ 3 - 3
mobile_app/new/wabi/app/src/main/java/com/example/wabi/view/MainActivityViewModel.kt

@@ -13,18 +13,18 @@ import javax.inject.Inject
 class MainActivityViewModel @Inject constructor(private val supabase: SupabaseServiceImpl) :
     ViewModel() {
 
-    init {
+    fun checkUserlogging() {
         val email = PrefManager.getDataCurrentUser()[0]
         val password = PrefManager.getDataCurrentUser()[1]
 
         viewModelScope.launch {
             if (email != null && password != null && email.isNotEmpty() && password.isNotEmpty()) {
                 val response = supabase.signIn(email, password)
-
                 if (response.error == "") {
-                    UserShareDate.userIsLogging.value == true
+                    UserShareDate.userIsLogging.value = true
                 }
             }
         }
+
     }
 }

+ 5 - 3
mobile_app/new/wabi/app/src/main/java/com/example/wabi/view/components/bars/bottom/BottomBar.kt

@@ -13,7 +13,9 @@ import androidx.compose.material3.ButtonDefaults
 import androidx.compose.material3.Icon
 import androidx.compose.material3.NavigationBar
 import androidx.compose.runtime.Composable
+import androidx.compose.runtime.LaunchedEffect
 import androidx.compose.runtime.getValue
+import androidx.compose.runtime.remember
 import androidx.compose.ui.Modifier
 import androidx.compose.ui.draw.clip
 import androidx.compose.ui.graphics.vector.ImageVector
@@ -30,9 +32,9 @@ fun BottomBar(
     modifier: Modifier = Modifier,
     vm: BottomBarViewModel = hiltViewModel()
 ) {
-    val screens = listOf(
-        DestinationBB.Catalog, DestinationBB.Basket, DestinationBB.Profile
-    )
+    val screens = remember {
+        listOf(DestinationBB.Catalog, DestinationBB.Basket, DestinationBB.Profile)
+    }
 
     NavigationBar(
         modifier = modifier.clip(shape = RoundedCornerShape(topEnd = 15.dp, topStart = 15.dp)),

+ 4 - 9
mobile_app/new/wabi/app/src/main/java/com/example/wabi/view/components/bars/bottom/DestinationBB.kt

@@ -2,24 +2,19 @@ package com.example.wabi.view.components.bars.bottom
 
 import com.example.wabi.R
 import com.example.wabi.domain.navigation.Routes
-import com.example.wabi.domain.repository.UserShareDate
 
 sealed class DestinationBB(
     val route: String, val iconId: Int
 ) {
-    data object Basket : DestinationBB(
+    object Basket : DestinationBB(
         route = Routes.BASKET, iconId = R.drawable.user_basket_vector
     )
 
-    data object Catalog : DestinationBB(
+    object Catalog : DestinationBB(
         route = Routes.CATALOG, iconId = R.drawable.catalog_vector
     )
 
-    data object Profile : DestinationBB(
-        route = if (UserShareDate.userIsLogging.value) {
-            Routes.PROFILE
-        } else {
-            Routes.SIGNIN
-        }, iconId = R.drawable.man_vector
+    object Profile : DestinationBB(
+        route = Routes.PROFILE, iconId = R.drawable.man_vector
     )
 }

+ 9 - 11
mobile_app/new/wabi/app/src/main/java/com/example/wabi/view/components/buttons/ButtonLink.kt

@@ -3,11 +3,12 @@ package com.example.wabi.view.components.buttons
 import android.annotation.SuppressLint
 import androidx.compose.material3.Button
 import androidx.compose.material3.ButtonDefaults
-import androidx.compose.material3.Text
 import androidx.compose.runtime.Composable
 import androidx.compose.ui.Modifier
 import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.text.style.TextAlign
 import com.example.wabi.ui.theme.WabiTheme
+import com.example.wabi.view.components.texts.AccentText
 
 //функция, создающая кнопку в виде сслыки (подчёркнутого текста)
 @Composable
@@ -20,18 +21,15 @@ fun ButtonLink(
     enabled: Boolean = true
 ): Unit {
     Button(
-        onClick = onClick,
-        colors = ButtonDefaults.buttonColors(
-            contentColor = colorContent,
-            containerColor = Color.Transparent
-        ),
-        modifier = modifier,
-        enabled = enabled
+        onClick = onClick, colors = ButtonDefaults.buttonColors(
+            contentColor = colorContent, containerColor = Color.Transparent
+        ), modifier = modifier, enabled = enabled
     ) {
-        Text(
+        AccentText(
             text = textContent,
-            style = WabiTheme.fonts.link,
-            modifier = modifierContetnt
+            modifier = modifierContetnt,
+            textAlign = TextAlign.Center,
+            isUnderline = true
         )
     }
 }

+ 62 - 0
mobile_app/new/wabi/app/src/main/java/com/example/wabi/view/components/textFields/MainTextField.kt

@@ -0,0 +1,62 @@
+package com.example.wabi.view.components.textFields
+
+import androidx.compose.foundation.border
+import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.layout.wrapContentHeight
+import androidx.compose.foundation.shape.RoundedCornerShape
+import androidx.compose.material3.OutlinedTextField
+import androidx.compose.material3.Text
+import androidx.compose.material3.TextFieldDefaults
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.unit.dp
+import androidx.compose.ui.unit.sp
+import com.example.wabi.ui.theme.WabiTheme
+import com.example.wabi.view.components.texts.AccentText
+
+//поле ввода для обычного текста
+@Composable
+fun MainTextField(
+    value: String,
+    input: (String) -> Unit,
+    lable: String = "",
+    placeholder: String = "",
+    trailingText: String = ""
+) {
+    AccentText(
+        text = lable, isUnderline = true, modifier = Modifier.padding(50.dp, 0.dp, 0.dp, 5.dp)
+    )
+    OutlinedTextField(value = value, onValueChange = { input(it) }, placeholder = {
+        Text(
+            text = placeholder,
+            color = WabiTheme.colors.translucentColor,
+            style = WabiTheme.fonts.forTextField,
+        )
+    }, singleLine = true, shape = RoundedCornerShape(
+        40.dp
+    ), modifier = Modifier
+        .fillMaxWidth()
+        .wrapContentHeight()
+        .padding(30.dp, 0.dp)
+        .border(
+            width = 2.dp, color = WabiTheme.colors.mainColor, shape = RoundedCornerShape(
+                40.dp
+            )
+        ), textStyle = WabiTheme.fonts.forTextField, colors = TextFieldDefaults.colors(
+        unfocusedContainerColor = WabiTheme.colors.backgroundColor,
+        focusedContainerColor = WabiTheme.colors.backgroundColor,
+        unfocusedTextColor = WabiTheme.colors.mainColor,
+        focusedTextColor = WabiTheme.colors.mainColor,
+        cursorColor = WabiTheme.colors.mainColor
+    ), trailingIcon = {
+        if (trailingText.isNotEmpty()) {
+            Text(
+                text = trailingText,
+                style = WabiTheme.fonts.forTextField,
+                fontSize = 30.sp,
+                modifier = Modifier.padding(0.dp, 0.dp, 10.dp, 0.dp)
+            )
+        }
+    })
+}

+ 104 - 0
mobile_app/new/wabi/app/src/main/java/com/example/wabi/view/components/textFields/PasswordTextField.kt

@@ -0,0 +1,104 @@
+package com.example.wabi.view.components.textFields
+
+import androidx.compose.foundation.border
+import androidx.compose.foundation.layout.Spacer
+import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.layout.size
+import androidx.compose.foundation.layout.width
+import androidx.compose.foundation.layout.wrapContentHeight
+import androidx.compose.foundation.shape.RoundedCornerShape
+import androidx.compose.material3.Icon
+import androidx.compose.material3.IconButton
+import androidx.compose.material3.OutlinedTextField
+import androidx.compose.material3.Text
+import androidx.compose.material3.TextFieldDefaults
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.remember
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.graphics.vector.ImageVector
+import androidx.compose.ui.res.vectorResource
+import androidx.compose.ui.text.input.PasswordVisualTransformation
+import androidx.compose.ui.text.input.VisualTransformation
+import androidx.compose.ui.unit.dp
+import com.example.wabi.R
+import com.example.wabi.ui.theme.WabiTheme
+import com.example.wabi.view.components.texts.AccentText
+
+//поле ввода для пароля
+@Composable
+fun PasswordTextField(
+    value: String,
+    input: (String) -> Unit,
+    lable: String = "",
+    placeholder: String = "",
+) {
+    val visible = remember {
+        mutableStateOf(false)
+    }
+    AccentText(
+        text = lable, isUnderline = true, modifier = Modifier.padding(50.dp, 0.dp, 0.dp, 5.dp)
+    )
+    OutlinedTextField(value = value, onValueChange = { input(it) }, placeholder = {
+        if (visible.value) {
+            Text(
+                text = placeholder,
+                color = WabiTheme.colors.translucentColor,
+                style = WabiTheme.fonts.forTextField,
+            )
+        } else {
+            Text(
+                text = "*************",
+                color = WabiTheme.colors.translucentColor,
+                style = WabiTheme.fonts.forTextField
+            )
+        }
+    }, singleLine = true, shape = RoundedCornerShape(
+        40.dp
+    ), modifier = Modifier
+        .fillMaxWidth()
+        .wrapContentHeight()
+        .padding(30.dp, 0.dp)
+        .border(
+            width = 2.dp, color = WabiTheme.colors.mainColor, shape = RoundedCornerShape(
+                40.dp
+            )
+        ), textStyle = WabiTheme.fonts.forTextField, colors = TextFieldDefaults.colors(
+        unfocusedContainerColor = WabiTheme.colors.backgroundColor,
+        focusedContainerColor = WabiTheme.colors.backgroundColor,
+        unfocusedTextColor = WabiTheme.colors.mainColor,
+        focusedTextColor = WabiTheme.colors.mainColor,
+        cursorColor = WabiTheme.colors.mainColor
+    ), trailingIcon = {
+        IconButton(
+            onClick = { visible.value = !visible.value },
+        ) {
+            if (visible.value) {
+                Icon(
+                    imageVector = ImageVector.vectorResource(
+                        R.drawable.eye_vector
+                    ),
+                    contentDescription = "open",
+                    tint = WabiTheme.colors.mainColor,
+                    modifier = Modifier.size(30.dp)
+                )
+            } else {
+                Icon(
+                    imageVector = ImageVector.vectorResource(
+                        R.drawable.eye_close_vector
+                    ),
+                    contentDescription = "open",
+                    tint = WabiTheme.colors.mainColor,
+                    modifier = Modifier.size(30.dp)
+                )
+            }
+        }
+        Spacer(modifier = Modifier.width(60.dp))
+    }, visualTransformation = if (visible.value) {
+        VisualTransformation.None
+    } else {
+        PasswordVisualTransformation()
+    }
+    )
+}

+ 30 - 0
mobile_app/new/wabi/app/src/main/java/com/example/wabi/view/components/texts/AccentText.kt

@@ -0,0 +1,30 @@
+package com.example.wabi.view.components.texts
+
+import androidx.compose.material3.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.text.style.TextAlign
+import androidx.compose.ui.text.style.TextDecoration
+import androidx.compose.ui.unit.sp
+import com.example.wabi.ui.theme.WabiTheme
+
+@Composable
+fun AccentText(
+    text: String,
+    modifier: Modifier = Modifier,
+    color: Color = WabiTheme.colors.mainColor,
+    fontSize: Int = WabiTheme.fonts.acentFont.fontSize.value.toInt(),
+    isUnderline: Boolean = false,
+    textAlign: TextAlign = TextAlign.Left
+) {
+    Text(
+        text = text,
+        style = WabiTheme.fonts.acentFont,
+        color = color,
+        modifier = modifier,
+        fontSize = fontSize.sp,
+        textDecoration = if (isUnderline) TextDecoration.Underline else TextDecoration.None,
+        textAlign = textAlign
+    )
+}

+ 31 - 0
mobile_app/new/wabi/app/src/main/java/com/example/wabi/view/components/texts/HeaderText.kt

@@ -0,0 +1,31 @@
+package com.example.wabi.view.components.texts
+
+import androidx.compose.material3.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.text.style.TextAlign
+import androidx.compose.ui.unit.sp
+import com.example.wabi.ui.theme.WabiTheme
+
+@Composable
+fun HeaderText(
+    text: String,
+    modifier: Modifier = Modifier,
+    color: Color = WabiTheme.colors.mainColor,
+    fontSize: Int = WabiTheme.fonts.headerFont.fontSize.value.toInt(),
+    textAlign: TextAlign = WabiTheme.fonts.headerFont.textAlign,
+    maxLines: Int = 2,
+    minLines: Int = 2
+) {
+    Text(
+        text = text,
+        style = WabiTheme.fonts.headerFont,
+        color = color,
+        fontSize = fontSize.sp,
+        modifier = modifier,
+        maxLines = maxLines,
+        minLines = minLines,
+        textAlign = textAlign
+    )
+}

+ 26 - 0
mobile_app/new/wabi/app/src/main/java/com/example/wabi/view/components/texts/MainText.kt

@@ -0,0 +1,26 @@
+package com.example.wabi.view.components.texts
+
+import androidx.compose.material3.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.unit.sp
+import com.example.wabi.ui.theme.WabiTheme
+
+@Composable
+fun MainText(
+    text: String,
+    modifier: Modifier = Modifier,
+    color: Color = WabiTheme.colors.mainColor,
+    fontSize: Int = WabiTheme.fonts.mainFont.fontSize.value.toInt()
+) {
+    Text(
+        text = text,
+        style = WabiTheme.fonts.mainFont,
+        color = color,
+        modifier = modifier,
+        minLines = 3,
+        maxLines = 3,
+        fontSize = fontSize.sp
+    )
+}

+ 7 - 8
mobile_app/new/wabi/app/src/main/java/com/example/wabi/view/screeens/onboard/items/PartSlider.kt

@@ -8,7 +8,6 @@ import androidx.compose.foundation.layout.fillMaxWidth
 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.ui.Alignment
 import androidx.compose.ui.Modifier
@@ -16,6 +15,8 @@ import androidx.compose.ui.graphics.vector.ImageVector
 import androidx.compose.ui.res.vectorResource
 import androidx.compose.ui.unit.dp
 import com.example.wabi.ui.theme.WabiTheme
+import com.example.wabi.view.components.texts.HeaderText
+import com.example.wabi.view.components.texts.MainText
 
 @Composable
 fun PartSlider(onboardItem: OnboardListState, modifier: Modifier = Modifier) {
@@ -44,18 +45,16 @@ fun PartSlider(onboardItem: OnboardListState, modifier: Modifier = Modifier) {
             horizontalAlignment = Alignment.CenterHorizontally,
             verticalArrangement = Arrangement.SpaceAround
         ) {
-            Text(
+            HeaderText(
                 text = onboardItem.title,
-                style = WabiTheme.fonts.headerFont,
                 color = WabiTheme.colors.accentColorOne,
+                maxLines = 1,
+                minLines = 1
             )
-            Text(
+            MainText(
                 text = onboardItem.mainText,
-                style = WabiTheme.fonts.mainFont,
-                color = WabiTheme.colors.onBoardLight,
                 modifier = Modifier.padding(50.dp, 0.dp),
-                minLines = 3,
-                maxLines = 3,
+                color = WabiTheme.colors.onBoardLight
             )
         }
     }

+ 4 - 3
mobile_app/new/wabi/app/src/main/java/com/example/wabi/view/screeens/profile/Profile.kt

@@ -1,10 +1,11 @@
 package com.example.wabi.view.screeens.profile
 
-import androidx.compose.material3.Text
 import androidx.compose.runtime.Composable
+import androidx.hilt.navigation.compose.hiltViewModel
 import androidx.navigation.NavHostController
+import com.example.wabi.view.components.buttons.MainButton
 
 @Composable
-fun Profile(navHostController: NavHostController) {
-    Text("Профиль")
+fun Profile(navHostController: NavHostController, vm: ProfileViewModel = hiltViewModel()) {
+    MainButton(onClick = { vm.signOutCurrentUser(navHostController) }, textContent = "Выход")
 }

+ 28 - 0
mobile_app/new/wabi/app/src/main/java/com/example/wabi/view/screeens/profile/ProfileViewModel.kt

@@ -0,0 +1,28 @@
+package com.example.wabi.view.screeens.profile
+
+import androidx.lifecycle.ViewModel
+import androidx.lifecycle.viewModelScope
+import androidx.navigation.NavHostController
+import com.example.wabi.domain.navigation.NavigationProvider
+import com.example.wabi.domain.navigation.Routes
+import com.example.wabi.domain.repository.PrefManager
+import com.example.wabi.domain.repository.UserShareDate
+import com.example.wabi.domain.supabase.SupabaseServiceImpl
+import dagger.hilt.android.lifecycle.HiltViewModel
+import kotlinx.coroutines.launch
+import javax.inject.Inject
+
+@HiltViewModel
+class ProfileViewModel @Inject constructor(
+    private val supabase: SupabaseServiceImpl, private val nav: NavigationProvider
+) : ViewModel() {
+    fun signOutCurrentUser(navController: NavHostController) {
+        viewModelScope.launch {
+            supabase.signOut()
+            PrefManager.initPrefManager(UserShareDate.context!!)
+            PrefManager.clearDataCurrentUser()
+            UserShareDate.userIsLogging.value = false
+            nav.goToNextScreen(navHostController = navController, Routes.PROFILE, Routes.PROFILE)
+        }
+    }
+}

+ 36 - 3
mobile_app/new/wabi/app/src/main/java/com/example/wabi/view/screeens/signIn/SignIn.kt

@@ -1,10 +1,43 @@
 package com.example.wabi.view.screeens.signIn
 
-import androidx.compose.material3.Text
+import androidx.compose.foundation.layout.Arrangement
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.foundation.rememberScrollState
+import androidx.compose.foundation.verticalScroll
 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.hilt.navigation.compose.hiltViewModel
 import androidx.navigation.NavHostController
+import com.example.wabi.view.screeens.signIn.items.EmailForReset
+import com.example.wabi.view.screeens.signIn.items.Login
 
 @Composable
-fun SignIn(navHostController: NavHostController) {
-    Text("Вход")
+fun SignIn(navHostController: NavHostController, vm: SignInViewModel = hiltViewModel()) {
+    val data = vm.data
+    val printError = remember { mutableStateOf(false) }
+    val visible = remember { mutableStateOf(true) }
+
+    Column(
+        modifier = Modifier
+            .fillMaxSize()
+            .verticalScroll(rememberScrollState()),
+        verticalArrangement = Arrangement.SpaceAround,
+        horizontalAlignment = Alignment.CenterHorizontally
+    ) {
+        if (visible.value) {
+            Login(
+                navController = navHostController,
+                printError = printError,
+                visible = visible,
+                data = data,
+                vm = vm
+            )
+        } else {
+            EmailForReset(data.email, vm, visible)
+        }
+    }
 }

+ 7 - 1
mobile_app/new/wabi/app/src/main/java/com/example/wabi/view/screeens/signIn/SignInViewModel.kt

@@ -8,6 +8,7 @@ import androidx.lifecycle.viewModelScope
 import androidx.navigation.NavHostController
 import com.example.wabi.domain.navigation.NavigationProvider
 import com.example.wabi.domain.navigation.Routes
+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
@@ -31,10 +32,15 @@ class SignInViewModel @Inject constructor(
             viewModelScope.launch {
                 val response = supabase.signIn(_data.value.email, _data.value.password)
                 if (response.error == "") {
+
                     UserShareDate.userIsLogging.value = true
                     printError.value = false
+
+                    PrefManager.initPrefManager(UserShareDate.context!!)
+                    PrefManager.saveDataCurrentUser(data.email, data.password)
+
                     nav.goToNextScreen(
-                        navHostController = navController, Routes.SIGNIN, Routes.BASKET
+                        navHostController = navController, Routes.SIGNIN, Routes.PROFILE
                     )
                 } else {
                     Log.d("signIn", "Ошибка входа!")

+ 8 - 13
mobile_app/new/wabi/app/src/main/java/com/example/wabi/view/screeens/signIn/items/EmailForReset.kt

@@ -12,12 +12,13 @@ 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.MainButton
-import com.example.wabi.view.common_elements.textfields.MainTextField
 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.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.signIn.SignInViewModel
 
 @Composable
@@ -31,18 +32,12 @@ fun EmailForReset(email: String, vm: SignInViewModel, visible: MutableState<Bool
             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
+    HeaderText(text = "Восстановите\nпароль")
+
+    MainText(
+        text = "Для восстановления\n" + "пароля введите\n" + "свою почту"
     )
+
     ErrorPrint(text = if (correctEmail.value) ErrorList.emailNotExists else "")
 
     Column() {

+ 17 - 25
mobile_app/new/wabi/app/src/main/java/com/example/wabi/view/screeens/signIn/items/Login.kt

@@ -1,4 +1,4 @@
-package com.example.wabi.view.screens.signIn.states
+package com.example.wabi.view.screeens.signIn.items
 
 import androidx.compose.foundation.layout.Column
 import androidx.compose.foundation.layout.Spacer
@@ -13,15 +13,17 @@ 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.models.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
+import com.example.wabi.view.components.buttons.ButtonLink
+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.signIn.SignInViewModel
 
 @Composable
 fun Login(
@@ -31,18 +33,10 @@ fun Login(
     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
+    HeaderText(
+        text = "Добро\n" + "пожаловать!"
     )
+    MainText(text = "Войдите, чтобы\nпользоваться функциями приложения")
     ErrorPrint(text = if (printError.value) ErrorList.errorPassOrEmail else "")
     Column(
         modifier = Modifier.fillMaxWidth()
@@ -72,10 +66,10 @@ fun Login(
         )
         ButtonLink(
             onClick = {
-                vm.goToRegistration(navController = navController)
+
             },
             textContent = "Зарегистирируйтесь!",
-            modifierButton = Modifier.offset(y = (-15).dp),
+            modifier = Modifier.offset(y = (-15).dp),
             colorContent = WabiTheme.colors.mainColor
         )
         MainButton(
@@ -84,9 +78,7 @@ fun Login(
             },
             enabled = data.password != "" && vm.validateEmail(data.email),
             textContent = "Войти",
-            modifierButton = Modifier
-                .padding(30.dp, 0.dp)
-                .fillMaxWidth()
+            modifier = Modifier.padding(30.dp, 0.dp)
         )
         Spacer(Modifier.height(5.dp))
         ButtonLink(

+ 0 - 8
mobile_app/new/wabi/app/src/main/java/com/example/wabi/view/ui/theme/Type.kt

@@ -6,7 +6,6 @@ import androidx.compose.ui.text.font.Font
 import androidx.compose.ui.text.font.FontFamily
 import androidx.compose.ui.text.font.FontWeight
 import androidx.compose.ui.text.style.TextAlign
-import androidx.compose.ui.text.style.TextDecoration
 import androidx.compose.ui.unit.sp
 import com.example.wabi.R
 import com.example.wabi.models.system.Type
@@ -67,13 +66,6 @@ val type = Type(
         fontSize = 20.sp,
         color = CreamRed
     ),
-    link = TextStyle(
-        fontFamily = EduQLDBeginner,
-        fontWeight = FontWeight.Normal,
-        fontSize = 20.sp,
-        textDecoration = TextDecoration.Underline,
-        lineHeight = 20.sp
-    ),
     forTextField = TextStyle(
         fontFamily = BalooDa2,
         fontWeight = FontWeight.Bold,